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



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

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.gsub('-','_')}")
    end
  end
  if options.only.empty?
    print_notes("Refreshing Bundle")
    refresh_bundle
  end
rescue Exception => e
  print_notes(e.message,"error",:red)
end