pdfkit 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pdfkit might be problematic. Click here for more details.

@@ -1,31 +1,31 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pdfkit (0.5.1)
4
+ pdfkit (0.5.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
+ activesupport (3.0.9)
9
10
  diff-lcs (1.1.2)
10
- mocha (0.9.10)
11
- rake
12
- rack (1.2.1)
13
- rack-test (0.5.6)
11
+ mocha (0.9.12)
12
+ rack (1.3.0)
13
+ rack-test (0.6.0)
14
14
  rack (>= 1.0)
15
- rake (0.8.7)
16
15
  rspec (2.2.0)
17
16
  rspec-core (~> 2.2)
18
17
  rspec-expectations (~> 2.2)
19
18
  rspec-mocks (~> 2.2)
20
- rspec-core (2.2.1)
21
- rspec-expectations (2.2.0)
19
+ rspec-core (2.6.4)
20
+ rspec-expectations (2.6.0)
22
21
  diff-lcs (~> 1.1.2)
23
- rspec-mocks (2.2.0)
22
+ rspec-mocks (2.6.0)
24
23
 
25
24
  PLATFORMS
26
25
  ruby
27
26
 
28
27
  DEPENDENCIES
28
+ activesupport (>= 3.0.8)
29
29
  mocha (>= 0.9.10)
30
30
  pdfkit!
31
31
  rack-test (>= 0.5.6)
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ 2011-07-02
2
+ ==================
3
+ * Bump to 0.5.2
4
+ * Fix of dealing with ActiveSupport::SafeBuffer >= 3.0.8.
5
+ * Fix for meta tag options getting dropped in REE 1.8.7.
6
+ * Fix on bundler environment detection.
7
+
1
8
  2011-06-17
2
9
  ==================
3
10
  * Bump to 0.5.1
@@ -17,7 +17,7 @@ class PDFKit
17
17
  end
18
18
 
19
19
  def wkhtmltopdf
20
- @wkhtmltopdf ||= (defined?(Bundler) ? `bundle exec which wkhtmltopdf` : `which wkhtmltopdf`).chomp
20
+ @wkhtmltopdf ||= (defined?(Bundler::GemfileError) ? `bundle exec which wkhtmltopdf` : `which wkhtmltopdf`).chomp
21
21
  end
22
22
  end
23
23
 
@@ -87,7 +87,7 @@ class PDFKit
87
87
  content.scan(/<meta [^>]*>/) do |meta|
88
88
  if meta.match(/name=["']#{PDFKit.configuration.meta_tag_prefix}/)
89
89
  name = meta.scan(/name=["']#{PDFKit.configuration.meta_tag_prefix}([^"']*)/)[0][0]
90
- found[name] = meta.scan(/content=["']([^"']*)/)[0][0]
90
+ found[name.to_sym] = meta.scan(/content=["']([^"']*)/)[0][0]
91
91
  end
92
92
  end
93
93
 
@@ -103,7 +103,7 @@ class PDFKit
103
103
 
104
104
  stylesheets.each do |stylesheet|
105
105
  if @source.to_s.match(/<\/head>/)
106
- @source.to_s.gsub!(/(<\/head>)/, style_tag_for(stylesheet)+'\1')
106
+ @source = Source.new(@source.to_s.gsub(/(<\/head>)/, style_tag_for(stylesheet)+'\1'))
107
107
  else
108
108
  @source.to_s.insert(0, style_tag_for(stylesheet))
109
109
  end
@@ -1,3 +1,3 @@
1
1
  class PDFKit
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -23,5 +23,6 @@ Gem::Specification.new do |s|
23
23
  s.add_development_dependency(%q<rspec>, ["~> 2.2.0"])
24
24
  s.add_development_dependency(%q<mocha>, [">= 0.9.10"])
25
25
  s.add_development_dependency(%q<rack-test>, [">= 0.5.6"])
26
+ s.add_development_dependency(%q<activesupport>, [">= 3.0.8"])
26
27
  end
27
28
 
@@ -178,6 +178,15 @@ describe PDFKit do
178
178
  pdfkit.stylesheets << css
179
179
  lambda { pdfkit.to_pdf }.should raise_error(PDFKit::ImproperSourceError)
180
180
  end
181
+
182
+ it "should be able to deal with ActiveSupport::SafeBuffer" do
183
+ pdfkit = PDFKit.new(ActiveSupport::SafeBuffer.new "<html><head></head><body>Hai!</body></html>")
184
+ css = File.join(SPEC_ROOT,'fixtures','example.css')
185
+ pdfkit.stylesheets << css
186
+ pdfkit.to_pdf
187
+ pdfkit.source.to_s.should include("<style>#{File.read(css)}</style></head>")
188
+ end
189
+
181
190
  end
182
191
 
183
192
  context "#to_file" do
@@ -7,6 +7,7 @@ require 'rspec/autorun'
7
7
  require 'mocha'
8
8
  require 'rack'
9
9
  require 'rack/test'
10
+ require 'active_support'
10
11
  require 'custom_wkhtmltopdf_path' if File.exists?(File.join(SPEC_ROOT, 'custom_wkhtmltopdf_path.rb'))
11
12
 
12
13
  RSpec.configure do |config|
metadata CHANGED
@@ -1,82 +1,68 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pdfkit
3
- version: !ruby/object:Gem::Version
4
- hash: 9
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 5
9
- - 1
10
- version: 0.5.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jared Pace
14
9
  - Relevance
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-06-17 00:00:00 -06:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
13
+ date: 2011-07-02 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
23
16
  name: rspec
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2152731540 !ruby/object:Gem::Requirement
26
18
  none: false
27
- requirements:
19
+ requirements:
28
20
  - - ~>
29
- - !ruby/object:Gem::Version
30
- hash: 7
31
- segments:
32
- - 2
33
- - 2
34
- - 0
21
+ - !ruby/object:Gem::Version
35
22
  version: 2.2.0
36
23
  type: :development
37
- version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: mocha
40
24
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *2152731540
26
+ - !ruby/object:Gem::Dependency
27
+ name: mocha
28
+ requirement: &2152731020 !ruby/object:Gem::Requirement
42
29
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- hash: 47
47
- segments:
48
- - 0
49
- - 9
50
- - 10
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
51
33
  version: 0.9.10
52
34
  type: :development
53
- version_requirements: *id002
54
- - !ruby/object:Gem::Dependency
55
- name: rack-test
56
35
  prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *2152731020
37
+ - !ruby/object:Gem::Dependency
38
+ name: rack-test
39
+ requirement: &2152730540 !ruby/object:Gem::Requirement
58
40
  none: false
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- hash: 7
63
- segments:
64
- - 0
65
- - 5
66
- - 6
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
67
44
  version: 0.5.6
68
45
  type: :development
69
- version_requirements: *id003
46
+ prerelease: false
47
+ version_requirements: *2152730540
48
+ - !ruby/object:Gem::Dependency
49
+ name: activesupport
50
+ requirement: &2152730060 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: 3.0.8
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *2152730060
70
59
  description: Uses wkhtmltopdf to create PDFs using HTML
71
- email:
60
+ email:
72
61
  - jared@codewordstudios.com
73
62
  executables: []
74
-
75
63
  extensions: []
76
-
77
64
  extra_rdoc_files: []
78
-
79
- files:
65
+ files:
80
66
  - .document
81
67
  - .gitignore
82
68
  - .rspec
@@ -100,41 +86,31 @@ files:
100
86
  - spec/pdfkit_spec.rb
101
87
  - spec/source_spec.rb
102
88
  - spec/spec_helper.rb
103
- has_rdoc: true
104
89
  homepage: http://github.com/jdpace/PDFKit
105
90
  licenses: []
106
-
107
91
  post_install_message:
108
92
  rdoc_options: []
109
-
110
- require_paths:
93
+ require_paths:
111
94
  - lib
112
- required_ruby_version: !ruby/object:Gem::Requirement
95
+ required_ruby_version: !ruby/object:Gem::Requirement
113
96
  none: false
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- hash: 3
118
- segments:
119
- - 0
120
- version: "0"
121
- required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ! '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
102
  none: false
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- hash: 3
127
- segments:
128
- - 0
129
- version: "0"
103
+ requirements:
104
+ - - ! '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
130
107
  requirements: []
131
-
132
108
  rubyforge_project: pdfkit
133
- rubygems_version: 1.6.2
109
+ rubygems_version: 1.8.5
134
110
  signing_key:
135
111
  specification_version: 3
136
112
  summary: HTML+CSS -> PDF
137
- test_files:
113
+ test_files:
138
114
  - spec/fixtures/example.css
139
115
  - spec/fixtures/example.html
140
116
  - spec/middleware_spec.rb