imgkit 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,6 +1,7 @@
1
1
  source :rubygems
2
2
 
3
3
  group :test do
4
+ gem "rake"
4
5
  gem "rspec", "~> 2"
5
6
  gem "rspec-core", "~> 2"
6
7
  gem "mocha"
@@ -2,13 +2,16 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  archive-tar-minitar (0.5.2)
5
- columnize (0.3.2)
5
+ columnize (0.3.4)
6
6
  diff-lcs (1.1.2)
7
- linecache (0.45)
7
+ linecache (0.46)
8
+ rbx-require-relative (> 0.0.4)
8
9
  linecache19 (0.5.12)
9
10
  ruby_core_source (>= 0.1.4)
10
11
  mocha (0.9.12)
11
12
  rack (1.3.0)
13
+ rake (0.9.2.2)
14
+ rbx-require-relative (0.0.5)
12
15
  rspec (2.6.0)
13
16
  rspec-core (~> 2.6.0)
14
17
  rspec-expectations (~> 2.6.0)
@@ -39,6 +42,7 @@ PLATFORMS
39
42
  DEPENDENCIES
40
43
  mocha
41
44
  rack
45
+ rake
42
46
  rspec (~> 2)
43
47
  rspec-core (~> 2)
44
48
  ruby-debug
data/README.md CHANGED
@@ -66,6 +66,20 @@ If you're on Windows or you installed wkhtmltoimage by hand to a location other
66
66
  config.default_format = :png
67
67
  end
68
68
 
69
+ ## Heroku
70
+
71
+ get a version of `wkhtmltoimage` as an amd64 binary and commit it
72
+ to your git repo. I like to put mine in "./bin/wkhtmltoimage-amd64"
73
+
74
+ assuming its in that location you can just do:
75
+
76
+ IMGKit.configure do |config|
77
+ config.wkhtmltoimage = Rails.root.join('bin', 'wkhtmltoimage-amd64').to_s if ENV['RACK_ENV'] == 'production'
78
+ end
79
+
80
+ If you're not using Rails just replace Rails.root with the root dir of your app.
81
+
82
+
69
83
  ## Rails
70
84
 
71
85
  ### Mime Types
@@ -82,7 +96,7 @@ register a .png mime type in:
82
96
  ### Controller Actions
83
97
  You can respond in a controller with:
84
98
 
85
- @kit = IMGKit.new(render_as_string)
99
+ @kit = IMGKit.new(render_to_string)
86
100
 
87
101
  format.jpg do
88
102
  send_data(@kit.to_jpg, :type => "image/jpeg", :disposition => 'inline')
@@ -7,7 +7,7 @@ class IMGKit
7
7
  end
8
8
 
9
9
  def url?
10
- @source.is_a?(String) && @source.match(/^http/)
10
+ @source.is_a?(String) && @source.match(/\Ahttp/)
11
11
  end
12
12
 
13
13
  def file?
@@ -1,3 +1,3 @@
1
1
  class IMGKit
2
- VERSION = "1.3.4"
2
+ VERSION = "1.3.5"
3
3
  end
@@ -17,6 +17,11 @@ describe IMGKit::Source do
17
17
  source = IMGKit::Source.new('<blink>Oh Hai!</blink>')
18
18
  source.should_not be_url
19
19
  end
20
+
21
+ it "should return false if passed HTML with a line starting with 'http'" do
22
+ source = IMGKit::Source.new("<blink>Oh Hai!</blink>\nhttp://google.com")
23
+ source.should_not be_url
24
+ end
20
25
  end
21
26
 
22
27
  describe "#file?" do
metadata CHANGED
@@ -1,23 +1,33 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: imgkit
3
- version: !ruby/object:Gem::Version
4
- version: 1.3.4
3
+ version: !ruby/object:Gem::Version
4
+ hash: 17
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 3
9
+ - 5
10
+ version: 1.3.5
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - csquared
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-11-15 00:00:00.000000000Z
17
+
18
+ date: 2012-02-09 00:00:00 -08:00
19
+ default_executable:
13
20
  dependencies: []
21
+
14
22
  description: Uses wkhtmltoimage to create Images using HTML
15
23
  email: christopher.continanza@gmail.com
16
- executables:
24
+ executables:
17
25
  - imgkit
18
26
  extensions: []
27
+
19
28
  extra_rdoc_files: []
20
- files:
29
+
30
+ files:
21
31
  - .document
22
32
  - .gitignore
23
33
  - .rspec
@@ -42,39 +52,54 @@ files:
42
52
  - spec/source_spec.rb
43
53
  - spec/spec_helper.rb
44
54
  - spec/warning_binary
55
+ has_rdoc: true
45
56
  homepage: http://rubygems.org/gems/imgkit
46
57
  licenses: []
47
- post_install_message: ! "******************************************************************\n\nNow
48
- install wkhtmltoimage binaries:\nGlobal: sudo `which imgkit` --install-wkhtmltoimage\n
49
- \ rvmsudo imgkit --install-wkhtmltoimage\n(installs to default /usr/local/bin/wkhtmltoimage)\n\ninside
50
- RVM folder: export TO=`which imgkit | sed 's:/imgkit:/wkhtmltoimage:'` && imgkit
51
- --install-wkhtmltoimage\n(you'll have to configure the location of the binary if
52
- you do this!)\n\n(run imgkit --help to see more options)\n******************************************************************\n"
58
+
59
+ post_install_message: |
60
+ ******************************************************************
61
+
62
+ Now install wkhtmltoimage binaries:
63
+ Global: sudo `which imgkit` --install-wkhtmltoimage
64
+ rvmsudo imgkit --install-wkhtmltoimage
65
+ (installs to default /usr/local/bin/wkhtmltoimage)
66
+
67
+ inside RVM folder: export TO=`which imgkit | sed 's:/imgkit:/wkhtmltoimage:'` && imgkit --install-wkhtmltoimage
68
+ (you'll have to configure the location of the binary if you do this!)
69
+
70
+ (run imgkit --help to see more options)
71
+ ******************************************************************
72
+
53
73
  rdoc_options: []
54
- require_paths:
74
+
75
+ require_paths:
55
76
  - lib
56
- required_ruby_version: !ruby/object:Gem::Requirement
77
+ required_ruby_version: !ruby/object:Gem::Requirement
57
78
  none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- segments:
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ hash: 3
83
+ segments:
63
84
  - 0
64
- hash: -1173393730622892843
65
- required_rubygems_version: !ruby/object:Gem::Requirement
85
+ version: "0"
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
87
  none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
- version: '0'
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ hash: 3
92
+ segments:
93
+ - 0
94
+ version: "0"
71
95
  requirements: []
96
+
72
97
  rubyforge_project: imgkit
73
- rubygems_version: 1.8.10
98
+ rubygems_version: 1.6.2
74
99
  signing_key:
75
100
  specification_version: 3
76
101
  summary: HTML+CSS -> JPG
77
- test_files:
102
+ test_files:
78
103
  - spec/error_binary
79
104
  - spec/fixtures/example.css
80
105
  - spec/fixtures/example.html