Class: Fetty::Generators::SetupGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/fetty/setup/setup_generator.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Base

banner, source_root

Instance Method Details

#install_gems_dependenciesObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/generators/fetty/setup/setup_generator.rb', line 19

def install_gems_dependencies
  asking "Would you like to setup mongoid gem?" do
    setup_mongoid
  end if options['mongoid']
  @selected_gems = options.only.empty? ? options.reject { |k,v| k == "only" || k == "mongoid" || v == false }.keys : options.only
  @selected_gems.each do |gems|
    asking "Would you like to setup #{gems} gem?" do
      send("setup_#{gems}")
    end
  end
  remove_file 'public/index.html' if file_exists?('public/index.html')
  remove_file 'public/images/rails.png' if file_exists?('public/images/rails.png')
rescue Exception => e
  print_notes(e.message,"error",:red)
end