Class: Cukestart::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/cukestart/cli.rb

Instance Method Summary collapse

Instance Method Details

#feature(feature_name) ⇒ Object



18
19
20
# File 'lib/cukestart/cli.rb', line 18

def feature(feature_name)
  Cukestart::Generator::Feature.start([feature_name])
end

#listObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/cukestart/cli.rb', line 31

def list
  features = `ls -d -1 **/* \| grep '\.feature'`
  features = features.split("\n")
  features.each do |feature|
    puts "--- #{feature}  ---"
    feature_name = `cat #{feature} | grep 'Feature:'`
    puts feature_name if options[:feature]
    scenarios = `cat #{feature} | grep 'Scenario:'`
    scenarios = scenarios.split("\n")
    scenarios.each do |scenario|
      puts scenario if options[:scenario]
    end
  end
end

#project(project_name) ⇒ Object



12
13
14
# File 'lib/cukestart/cli.rb', line 12

def project(project_name)
  Cukestart::Generator::Structure.start([project_name, options[:front], options[:page_object]])
end

#versionObject



24
25
26
# File 'lib/cukestart/cli.rb', line 24

def version
  puts "Cukestart #{File.read(File.expand_path('../version', __FILE__))}"
end