Class: Rsg::Generators::Base

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::AppName, Actions, Options
Defined in:
lib/rsg/generators/base.rb

Class Method Summary collapse

Methods included from Options

configure_basic_options, included

Methods included from Actions

#api_mode?, #append_gem, #confirm?, #enable_railtie, #git_add_commit, #rsg_apply, #rsg_apply_default!, #rsg_generate, #rsg_install, #rsg_options, #rsg_skip_or_confirm, #rsg_state

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/rsg/generators/base.rb', line 24

def self.exit_on_failure?
  true
end

.inherited(base) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rsg/generators/base.rb', line 12

def self.inherited(base)
  super

  parts = base.namespace.split(":")
  return unless parts[0] == "rsg"

  parts = parts[1..-2] + ["templates"]
  templates_path = Pathname.new(__FILE__).dirname.join(*parts).expand_path

  base.source_paths << templates_path if templates_path.exist?
end