pretty_face 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eeab4c0c45efa1e0c84471602ed217324d1fbb01
4
- data.tar.gz: 5287e613358d307e08fcba505125ed06a9b35d7f
3
+ metadata.gz: e45bd28da1c788cbe7b0324de85de7e7f02b587d
4
+ data.tar.gz: e8d403d867e2d9ef08a6e47ff66731f6a3def96b
5
5
  SHA512:
6
- metadata.gz: 21179bfbdf24bfe232595488b6076e623abff89a67595236f84b2ebd23ebb10a27183a2338d623c6b5eb7de6faee3e0bf573a261b659d3d0beabb59c3511b9a3
7
- data.tar.gz: 425c365bd310b737e2e6c8d651531e978c2932afb09bc8e69f0bc697dbcf0888c35609f190bb7d4d70779656feb6c0c5a7fab65503607781ce5ccf5ab3829d0c
6
+ metadata.gz: d28c14e54fe096ee821990d3528189de95b32e67ef0dc4f0b2a57652b0fa036a83830041e6cc505d89472df7f89fd3f628d518ac74bf1010fbb0c6930e507f2b
7
+ data.tar.gz: 65dd7192109d6bfead112994875fc790d3ac3de46cd4e014f6962933c11fc15358d4befd765169566fc73d8a68771c751192811b328a7577e976e530656776ad
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ === Release 0.8.2
2
+ * More issues fixed with Windows
3
+
4
+ === Release 0.8.1
5
+ * Fixing issues with windows paths
6
+
1
7
  === Release 0.8.1 / 2013-8-11
2
8
  * Fixed issue with back link not working when page is nested in directory
3
9
 
@@ -33,7 +33,7 @@ Feature: pretty face report
33
33
 
34
34
  Scenario: It should copy the logo image to the images directory
35
35
  Then the following files should exist:
36
- | results/images/face.jpg |
36
+ | results/images/face.png |
37
37
 
38
38
  Scenario: It should show start time and duration in the header
39
39
  Then the file "results/fixture.html" should contain "started:"
@@ -44,11 +44,12 @@ module PrettyFace
44
44
  end
45
45
 
46
46
  def embed_image(src, label)
47
- @report.current_scenario.image = src.split('/').last
47
+ @report.current_scenario.image = src.split(separator).last
48
48
  @report.current_scenario.image_label = label
49
49
  @report.current_scenario.image_id = "img_#{@img_id}"
50
50
  @img_id += 1
51
- FileUtils.cp src, "#{File.dirname(@path)}/images"
51
+ filename = "#{File.dirname(@path)}#{separator}images"
52
+ FileUtils.cp src, filename
52
53
  end
53
54
 
54
55
  def before_features(features)
@@ -57,7 +58,7 @@ module PrettyFace
57
58
  end
58
59
 
59
60
  def features_summary_file
60
- parts = @io.path.split('/')
61
+ parts = @io.path.split(separator)
61
62
  parts[parts.length - 1]
62
63
  end
63
64
 
@@ -160,9 +161,9 @@ module PrettyFace
160
161
  paths = [@path_to_erb, customization_directory.to_s]
161
162
  renderer = ActionView::Base.new(paths)
162
163
  filename = File.join(@path_to_erb, 'feature')
163
- output_file = "#{File.dirname(@path)}/#{feature.file}"
164
- to_cut = output_file.split('/').last
165
- directory = output_file.sub("/#{to_cut}", '')
164
+ output_file = "#{File.dirname(@path)}#{separator}#{feature.file}"
165
+ to_cut = output_file.split(separator).last
166
+ directory = output_file.sub("#{separator}#{to_cut}", '')
166
167
  FileUtils.mkdir directory unless File.directory? directory
167
168
  file = File.new(output_file, Cucumber.file_mode('w'))
168
169
  file.puts renderer.render(:file => filename, :locals => {:feature => feature, :logo => @logo, :customize => custom_feature_header?})
@@ -176,12 +177,12 @@ module PrettyFace
176
177
  end
177
178
 
178
179
  def make_directory(dir)
179
- path = "#{File.dirname(@path)}/#{dir}"
180
+ path = "#{File.dirname(@path)}#{separator}#{dir}"
180
181
  FileUtils.mkdir path unless File.directory? path
181
182
  end
182
183
 
183
184
  def copy_directory(dir, file_names, file_extension)
184
- path = "#{File.dirname(@path)}/#{dir}"
185
+ path = "#{File.dirname(@path)}#{separator}#{dir}"
185
186
  file_names.each do |file|
186
187
  copy_file File.join(File.dirname(__FILE__), '..', 'templates', "#{file}.#{file_extension}"), path
187
188
  end
@@ -269,6 +270,10 @@ module PrettyFace
269
270
  end
270
271
  @cells << values
271
272
  end
273
+
274
+ def separator
275
+ File::ALT_SEPARATOR || File::SEPARATOR
276
+ end
272
277
  end
273
278
  end
274
279
  end
@@ -25,12 +25,16 @@ module PrettyFace
25
25
 
26
26
  def directory_prefix_for(source=nil)
27
27
  dir = ''
28
- back_dir = source.count('/') if source
28
+ back_dir = source.count(separator) if source
29
29
  back_dir.times do
30
- dir += '../'
30
+ dir += "..#{separator}"
31
31
  end
32
32
  dir
33
33
  end
34
+
35
+ def separator
36
+ File::ALT_SEPARATOR || File::SEPARATOR
37
+ end
34
38
  end
35
39
 
36
40
 
@@ -91,8 +95,8 @@ module PrettyFace
91
95
  @title = feature.title
92
96
  @duration = Time.now - start_time
93
97
  a_file = feature.file.sub(/\.feature/, '.html')
94
- to_cut = a_file.split('/').first
95
- @file = a_file.sub("#{to_cut}/", '')
98
+ to_cut = a_file.split(separator).first
99
+ @file = a_file.sub("#{to_cut}#{separator}", '')
96
100
  end
97
101
 
98
102
  def steps
@@ -147,7 +151,11 @@ module PrettyFace
147
151
  end
148
152
 
149
153
  def file
150
- @file.split('features/').last
154
+ @file.split("features#{separator}").last
155
+ end
156
+
157
+ def parent_filename
158
+ @parent_filename.split(separator).last
151
159
  end
152
160
  end
153
161
 
@@ -1,3 +1,3 @@
1
1
  module PrettyFace
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_face
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey S. Morgan
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-08-11 00:00:00.000000000 Z
15
+ date: 2013-08-16 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: actionpack