Class: Hephaestus::Generators::Base

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

Class Method Summary collapse

Methods included from ExitOnFailure

#bundle_command

Methods included from Actions

#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #gem, #replace_in_file, #replace_in_files

Class Method Details

.default_source_rootObject



14
15
16
# File 'lib/hephaestus/generators/base.rb', line 14

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

.inherited(subclass) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/hephaestus/generators/base.rb', line 18

def 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 # rubocop:disable Lint/SuppressedException
end