stepdown 0.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -12,3 +12,11 @@ A feature and step file analysis tool.
12
12
  * Number of scenarios
13
13
  * Usage per scenario
14
14
  * Scenario grouping (number of times used with another step)
15
+
16
+ == Installation
17
+ Stepdown is available as a ruby gem
18
+ gem install stepdown
19
+
20
+ == Usage
21
+ stepdown <step definition directory> <feature file directory>
22
+ e.g. stepdown features/step_definitions features
data/bin/stepdown CHANGED
@@ -3,25 +3,15 @@ lib = File.expand_path('../lib/', __FILE__)
3
3
  $:.unshift lib unless $:.include?(lib)
4
4
 
5
5
  require 'step_down'
6
-
7
- def show_help
8
- puts "Usage: stepdown step_definition_dir feature_file_directory"
9
- puts "eg. stepdown ./features/step_definitions/ ./features/"
10
- end
6
+ require 'options'
11
7
 
12
8
  begin
13
9
 
14
- if ARGV[0] =~ /(-h|--help)/ || ARGV.length != 2
15
- show_help
16
- exit
17
- end
10
+ Options.parse(ARGV)
11
+ Options.validate
12
+
13
+ StepDown.new(Options.steps_dir, Options.features_dir).analyse
18
14
 
19
- if ARGV.length <=> 2
20
- default_path = Dir.pwd
21
- StepDown.new(default_path + "/features/step_definitions", default_path + "/features").analyse
22
- else
23
- StepDown.new(ARGV[0], ARGV[1]).analyse
24
- end
25
15
  rescue Interrupt => e
26
16
  puts "Quiting..."
27
17
  exit 1
data/lib/options.rb ADDED
@@ -0,0 +1,64 @@
1
+ require 'optparse'
2
+
3
+ class Options
4
+
5
+ def self.parse(params)
6
+ @@steps_dir = "features/step_definitions"
7
+ @@features_dir = "features"
8
+
9
+ parser = OptionParser.new do |opts|
10
+ opts.banner = "Usage: stepdown step_definition_dir feature_file_directory"
11
+
12
+ opts.separator("")
13
+
14
+ opts.on("--steps=directory", "Step definition directory") do |o|
15
+ @@steps_dir = o
16
+ end
17
+
18
+ opts.on("--features=directory", "Feature file directory") do |o|
19
+ @@features_dir = o
20
+ end
21
+
22
+ opts.on_tail("-h", "--help", "You're looking at it") do |o|
23
+ puts opts
24
+ exit
25
+ end
26
+
27
+ end
28
+
29
+ begin
30
+ parser.parse(params)
31
+
32
+ if parser.getopts.length == 0 && params.length == 2
33
+ @@steps_dir = params[0]
34
+ @@features_dir = params[1]
35
+ end
36
+
37
+ rescue OptionParser::ParseError => e
38
+ puts e
39
+ exit 1
40
+ end
41
+ end
42
+
43
+ def self.validate
44
+ @@steps_dir = File.join(Dir.pwd, @@steps_dir)
45
+ @@features_dir = File.join(Dir.pwd, @@features_dir)
46
+
47
+ [@@steps_dir, @@features_dir].each do |dir|
48
+ unless File.exists?(dir)
49
+ puts "Directory #{dir} does not exist"
50
+ exit 1
51
+ end
52
+ end
53
+
54
+ end
55
+
56
+ def self.steps_dir
57
+ @@steps_dir
58
+ end
59
+
60
+ def self.features_dir
61
+ @@features_dir
62
+ end
63
+
64
+ end
data/stepdown.gemspec CHANGED
@@ -1,17 +1,19 @@
1
1
 
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "stepdown"
4
- s.version = "0.2"
4
+ s.version = "0.2.1"
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = "Sean Caffery"
7
7
  s.email = "sean@lineonpoint.com"
8
8
  s.summary = "Analysis tool for Cucumber features"
9
- s.description = "Step down allows you to see where your most used Cucumber steps are and will help in refactoring"
9
+ s.homepage = "https://github.com/seancaffery/step-down"
10
+ s.description = "Step down allows you to see where your most used Cucumber steps are, and will help in refactoring"
10
11
 
11
12
  s.required_rubygems_version = ">= 1.3.6"
12
13
  s.rubyforge_project = "stepdown"
13
14
 
14
15
  s.add_dependency('haml', '>= 2.0.0')
16
+ s.add_development_dependency('rspec', ">= 2.0.0")
15
17
  s.files = `git ls-files`.split("\n")
16
18
  s.executables = ["stepdown"]
17
19
  s.default_executable = "stepdown"
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stepdown
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- version: "0.2"
9
+ - 1
10
+ version: 0.2.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Sean Caffery
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-02-15 00:00:00 +11:00
18
+ date: 2011-02-20 00:00:00 +11:00
18
19
  default_executable: stepdown
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -33,7 +34,23 @@ dependencies:
33
34
  version: 2.0.0
34
35
  type: :runtime
35
36
  version_requirements: *id001
36
- description: Step down allows you to see where your most used Cucumber steps are and will help in refactoring
37
+ - !ruby/object:Gem::Dependency
38
+ name: rspec
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 15
46
+ segments:
47
+ - 2
48
+ - 0
49
+ - 0
50
+ version: 2.0.0
51
+ type: :development
52
+ version_requirements: *id002
53
+ description: Step down allows you to see where your most used Cucumber steps are, and will help in refactoring
37
54
  email: sean@lineonpoint.com
38
55
  executables:
39
56
  - stepdown
@@ -51,6 +68,7 @@ files:
51
68
  - lib/counting_step.rb
52
69
  - lib/feature_parser.rb
53
70
  - lib/html_reporter.rb
71
+ - lib/options.rb
54
72
  - lib/scenario.rb
55
73
  - lib/step.rb
56
74
  - lib/step_down.rb
@@ -64,7 +82,7 @@ files:
64
82
  - templates/main.html.haml
65
83
  - templates/style.sass
66
84
  has_rdoc: true
67
- homepage:
85
+ homepage: https://github.com/seancaffery/step-down
68
86
  licenses: []
69
87
 
70
88
  post_install_message: