reqres_rspec 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reqres_rspec/generators/pdf.rb +2 -2
- data/lib/reqres_rspec/version.rb +1 -1
- data/lib/reqres_rspec/writers/html.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a0141ca3ffe58920e111bd9ec30c6eea0cdef59
|
4
|
+
data.tar.gz: e692311f521021e74cd83e0fd70be0a4f825425f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd2767eac4eb2a419bf589d05ed3fd93013a37b3f5a1301701bc9fd2da943fe6cf637d25ba6129ff4ce30690254c399192e5ee236e2f9ee7c0899b69472afaf2
|
7
|
+
data.tar.gz: 996cef849785571f5de2a812fa2052f913d031e3bc1e81a7427c02b8aa5584539c6ac582f8ffc85b2d05bb441c683d15e304f9d1c96413d40130f6f1a7254b11
|
@@ -5,8 +5,8 @@ module ReqresRspec
|
|
5
5
|
# TODO: more info
|
6
6
|
def generate
|
7
7
|
wkhtmltopdf_path = '/Applications/wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf'
|
8
|
-
html_docs_root = File.join(Rails.root, '
|
9
|
-
pdf_doc_path = File.join(Rails.root, '
|
8
|
+
html_docs_root = File.join(Rails.root, 'doc')
|
9
|
+
pdf_doc_path = File.join(Rails.root, 'doc', "spec_#{Time.now.strftime("%d-%h-%Y_%H-%M")}.pdf")
|
10
10
|
|
11
11
|
if File.exists?(wkhtmltopdf_path)
|
12
12
|
files = Dir["#{html_docs_root}/rspec_docs_*.html"]
|
data/lib/reqres_rspec/version.rb
CHANGED
@@ -26,7 +26,7 @@ module ReqresRspec
|
|
26
26
|
# deletes previous version of HTML docs
|
27
27
|
# TODO: more info
|
28
28
|
def cleanup
|
29
|
-
FileUtils.rm_rf(Dir.glob("#{Rails.root}/
|
29
|
+
FileUtils.rm_rf(Dir.glob("#{Rails.root}/doc/rspec_docs_*.html"), secure: true)
|
30
30
|
end
|
31
31
|
|
32
32
|
# generates contents of HTML docs
|
@@ -35,7 +35,7 @@ module ReqresRspec
|
|
35
35
|
tpl_path = File.join(File.dirname(__FILE__), 'templates', 'header.erb')
|
36
36
|
rendered_doc = ERB.new(File.open(tpl_path).read).result(binding)
|
37
37
|
|
38
|
-
path = File.join(Rails.root, '
|
38
|
+
path = File.join(Rails.root, 'doc', 'rspec_docs_00000.html')
|
39
39
|
file = File.open(path, 'w')
|
40
40
|
file.write(rendered_doc)
|
41
41
|
file.close
|
@@ -53,7 +53,7 @@ module ReqresRspec
|
|
53
53
|
|
54
54
|
rendered_doc = ERB.new(File.open(tpl_path).read).result(binding)
|
55
55
|
|
56
|
-
path = File.join(Rails.root, '
|
56
|
+
path = File.join(Rails.root, 'doc', "rspec_docs_#{('0000' + (@index).to_s)[-5, 5]}.html")
|
57
57
|
file = File.open(path, 'w')
|
58
58
|
file.write(rendered_doc)
|
59
59
|
file.close
|