Class: Ez::Generators::SetUpGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Ez::Generators::SetUpGenerator
- Defined in:
- lib/generators/ez/set_up_generator.rb
Instance Method Summary collapse
- #create_gemfile_and_config ⇒ Object
-
#initialize(args, *options) ⇒ SetUpGenerator
constructor
A new instance of SetUpGenerator.
- #set_up_gems ⇒ Object
Constructor Details
#initialize(args, *options) ⇒ SetUpGenerator
Returns a new instance of SetUpGenerator.
10 11 12 13 14 |
# File 'lib/generators/ez/set_up_generator.rb', line 10 def initialize(args, *) super f= File.new File.join SetUpGenerator::source_root,'Gemfile' @content = f.readlines end |
Instance Method Details
#create_gemfile_and_config ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/generators/ez/set_up_generator.rb', line 16 def create_gemfile_and_config copy_file 'Gemfile', 'Gemfile' template 'database.yml', 'config/database.yml' Bundler.with_clean_env do run "bundle install" end run 'rake rails:update:bin' end |
#set_up_gems ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/generators/ez/set_up_generator.rb', line 27 def set_up_gems generate 'simple_form:install --bootstrap' if gems? 'simple_form' generate 'nested_form:install' if gems? 'nested_form' run 'compass install bootstrap -r bootstrap-sass' generate 'rspec:install' if gems? 'rspec' generate 'html5:install' if gems? 'compass-h5bp' rake 'haml:erb2haml' if gems? 'haml-rails' run 'cap install' if gems? 'capistrano' copy_file 'Capfile','Capfile' end |