tagregate 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -1
- data/Gemfile.lock +12 -1
- data/README.rdoc +32 -12
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/tagregate/count.rb +1 -0
- data/lib/tagregate/file.rb +42 -0
- data/lib/tasks/tagregate.rake +7 -0
- data/tagregate.gemspec +10 -6
- metadata +24 -6
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,16 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
+
builder (3.0.0)
|
5
|
+
cucumber (1.1.9)
|
6
|
+
builder (>= 2.1.2)
|
7
|
+
diff-lcs (>= 1.1.2)
|
8
|
+
gherkin (~> 2.9.0)
|
9
|
+
json (>= 1.4.6)
|
10
|
+
term-ansicolor (>= 1.0.6)
|
4
11
|
diff-lcs (1.1.3)
|
12
|
+
gherkin (2.9.1)
|
13
|
+
json (>= 1.4.6)
|
5
14
|
git (1.2.5)
|
6
15
|
jeweler (1.8.3)
|
7
16
|
bundler (~> 1.0)
|
@@ -20,11 +29,13 @@ GEM
|
|
20
29
|
rspec-expectations (2.8.0)
|
21
30
|
diff-lcs (~> 1.1.2)
|
22
31
|
rspec-mocks (2.8.0)
|
32
|
+
term-ansicolor (1.0.7)
|
23
33
|
|
24
34
|
PLATFORMS
|
25
35
|
ruby
|
26
36
|
|
27
37
|
DEPENDENCIES
|
28
|
-
bundler (~> 1.
|
38
|
+
bundler (~> 1.1.1)
|
39
|
+
cucumber
|
29
40
|
jeweler (~> 1.8.3)
|
30
41
|
rspec (~> 2.8.0)
|
data/README.rdoc
CHANGED
@@ -1,19 +1,39 @@
|
|
1
|
-
=
|
1
|
+
= Tagregate
|
2
2
|
|
3
|
-
|
3
|
+
Tagregate adds helpful Rake tasks to Ruby on Rails applications that use Cucumber tags.
|
4
4
|
|
5
|
-
==
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
== Why?
|
6
|
+
|
7
|
+
We now have a rather extensive Cucumber test suite at HowAboutWe, but even when
|
8
|
+
it was smaller, it quickly became apparent that the long time it took to run the
|
9
|
+
entire suite was negatively impacting our development process.
|
10
|
+
|
11
|
+
While any sufficiently large Cucumber suite will eventually need more
|
12
|
+
substantial optimizations like parallel execution and fast hardware, a
|
13
|
+
reasonable first step for us was to begin tagging each new feature with the
|
14
|
+
areas of the codebase most related to our test. Then for example if we were
|
15
|
+
reworking the signup page, we could run the @signup tag, get a decent level
|
16
|
+
of confidence in the regression risk of our change, and only have to wait for a
|
17
|
+
subset of our entire Cucumber test suite to finish running.
|
18
|
+
|
19
|
+
Eventually we had a considerable number of tags in our suite, so we wrote
|
20
|
+
Tagregate to help us keep them organized and valuable.
|
21
|
+
|
22
|
+
== Included Rake Tasks
|
23
|
+
rake cucumber:tagregate:count
|
24
|
+
Prints the name and number of occurrences of all Cucumber tags found in your
|
25
|
+
application's features/ directory
|
26
|
+
|
27
|
+
rake cucumber:tagregate:file
|
28
|
+
Prints the name of each tag, along with each file in which the tag is being used.
|
29
|
+
|
30
|
+
== Installation
|
31
|
+
# In your Rails application's Gemfile...
|
32
|
+
group :test, :development do
|
33
|
+
gem "tagregate"
|
34
|
+
end
|
14
35
|
|
15
36
|
== Copyright
|
16
37
|
|
17
38
|
Copyright (c) 2012 HowAboutWe. See LICENSE.txt for
|
18
39
|
further details.
|
19
|
-
|
data/Rakefile
CHANGED
@@ -17,7 +17,7 @@ Jeweler::Tasks.new do |gem|
|
|
17
17
|
gem.homepage = "http://github.com/howaboutwe/tagregate"
|
18
18
|
gem.license = "MIT"
|
19
19
|
gem.summary = %Q{Tagregate your app's cucumber tags}
|
20
|
-
gem.description = %Q{Tagregate
|
20
|
+
gem.description = %Q{Tagregate adds helpful Rake tasks to Ruby on Rails applications that use Cucumber tags.}
|
21
21
|
gem.email = "dev@howaboutwe.com"
|
22
22
|
gem.authors = ["Bryan Woods", "Matt Vermaak"]
|
23
23
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/tagregate/count.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
module Tagregate
|
2
|
+
class File
|
3
|
+
def initialize(step_mother, io, options)
|
4
|
+
@io = io
|
5
|
+
@summary = {}
|
6
|
+
end
|
7
|
+
|
8
|
+
def before_feature(feature)
|
9
|
+
@current_file = feature.file
|
10
|
+
end
|
11
|
+
|
12
|
+
def after_tags(tags)
|
13
|
+
if defined?(tags.tag_names)
|
14
|
+
tag_names = tags.tag_names
|
15
|
+
else
|
16
|
+
tag_names = tags.tags.map(&:name)
|
17
|
+
end
|
18
|
+
|
19
|
+
tag_names.each do |name|
|
20
|
+
@summary[name] ||= []
|
21
|
+
|
22
|
+
unless @summary[name].include? @current_file
|
23
|
+
@summary[name] << @current_file
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def after_features(whatever)
|
29
|
+
keys = @summary.keys.sort
|
30
|
+
|
31
|
+
keys.each do |k|
|
32
|
+
@io.puts k
|
33
|
+
|
34
|
+
@summary[k].each do |file_name|
|
35
|
+
@io.puts "\t-#{file_name}"
|
36
|
+
end
|
37
|
+
|
38
|
+
@io.puts "\n"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/tasks/tagregate.rake
CHANGED
@@ -6,5 +6,12 @@ namespace :cucumber do
|
|
6
6
|
|
7
7
|
t.cucumber_opts = "--dry-run features -r #{path} --format Tagregate::Count #{tags}"
|
8
8
|
end
|
9
|
+
|
10
|
+
Cucumber::Rake::Task.new(:file, "List the file names in which tags occur") do |t|
|
11
|
+
tags = ENV["TAGS"].present? ? "--tags #{ENV["TAGS"]}" : ""
|
12
|
+
path = File.join(File.dirname(__FILE__), "..", "tagregate", "file")
|
13
|
+
|
14
|
+
t.cucumber_opts = "--dry-run features -r #{path} --format Tagregate::File #{tags}"
|
15
|
+
end
|
9
16
|
end
|
10
17
|
end
|
data/tagregate.gemspec
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "tagregate"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bryan Woods", "Matt Vermaak"]
|
12
|
-
s.date = "2012-03-
|
13
|
-
s.description = "Tagregate
|
12
|
+
s.date = "2012-03-30"
|
13
|
+
s.description = "Tagregate adds helpful Rake tasks to Ruby on Rails applications that use Cucumber tags."
|
14
14
|
s.email = "dev@howaboutwe.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
"VERSION",
|
28
28
|
"lib/tagregate.rb",
|
29
29
|
"lib/tagregate/count.rb",
|
30
|
+
"lib/tagregate/file.rb",
|
30
31
|
"lib/tasks/tagregate.rake",
|
31
32
|
"spec/spec_helper.rb",
|
32
33
|
"spec/tagregate_spec.rb",
|
@@ -43,17 +44,20 @@ Gem::Specification.new do |s|
|
|
43
44
|
|
44
45
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
46
|
s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
|
46
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.
|
47
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.1.1"])
|
47
48
|
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
49
|
+
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
48
50
|
else
|
49
51
|
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
50
|
-
s.add_dependency(%q<bundler>, ["~> 1.
|
52
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.1"])
|
51
53
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
54
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
52
55
|
end
|
53
56
|
else
|
54
57
|
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
55
|
-
s.add_dependency(%q<bundler>, ["~> 1.
|
58
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.1"])
|
56
59
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
60
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
57
61
|
end
|
58
62
|
end
|
59
63
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tagregate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-30 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
requirements:
|
36
36
|
- - ~>
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: 1.
|
38
|
+
version: 1.1.1
|
39
39
|
type: :development
|
40
40
|
prerelease: false
|
41
41
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - ~>
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 1.
|
46
|
+
version: 1.1.1
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: jeweler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,7 +60,24 @@ dependencies:
|
|
60
60
|
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: 1.8.3
|
63
|
-
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: cucumber
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
description: Tagregate adds helpful Rake tasks to Ruby on Rails applications that
|
80
|
+
use Cucumber tags.
|
64
81
|
email: dev@howaboutwe.com
|
65
82
|
executables: []
|
66
83
|
extensions: []
|
@@ -78,6 +95,7 @@ files:
|
|
78
95
|
- VERSION
|
79
96
|
- lib/tagregate.rb
|
80
97
|
- lib/tagregate/count.rb
|
98
|
+
- lib/tagregate/file.rb
|
81
99
|
- lib/tasks/tagregate.rake
|
82
100
|
- spec/spec_helper.rb
|
83
101
|
- spec/tagregate_spec.rb
|
@@ -97,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
97
115
|
version: '0'
|
98
116
|
segments:
|
99
117
|
- 0
|
100
|
-
hash: -
|
118
|
+
hash: -233205943357842986
|
101
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
120
|
none: false
|
103
121
|
requirements:
|