Skip to content
Browse files

Merge branch 'add_hammer' into my_pulls

* add_hammer:
  Janus Tools/Hammer: Use the new syntax to install the plugin.
  Rakefile: Add a method to install a gem

Conflicts:
	Rakefile
  • Loading branch information...
2 parents f9f83be + 34bccca commit 1479a2656b0dd6a5f5500d83935093e2c0980d07 @kalbasit kalbasit committed Nov 2, 2011
Showing with 18 additions and 17 deletions.
  1. +15 −0 Rakefile
  2. +3 −17 janus-tools/tasks/hammer.rake
View
15 Rakefile
@@ -48,6 +48,21 @@ def find_gem(gem_name)
end
end
+# Install a gem
+#
+# @param [String] The gem name
+def install_gem(gem_name)
+ require 'rubygems'
+
+ # Install the gem only if it can't be found
+ if find_gem(gem_name).length == 0
+ sh "gem install #{gem_name}"
+ end
+rescue Janus::RubyGemsNotFoundError
+ puts "Could not install the gem #{gem_name}, please do so manually."
+ puts "gem install #{gem_name}"
+end
+
# Install a plugin
#
# @param [String] The group the plugin belongs to
View
20 janus-tools/tasks/hammer.rake
@@ -1,18 +1,4 @@
-namespace :plugins do
- desc "Install the hammer plugin."
- task :install_hammer do
- begin
- if find_gem('github-markup').length == 0
- sh "gem install github-markup"
- end
- if find_gem('redcarpet').length == 0
- sh "gem install redcarpet"
- end
- rescue Janus::RubyGemsNotFoundError
- puts "Could not install github-markup and redcarpet, please install them manually."
- puts "gem install github-markup redcarpet"
- end
- end
-
- task :install => :install_hammer
+install_vim_plugin "janus-tools", "hammer" do
+ install_gem 'github-markup'
+ install_gem 'redcarpet'
end

0 comments on commit 1479a26

Please sign in to comment.
Something went wrong with that request. Please try again.