earl-report 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/earl-report +2 -2
- data/lib/earl_report.rb +5 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/bin/earl-report
CHANGED
@@ -62,7 +62,7 @@ opts.each do |opt, arg|
|
|
62
62
|
when '--name' then options[:name] = arg
|
63
63
|
when '--output' then options[:io] = File.open(arg, "w")
|
64
64
|
when '--rc' then options[:rc] = true
|
65
|
-
when '--template' then options[:template] = arg
|
65
|
+
when '--template' then options[:template] = (File.open(arg, "r") unless arg.empty?)
|
66
66
|
when '--verbose' then options[:verbose] = true
|
67
67
|
when '--help' then usage
|
68
68
|
else
|
@@ -84,7 +84,7 @@ if options.has_key?(:rc)
|
|
84
84
|
end
|
85
85
|
|
86
86
|
# If requesting template, just return it
|
87
|
-
if options.has_key?(:template) && options[:template].
|
87
|
+
if options.has_key?(:template) && options[:template].nil?
|
88
88
|
File.open(File.expand_path("../../lib/earl_report/views/earl_report.html.haml", __FILE__)) do |f|
|
89
89
|
options[:io].write(f.read)
|
90
90
|
end
|
data/lib/earl_report.rb
CHANGED
@@ -237,8 +237,12 @@ class EarlReport
|
|
237
237
|
io.read
|
238
238
|
end
|
239
239
|
when :html
|
240
|
-
template = options[:template]
|
240
|
+
template = case options[:template]
|
241
|
+
when String then options[:tempate]
|
242
|
+
when IO, StringIO then options[:template].read
|
243
|
+
else
|
241
244
|
File.read(File.expand_path('../earl_report/views/earl_report.html.haml', __FILE__))
|
245
|
+
end
|
242
246
|
|
243
247
|
# Generate HTML report
|
244
248
|
html = Haml::Engine.new(template, :format => :xhtml).render(self, :tests => json_hash)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: earl-report
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: linkeddata
|