Class: ScaffoldingCommands

Inherits:
Thor
  • Object
show all
Defined in:
lib/commands/scaffolding_commands.rb

Overview

:reek:FeatureEnvy { enabled: false } :reek:UtilityFunction { enabled: false }

Instance Method Summary collapse

Instance Method Details

#feature(name) ⇒ Object



29
30
31
# File 'lib/commands/scaffolding_commands.rb', line 29

def feature(name)
  handle_scaffolding(name, 'feature')
end

#helper(name) ⇒ Object



49
50
51
# File 'lib/commands/scaffolding_commands.rb', line 49

def helper(name)
  handle_scaffolding(name, 'helper')
end

#page(name) ⇒ Object



17
18
19
# File 'lib/commands/scaffolding_commands.rb', line 17

def page(name)
  handle_scaffolding(name, 'page')
end

#scaffold(name) ⇒ Object



55
56
57
58
59
60
61
62
# File 'lib/commands/scaffolding_commands.rb', line 55

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
  end
  Scaffolding.new([name, load_config_path('page')]).generate_class
end

#spec(name) ⇒ Object



39
40
41
# File 'lib/commands/scaffolding_commands.rb', line 39

def spec(name)
  handle_scaffolding(name, 'spec')
end