Class: Maguro::AppGenerator

Inherits:
Rails::Generators::AppGenerator
  • Object
show all
Defined in:
lib/maguro/app_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ AppGenerator

Overriding Rails::Generators::AppGenerator#finish_template. Allows maguro to do stuff before the default rails generator is run.



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/maguro/app_generator.rb', line 30

def initialize(*args)
  super

  check_ruby_version

  # Thor's option hash is frozen. Unfreeze so we can update our own variables on it.
  # Risk: Don't accidentally modify options you didn't mean to!
  self.options = options.dup

  set_custom_options
end

Instance Method Details

#finish_templateObject

Overriding Rails::Generators::AppGenerator#finish_template. This will run our maguro customizations after all of the default rails customizations.



45
46
47
48
49
# File 'lib/maguro/app_generator.rb', line 45

def finish_template
  Maguro::Features.new(builder).run_all_updates

  super
end