Class: Suspenders::Generators::Base

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Actions
Defined in:
lib/suspenders/generators/base.rb

Class Method Summary collapse

Methods included from Actions

#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #replace_in_file

Class Method Details

.default_source_rootObject



9
10
11
# File 'lib/suspenders/generators/base.rb', line 9

def self.default_source_root
  File.expand_path(File.join("..", "..", "..", "templates"), __dir__)
end

.inherited(subclass) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/suspenders/generators/base.rb', line 13

def self.inherited(subclass)
  super

  description_file = File.expand_path(
    File.join(
      default_source_root,
      "descriptions",
      "#{subclass.generator_name}.md"
    )
  )

  subclass.desc File.read(description_file)
rescue Errno::ENOENT
end