Class: Jax::Generators::RailsBase

Inherits:
NamedBase
  • Object
show all
Defined in:
lib/generators/jax/base/rails_base.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SourceRoot

#source_root

Methods included from CoffeeGenerator

included

Constructor Details

#initialize(args = [], options = {}, config = {}) ⇒ RailsBase

Returns a new instance of RailsBase.



15
16
17
18
19
20
21
# File 'lib/generators/jax/base/rails_base.rb', line 15

def initialize(args = [], options = {}, config = {})
  super
  if self.options[:rails] && equiv = rails_equivalent
    args << "--skip-namespace" # otherwise everything ends up in jax/, the opposite of what we want
    ::Rails::Generators.invoke(equiv, args, config)
  end
end

Class Method Details

.rails_equivalent(&block) ⇒ Object



8
9
10
# File 'lib/generators/jax/base/rails_base.rb', line 8

def self.rails_equivalent(&block)
  self.rails_equivalent_block = block
end