aruba 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aruba (0.4.2)
4
+ aruba (0.4.3)
5
5
  bcat (>= 0.6.1)
6
6
  childprocess (>= 0.1.9)
7
7
  cucumber (>= 0.10.7)
@@ -16,17 +16,17 @@ GEM
16
16
  builder (3.0.0)
17
17
  childprocess (0.1.9)
18
18
  ffi (~> 1.0.6)
19
- cucumber (0.10.7)
19
+ cucumber (1.0.0)
20
20
  builder (>= 2.1.2)
21
21
  diff-lcs (>= 1.1.2)
22
- gherkin (~> 2.4.0)
22
+ gherkin (~> 2.4.1)
23
23
  json (>= 1.4.6)
24
24
  term-ansicolor (>= 1.0.5)
25
25
  diff-lcs (1.1.2)
26
26
  ffi (1.0.9)
27
- gherkin (2.4.0)
27
+ gherkin (2.4.1)
28
28
  json (>= 1.4.6)
29
- json (1.5.2)
29
+ json (1.5.3)
30
30
  rack (1.3.0)
31
31
  rdiscount (1.6.8)
32
32
  rspec (2.6.0)
data/History.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [v0.4.3](https://github.com/cucumber/aruba/compare/v0.4.2...v0.4.3)
2
+
3
+ * Aruba reporting now creates an index file for reports, linking them all together. (Aslak Hellesøy)
4
+
1
5
  ## [v0.4.2](https://github.com/cucumber/aruba/compare/v0.4.1...v0.4.2)
2
6
 
3
7
  * Appending to a file creates the parent directory if it doesn't exist. (Aslak Hellesøy)
data/README.md CHANGED
@@ -96,6 +96,7 @@ Aruba can generate a HTML page for each scenario that contains:
96
96
  * The output from those commands (in colour if the output uses ANSI escapes)
97
97
  * The files that were created (syntax highlighted in in colour)
98
98
 
99
+ In addition to this, it creates an `index.html` file with links to all individual report files.
99
100
  Reporting is off by default, but you can enable it by defining the `ARUBA_REPORT_DIR` environment variable, giving it the value
100
101
  where reports should be written:
101
102
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'aruba'
5
- s.version = '0.4.2'
5
+ s.version = '0.4.3'
6
6
  s.authors = ["Aslak Hellesøy", "David Chelimsky", "Mike Sassak"]
7
7
  s.description = 'CLI Steps for Cucumber, hand-crafted for you in Aruba'
8
8
  s.summary = "aruba-#{s.version}"
@@ -10,6 +10,14 @@ if(ENV['ARUBA_REPORT_DIR'])
10
10
 
11
11
  module Aruba
12
12
  module Reporting
13
+ class << self
14
+ def reports
15
+ @reports ||= Hash.new do |hash, feature|
16
+ hash[feature] = []
17
+ end
18
+ end
19
+ end
20
+
13
21
  def pygmentize(file)
14
22
  pygmentize = Process.new(%{pygmentize -f html -O encoding=utf-8 "#{file}"}, 3, 0.5)
15
23
  pygmentize.run! do |p|
@@ -75,23 +83,40 @@ if(ENV['ARUBA_REPORT_DIR'])
75
83
  def depth
76
84
  File.dirname(@scenario.feature.file).split('/').length
77
85
  end
86
+
87
+ def index
88
+ erb = ERB.new(template('index.erb'), nil, '-')
89
+ erb.result(binding)
90
+ end
91
+
92
+ def index_title
93
+ "Examples"
94
+ end
78
95
  end
79
96
  end
80
97
  World(Aruba::Reporting)
81
98
 
82
- Before do |scenario|
99
+ After do |scenario|
83
100
  @scenario = scenario
84
- end
85
-
86
- After do
87
- report_file = File.join(ENV['ARUBA_REPORT_DIR'], "#{@scenario.feature.file}:#{@scenario.line}.html")
101
+ html_file = "#{scenario.feature.file}:#{scenario.line}.html"
102
+ report_file = File.join(ENV['ARUBA_REPORT_DIR'], html_file)
88
103
  _mkdir(File.dirname(report_file))
89
104
  File.open(report_file, 'w') do |io|
90
105
  io.write(report)
91
106
  end
92
107
 
108
+ Aruba::Reporting.reports[scenario.feature] << [scenario, html_file]
109
+
93
110
  FileUtils.cp_r(File.join(ENV['ARUBA_REPORT_TEMPLATES'], '.'), ENV['ARUBA_REPORT_DIR'])
94
111
  Dir["#{ENV['ARUBA_REPORT_DIR']}/**/*.erb"].each{|f| FileUtils.rm(f)}
95
112
  end
113
+
114
+ at_exit do
115
+ index_file = File.join(ENV['ARUBA_REPORT_DIR'], "index.html")
116
+ extend(Aruba::Reporting)
117
+ File.open(index_file, 'w') do |io|
118
+ io.write(index)
119
+ end
120
+ end
96
121
  end
97
122
 
@@ -0,0 +1,20 @@
1
+ <!doctype html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
6
+ <title><%= index_title %></title>
7
+ </head>
8
+ <body>
9
+
10
+ <h2><%= index_title %></h2>
11
+ <% Aruba::Reporting.reports.keys.sort{|f1, f2| f1.title <=> f2.title}.each do |feature| -%>
12
+ <h3><%= feature.title %></h3>
13
+ <ul>
14
+ <% Aruba::Reporting.reports[feature].each do |scenario, report_path| %>
15
+ <li><a href="<%= report_path%>"><%= scenario.title %></a></li>
16
+ <% end -%>
17
+ </ul>
18
+ <% end -%>
19
+
20
+ </body>
@@ -26,7 +26,7 @@
26
26
  <h3>Output</h3>
27
27
  <pre class="console">
28
28
  <% commands.each do |cmd| -%>
29
- <%= cmd %>
29
+ $ <%= cmd %>
30
30
  <% end -%>
31
31
  <%= output %>
32
32
  </pre>
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: aruba
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.2
5
+ version: 0.4.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Aslak Helles\xC3\xB8y"
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2011-06-20 00:00:00 Z
15
+ date: 2011-06-25 00:00:00 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: cucumber
@@ -113,6 +113,7 @@ files:
113
113
  - templates/images/page_white.png
114
114
  - templates/images/page_white_gherkin.png
115
115
  - templates/images/page_white_ruby.png
116
+ - templates/index.erb
116
117
  - templates/js/filesystem.js
117
118
  - templates/js/jquery-1.6.1.min.js
118
119
  - templates/main.erb
@@ -129,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
130
  requirements:
130
131
  - - ">="
131
132
  - !ruby/object:Gem::Version
132
- hash: -2316163156739878685
133
+ hash: 1621863180174633909
133
134
  segments:
134
135
  - 0
135
136
  version: "0"
@@ -138,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
139
  requirements:
139
140
  - - ">="
140
141
  - !ruby/object:Gem::Version
141
- hash: -2316163156739878685
142
+ hash: 1621863180174633909
142
143
  segments:
143
144
  - 0
144
145
  version: "0"
@@ -148,7 +149,7 @@ rubyforge_project:
148
149
  rubygems_version: 1.8.5
149
150
  signing_key:
150
151
  specification_version: 3
151
- summary: aruba-0.4.2
152
+ summary: aruba-0.4.3
152
153
  test_files:
153
154
  - features/exit_statuses.feature
154
155
  - features/file_system_commands.feature