Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created April 29, 2015 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenderlove/1a4609a6cf9e306e5b81 to your computer and use it in GitHub Desktop.
Save tenderlove/1a4609a6cf9e306e5b81 to your computer and use it in GitHub Desktop.
diff --git a/Rakefile b/Rakefile
index 15c7b7c..5a622e7 100644
--- a/Rakefile
+++ b/Rakefile
@@ -64,7 +64,24 @@ $hoe = Hoe.spec 'psych' do
end
end
end
-$hoe.spec.files << 'lib/psych.jar'
+
+def gem_build_path
+ File.join 'pkg', $hoe.spec.full_name
+end
+
+def add_file_to_gem relative_path
+ target_path = File.join gem_build_path, relative_path
+ target_dir = File.dirname(target_path)
+ mkdir_p target_dir unless File.directory?(target_dir)
+ rm_f target_path
+ safe_ln relative_path, target_path
+ p "HI MOM" => relative_path
+ $hoe.spec.files.concat [relative_path]
+end
+
+if java?
+ add_file_to_gem 'lib/psych.jar'
+end
Hoe.add_include_dirs('.:lib/psych')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment