Class: Eucalypt::Generators::Helper
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Eucalypt::Generators::Helper
- Includes:
- Helpers, Thor::Actions
- Defined in:
- lib/eucalypt/generate/namespaces/generate-helper/generators/helper.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
12 13 14 |
# File 'lib/eucalypt/generate/namespaces/generate-helper/generators/helper.rb', line 12 def self.source_root File.join File.dirname(__dir__), 'templates' end |
Instance Method Details
#generate(spec: true, name:) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/eucalypt/generate/namespaces/generate-helper/generators/helper.rb', line 16 def generate(spec: true, name:) helper = Inflect.new(:helper, name) config = {class_name: helper.class_name} template("helper.tt", helper.file_path, config) template("helper_spec.tt", helper.spec_path, config) if spec end |