wisepdf 1.2.7 → 1.2.8
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.
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/wisepdf/configuration.rb +5 -0
- data/lib/wisepdf/writer.rb +5 -6
- data/wisepdf.gemspec +2 -2
- metadata +3 -3
data/README.md
CHANGED
@@ -243,7 +243,7 @@ Know other projects? Then contact me and I will add them to the list.
|
|
243
243
|
|
244
244
|
## Credits
|
245
245
|
|
246
|
-

|
247
247
|
|
248
248
|
Wisepsd is maintained by [JetRockets](http://www.jetrockets.ru/en).
|
249
249
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.8
|
@@ -39,6 +39,11 @@ module Wisepdf
|
|
39
39
|
(defined?(RAILS_ENV) && RAILS_ENV == 'test')
|
40
40
|
end
|
41
41
|
|
42
|
+
def production?
|
43
|
+
(defined?(::Rails) && ::Rails.env == 'production') ||
|
44
|
+
(defined?(RAILS_ENV) && RAILS_ENV == 'production')
|
45
|
+
end
|
46
|
+
|
42
47
|
def windows?
|
43
48
|
RbConfig::CONFIG['target_os'] == 'mingw32'
|
44
49
|
end
|
data/lib/wisepdf/writer.rb
CHANGED
@@ -9,13 +9,12 @@ module Wisepdf
|
|
9
9
|
|
10
10
|
def to_pdf(string, options={})
|
11
11
|
invoke = self.command(options).join(' ')
|
12
|
-
self.log(invoke)
|
12
|
+
self.log(invoke) unless Wisepdf::Configuration.production?
|
13
13
|
|
14
|
-
result
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
[stdout.read, stderr.read]
|
14
|
+
result = IO.popen(invoke, "wb+") do |pdf|
|
15
|
+
pdf.puts(string)
|
16
|
+
pdf.close_write
|
17
|
+
pdf.gets(nil)
|
19
18
|
end
|
20
19
|
|
21
20
|
raise Wisepdf::WriteError if result.to_s.strip.empty?
|
data/wisepdf.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "wisepdf"
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Igor Alexandrov"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-02-20"
|
13
13
|
s.description = "wisepdf uses the shell utility wkhtmltopdf to serve a PDF file to a user from HTML. In other words, rather than dealing with a PDF generation DSL of some sort, you simply write an HTML view as you would normally, and let pdf take care of the hard stuff."
|
14
14
|
s.email = "igor.alexandrov@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wisepdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.8
|
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-
|
12
|
+
date: 2013-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sqlite3
|
@@ -201,7 +201,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
segments:
|
203
203
|
- 0
|
204
|
-
hash: -
|
204
|
+
hash: -3944344494222947093
|
205
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
206
|
none: false
|
207
207
|
requirements:
|