pretty_face 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ === Release 0.4 / 2013-4-13
2
+ * Make replacement items optional
3
+ * Updated actionpack dependency to the latest version 3.2.13
4
+
1
5
  === Release 0.3 / 2013-3-9
2
6
  * Allow users to provide replacement logo for report
3
7
  * Allow users to provide replacement header for top level page
data/README.md CHANGED
@@ -6,7 +6,21 @@ The current release is very basic but you can expect a lot more over the next mo
6
6
 
7
7
  --format PrettyFace::Formatter::Html --out index.html
8
8
 
9
+ ## Customizing the report
9
10
 
11
+ Starting with version 0.3 of the gem you can customize some elements on the report. You will do this by first creating a directory named `pretty_face` in the `features/support` directory. Customization files should be placed in this directory.
12
+
13
+ ### Changing the image on all pages
14
+
15
+ To replace the image that appears at the top of all pages you simply need to place a file in the customization directory named `logo.png`. The extention can be png, gif, jpg, or jpeg but the filename must be logo in all lower case. The image will look best if it is around 220 X 220 pixels.
16
+
17
+ ### Replacing the header on the main landing page
18
+
19
+ To replace the header that appears at the top of the main landing page you simply need to create a file in the customization directory that contains the html you wish to display. The file must be named `_suite_header.erb`.
20
+
21
+ ### Replacing the header on the feature pages
22
+
23
+ To replace the header that appears on all of the pages with details about features you simply need to create a file in the customization directory that contains the html you wish to display. The file must be named `_feature_header.erb`.
10
24
 
11
25
  ## Known Issues
12
26
 
@@ -120,6 +120,8 @@ module PrettyFace
120
120
  end
121
121
 
122
122
  def custom_suite_header?
123
+ return false unless customization_directory
124
+
123
125
  Dir.foreach(customization_directory) do |file|
124
126
  return true if file == '_suite_header.erb'
125
127
  end
@@ -127,6 +129,8 @@ module PrettyFace
127
129
  end
128
130
 
129
131
  def custom_feature_header?
132
+ return false unless customization_directory
133
+
130
134
  Dir.foreach(customization_directory) do |file|
131
135
  return true if file == '_feature_header.erb'
132
136
  end
@@ -1,3 +1,3 @@
1
1
  module PrettyFace
2
- VERSION = "0.3"
2
+ VERSION = "0.4"
3
3
  end
data/pretty_face.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency "actionpack"
21
+ s.add_dependency "actionpack", ">= 3.2.13"
22
22
 
23
23
  s.add_development_dependency "cucumber"
24
24
  s.add_development_dependency "rspec"
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ module PrettyFace::Formatter
4
+ class Html
5
+ def customization_directory
6
+ nil
7
+ end
8
+ end
9
+ end
10
+
11
+ describe PrettyFace::Formatter::Html do
12
+ let(:formatter) { Html.new(nil, nil, nil) }
13
+
14
+ context "when not customizing the report" do
15
+ it "indicates that there are no custom components" do
16
+ formatter.custom_suite_header?.should be_false
17
+ formatter.custom_feature_header?.should be_false
18
+ formatter.send(:logo_file).should be_nil
19
+ end
20
+
21
+ end
22
+
23
+ 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.3'
4
+ version: '0.4'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-03-09 00:00:00.000000000 Z
14
+ date: 2013-04-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: actionpack
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ! '>='
22
22
  - !ruby/object:Gem::Version
23
- version: '0'
23
+ version: 3.2.13
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -28,7 +28,7 @@ dependencies:
28
28
  requirements:
29
29
  - - ! '>='
30
30
  - !ruby/object:Gem::Version
31
- version: '0'
31
+ version: 3.2.13
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: cucumber
34
34
  requirement: !ruby/object:Gem::Requirement
@@ -167,6 +167,7 @@ files:
167
167
  - sample_report/some_code/ordered_xml_markup.rb
168
168
  - sample_report/some_code/summary.rb
169
169
  - sample_report/yellow_o.jpg
170
+ - spec/lib/customization_spec.rb
170
171
  - spec/lib/html_formatter_spec.rb
171
172
  - spec/spec_helper.rb
172
173
  homepage: http://github.com/cheezy/pretty_face
@@ -181,18 +182,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
182
  - - ! '>='
182
183
  - !ruby/object:Gem::Version
183
184
  version: '0'
184
- segments:
185
- - 0
186
- hash: -2360201377690045592
187
185
  required_rubygems_version: !ruby/object:Gem::Requirement
188
186
  none: false
189
187
  requirements:
190
188
  - - ! '>='
191
189
  - !ruby/object:Gem::Version
192
190
  version: '0'
193
- segments:
194
- - 0
195
- hash: -2360201377690045592
196
191
  requirements: []
197
192
  rubyforge_project: pretty_face
198
193
  rubygems_version: 1.8.25
@@ -209,5 +204,6 @@ test_files:
209
204
  - features/support/hooks.rb
210
205
  - features/support/logo.png
211
206
  - features/support/pretty_face/blah.txt
207
+ - spec/lib/customization_spec.rb
212
208
  - spec/lib/html_formatter_spec.rb
213
209
  - spec/spec_helper.rb