lib/playmo.rb in playmo-0.1.1 vs lib/playmo.rb in playmo-0.1.2

- old
+ new

@@ -1,7 +1,15 @@ # encoding: utf-8 -require 'rails/all' +begin + require 'rails/all' +rescue LoadError + puts "Rails is not installed!" + puts "It seems to lack some needed gems for further work." + puts "If you are using RVM it may mean that Playmo was installed to another gemset." + puts "Try to install Playmo again with 'gem install playmo' or switch to another gemset that already have installed Playmo." + exit! +end # Recipes order: # rails # locale # markup @@ -22,10 +30,12 @@ # setup_database # gemfile # git module Playmo + ROOT = File.dirname(__FILE__) + "/../" + extend ActiveSupport::Autoload class Railtie < Rails::Railtie config.app_generators do |g| path = File::expand_path('../generators/templates', __FILE__) @@ -42,10 +52,10 @@ class ::Object include Playmo::Recipe end - Dir["#{File.dirname(__FILE__)}/playmo/recipes/*_recipe.rb"].each { |f| require f } + Dir["#{ROOT}/recipes/*_recipe.rb"].each { |f| require f } end