htmlcuke 2.0.3 → 2.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b13616fd06fa25c4f83603eaed79792cba0719b6
4
- data.tar.gz: 30f4b9c0371d0952c9b46d9b5d1ff8cc2dddf0b8
3
+ metadata.gz: 982c7bf37759df7fdb22826f1c2513c5135cc2fc
4
+ data.tar.gz: 2bfe8bf60e54c7e4809d4c9c8d5e8b5f745d3c28
5
5
  SHA512:
6
- metadata.gz: 60bf4a8b1c2530d472acff190924746e3c8e64689e584001470012162e2e49c52b7c3beff8a6a590210a048cd2d607fd4822d4e9e5465e62d5adf580798393fa
7
- data.tar.gz: e80558bf93ba44e36b998444f44c5e0358e1436c4938c17fbccb783a0ca60b6db4d223bd8440acc1a3d8bb0bfea0f2c3ca162d8b2b67188a1c389ee71e26b3e0
6
+ metadata.gz: 4db7cccc9d5d569e77c8e3fbb91ebb5f9bd10b8be820acc4bd120d9390b447471ba89939c9994f9ca39cfbb67103e43ec3410b4c7565d41388f7e9af1c5a4717
7
+ data.tar.gz: 211f429ae4c3f7ee47aa03641560da6cbe1cda194e091e389795459a52b78910fe32624599ef487562d195891f70ab7f3aa07a8e17259b726578db009d68a31a
data/README.md CHANGED
@@ -8,11 +8,11 @@ The formatter also embeds a screenshot link of the last window focused in a fail
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- gem 'htmlcuke'
11
+ gem 'htmlcuke', '~> 2.0.3'
12
12
 
13
13
  And then execute:
14
14
 
15
- $ bundle
15
+ $ bundle install
16
16
 
17
17
  Or install it yourself as:
18
18
 
@@ -1,75 +1,74 @@
1
1
  require 'cucumber/formatter/html'
2
2
 
3
- module Cucumber
4
- module Formatter
5
- class CustomHtml < Cucumber::Formatter::Html
6
-
7
- def print_messages
8
- return if @delayed_messages.empty?
9
-
10
- @delayed_messages.each do |msg|
11
- @builder.li(:class => 'step message') do
12
- modified_msg = msg
13
- modified_msg.to_s.gsub!(/\[[0-9;]*m/, '') # Remove color codes from colorizer/puts for HTML format only
14
- @builder << modified_msg
15
- end
3
+ module Htmlcuke
4
+ class Formatter < Cucumber::Formatter::Html
5
+
6
+ def print_messages
7
+ return if @delayed_messages.empty?
8
+
9
+ @delayed_messages.each do |msg|
10
+ @builder.li(:class => 'step message') do
11
+ modified_msg = msg
12
+ modified_msg.to_s.gsub!(/\[[0-9;]*m/, '') # Remove color codes from colorizer/puts for HTML format only
13
+ @builder << modified_msg
16
14
  end
17
- empty_messages
18
15
  end
16
+ empty_messages
17
+ end
19
18
 
20
- def embed_image(src, label)
21
- id = "img_#{@img_id}"
22
- modified_src = src
23
- modified_src = modified_src.split(',')
24
- modified_src = modified_src.drop(1) unless modified_src.size != 2
25
- modified_src = modified_src[0]
26
- @img_id += 1
27
- @builder.span(:class => 'embed') do |pre|
28
- pre << %{<a href="" onclick="img=document.getElementById('#{id}'); img.style.display = 'none'; window.open('#{modified_src}', '_blank');return false">#{label}</a><br>&nbsp;
29
- <img id="#{id}" style="display: none" src="#{modified_src}"/>} unless label == 'Screenshot' # if you want the image to show up on the same page change to: img.style.display = (img.style.display == 'none' ? 'block' : 'none')
30
- end
19
+ def embed_image(src, label)
20
+ id = "img_#{@img_id}"
21
+ modified_src = src
22
+ modified_src = modified_src.split(',')
23
+ modified_src = modified_src.drop(1) unless modified_src.size != 2
24
+ modified_src = modified_src[0]
25
+ @img_id += 1
26
+ @builder.span(:class => 'embed') do |pre|
27
+ pre << %{<a href="" onclick="img=document.getElementById('#{id}'); img.style.display = 'none'; window.open('#{modified_src}', '_blank');return false">#{label}</a><br>&nbsp;
28
+ <img id="#{id}" style="display: none" src="#{modified_src}"/>} unless label == 'Screenshot' # if you want the image to show up on the same page change to: img.style.display = (img.style.display == 'none' ? 'block' : 'none')
31
29
  end
30
+ end
32
31
 
33
- def before_features(features)
34
- @step_count = features && features.step_count || 0
35
-
36
- # <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
37
- @builder.declare!(
38
- :DOCTYPE,
39
- :html,
40
- :PUBLIC,
41
- '-//W3C//DTD XHTML 1.0 Strict//EN',
42
- 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'
43
- )
44
-
45
- @builder << '<html xmlns ="http://www.w3.org/1999/xhtml">'
46
- @builder.head do
47
- @builder.meta('http-equiv' => 'Content-Type', :content => 'text/html;charset=utf-8')
48
- @builder.title 'Cucumber'
49
- inline_css
50
- inline_js
51
- end
52
- @builder << '<body>'
53
- @builder << "<!-- Step count #{@step_count}-->"
54
- @builder << '<div class="cucumber">'
55
- @builder.div(:id => 'cucumber-header') do
56
- @builder.div(:id => 'label') do
57
- @builder.h1('Cucumber Features')
58
- end
59
- @builder.div(:id => 'summary') do
60
- @builder.p('',:id => 'totals')
61
- @builder.p('',:id => 'duration')
62
- end
32
+ def before_features(features)
33
+ @step_count = features && features.step_count || 0
34
+
35
+ # <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
36
+ @builder.declare!(
37
+ :DOCTYPE,
38
+ :html,
39
+ :PUBLIC,
40
+ '-//W3C//DTD XHTML 1.0 Strict//EN',
41
+ 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'
42
+ )
43
+
44
+ @builder << '<html xmlns ="http://www.w3.org/1999/xhtml">'
45
+ @builder.head do
46
+ @builder.meta('http-equiv' => 'Content-Type', :content => 'text/html;charset=utf-8')
47
+ @builder.title 'Cucumber'
48
+ inline_css
49
+ inline_js
50
+ end
51
+ @builder << '<body>'
52
+ @builder << "<!-- Step count #{@step_count}-->"
53
+ @builder << '<div class="cucumber">'
54
+ @builder.div(:id => 'cucumber-header') do
55
+ @builder.div(:id => 'label') do
56
+ @builder.h1('Cucumber Features')
63
57
  end
64
- @builder.div(:id => 'expand-collapse') do
65
- @builder.p('Hide Passing', :id => 'hide_passing', :class => 'hide_passing')
66
- @builder.p('Hide Failing', :id => 'hide_failing', :class => 'hide_failing')
67
- @builder.p('Hide Pending', :id=> 'hide_pending', :class => 'hide_pending')
58
+ @builder.div(:id => 'summary') do
59
+ @builder.p('',:id => 'totals')
60
+ @builder.p('',:id => 'duration')
68
61
  end
69
62
  end
63
+ @builder.div(:id => 'expand-collapse') do
64
+ @builder.p('Hide Passing', :id => 'hide_passing', :class => 'hide_passing')
65
+ @builder.p('Hide Failing', :id => 'hide_failing', :class => 'hide_failing')
66
+ @builder.p('Hide Pending', :id=> 'hide_pending', :class => 'hide_pending')
67
+ end
68
+ end
70
69
 
71
- def inline_js_content
72
- <<-EOF
70
+ def inline_js_content
71
+ <<-EOF
73
72
 
74
73
  SCENARIOS = "h3[id^='scenario_'],h3[id^=background_]";
75
74
  FAILED_SCENARIOS = "h3[style*='rgb(196, 13, 13)']";
@@ -188,9 +187,8 @@ module Cucumber
188
187
  $('#'+element_id).css('color', '#000000');
189
188
  }
190
189
 
191
- EOF
192
- end
193
-
190
+ EOF
194
191
  end
192
+
195
193
  end
196
- end
194
+ end
@@ -1,3 +1,3 @@
1
1
  module Htmlcuke
2
- VERSION = "2.0.3"
2
+ VERSION = "2.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmlcuke
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ray