Class: GenerateCommand
- Inherits:
-
Object
- Object
- GenerateCommand
- Defined in:
- lib/commands/generate_command.rb
Instance Method Summary collapse
- #accepts_shell_command?(command) ⇒ Boolean
- #continue_test_loop? ⇒ Boolean
- #execute_from_shell(params) ⇒ Object
- #generate(framework, kata_file) ⇒ Object
-
#initialize(shell, view, scaffolder) ⇒ GenerateCommand
constructor
A new instance of GenerateCommand.
Constructor Details
#initialize(shell, view, scaffolder) ⇒ GenerateCommand
Returns a new instance of GenerateCommand.
3 4 5 6 7 |
# File 'lib/commands/generate_command.rb', line 3 def initialize shell, view, scaffolder @shell = shell @view = view @scaffolder = scaffolder end |
Instance Method Details
#accepts_shell_command?(command) ⇒ Boolean
26 27 28 |
# File 'lib/commands/generate_command.rb', line 26 def accepts_shell_command? command command == 'setup' end |
#continue_test_loop? ⇒ Boolean
30 31 32 |
# File 'lib/commands/generate_command.rb', line 30 def continue_test_loop? false end |
#execute_from_shell(params) ⇒ Object
9 10 11 |
# File 'lib/commands/generate_command.rb', line 9 def execute_from_shell params generate params[1], params[2] end |
#generate(framework, kata_file) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/commands/generate_command.rb', line 13 def generate framework, kata_file if not kata_file then @view.show_missing_command_argument_error "setup", "kata_file" return end begin @scaffolder.scaffold framework, kata_file @view.show "\n" + @shell.read_file("README") rescue @view.show_unknown_framework_error framework, @scaffolder.list_templates end end |