Class: ScaffoldingCommands
- Inherits:
-
Thor
- Object
- Thor
- ScaffoldingCommands
- Defined in:
- lib/commands/scaffolding_commands.rb
Overview
:reek:FeatureEnvy { enabled: false } :reek:UtilityFunction { enabled: false } :reek:RepeatedConditional { enabled: false }
Instance Method Summary collapse
- #feature(name) ⇒ Object
- #helper(name) ⇒ Object
- #page(name) ⇒ Object
- #scaffold(name) ⇒ Object
- #spec(name) ⇒ Object
- #steps(name) ⇒ Object
Instance Method Details
#feature(name) ⇒ Object
32 33 34 35 36 |
# File 'lib/commands/scaffolding_commands.rb', line 32 def feature(name) return delete_scaffolding(name, 'feature') if [:delete] generate_scaffolding(name, 'feature', [:path]) end |
#helper(name) ⇒ Object
56 57 58 59 60 |
# File 'lib/commands/scaffolding_commands.rb', line 56 def helper(name) return delete_scaffolding(name, 'helper') if [:delete] generate_scaffolding(name, 'helper', [:path]) end |
#page(name) ⇒ Object
18 19 20 21 22 |
# File 'lib/commands/scaffolding_commands.rb', line 18 def page(name) return delete_scaffolding(name, 'page') if [:delete] generate_scaffolding(name, 'page', [:path]) end |
#scaffold(name) ⇒ Object
76 77 78 79 80 81 82 83 84 |
# File 'lib/commands/scaffolding_commands.rb', line 76 def scaffold(name) if Pathname.new('spec').exist? && !Pathname.new('features').exist? Scaffolding.new([name, load_config_path('spec')]).generate_spec else Scaffolding.new([name, load_config_path('feature')]).generate_feature Scaffolding.new([name, load_config_path('steps')]).generate_steps end Scaffolding.new([name, load_config_path('page')]).generate_page end |
#spec(name) ⇒ Object
44 45 46 47 48 |
# File 'lib/commands/scaffolding_commands.rb', line 44 def spec(name) return delete_scaffolding(name, 'spec') if [:delete] generate_scaffolding(name, 'spec', [:path]) end |
#steps(name) ⇒ Object
68 69 70 71 72 |
# File 'lib/commands/scaffolding_commands.rb', line 68 def steps(name) return delete_scaffolding(name, 'steps') if [:delete] generate_scaffolding(name, 'steps', [:path]) end |