lib/playmo/recipes/rvm_recipe.rb in playmo-0.0.18 vs lib/playmo/recipes/rvm_recipe.rb in playmo-0.1.0
- old
+ new
@@ -1,19 +1,12 @@
-module Playmo
- module Recipes
- class RvmRecipe < Playmo::Recipe
- source_root File.expand_path('../templates/rvm_recipe', __FILE__)
-
- def setup
- silently do
- if system 'which rvm'
- run "cd #{application_name} && rvm #{RUBY_VERSION}@#{application_name} --rvmrc --create"
- end
- end
+recipe :rvm do
+ description 'This will create .rvmrc file for your app if rvm is available'
+ after :capistrano
+
+ silently do
+ if system 'which rvm > /dev/null'
+ in_root do
+ run "rvm #{RUBY_VERSION}@#{application_name} --rvmrc --create"
end
end
end
-end
-
-# Write down this recipe to our Cookbook if it's available
-require File.dirname(__FILE__) + '/capistrano_recipe'
-Playmo::Cookbook.instance.insert_after(Playmo::Recipes::CapistranoRecipe, Playmo::Recipes::RvmRecipe) if defined?(Playmo::Cookbook)
+end
\ No newline at end of file