wisepdf 1.2.7 → 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
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
- ![JetRockets](http://www.jetrockets.ru/images/logo.png)
246
+ ![JetRockets](http://www.jetrockets.ru/public/logo.png)
247
247
 
248
248
  Wisepsd is maintained by [JetRockets](http://www.jetrockets.ru/en).
249
249
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.7
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
@@ -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) if Wisepdf::Configuration.development? || Wisepdf::Configuration.test?
12
+ self.log(invoke) unless Wisepdf::Configuration.production?
13
13
 
14
- result, err = Open3.popen3(invoke) do |stdin, stdout, stderr|
15
- stdin.binmode
16
- stdin.write(string)
17
- stdin.close
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?
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "wisepdf"
8
- s.version = "1.2.7"
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-01-10"
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.7
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-01-10 00:00:00.000000000 Z
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: -1965210465825970962
204
+ hash: -3944344494222947093
205
205
  required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  none: false
207
207
  requirements: