websnap 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -2,6 +2,8 @@ LICENSE
2
2
  Manifest
3
3
  README.md
4
4
  Rakefile
5
+ bin/wkhtml_image_executable.rb
6
+ bin/wkhtmltoimage-amd64
5
7
  bin/wkhtmltoimage-linux-i386-0.10.0
6
8
  bin/wkhtmltoimage-osx-i386-0.10.0
7
9
  bin/wkhtmltoimage-proxy
data/README.md CHANGED
@@ -32,6 +32,12 @@ Create snapshot of webpage. Uses [wkhtmltoimage](http://github.com/antialize/wkh
32
32
  kit = WebSnap::Snapper.new('http://google.com')
33
33
  kit = WebSnap::Snapper.new(File.new('/path/to/html'))
34
34
 
35
+ ## Changes
36
+
37
+ ### 0.1.5
38
+
39
+ - Added supports on x86_64 platform, thanks @willywos for the [PR](https://github.com/siuying/websnap/pull/6)
40
+
35
41
  ## Attributions
36
42
 
37
43
  * This application use wkhtmltoimage as backend
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'echoe'
4
4
  require 'rake'
5
5
  require 'rspec/core/rake_task'
6
6
 
7
- Echoe.new("websnap", "0.1.4") do |p|
7
+ Echoe.new("websnap", "0.1.5") do |p|
8
8
  p.author = "Francis Chong"
9
9
  p.description = "Create snapshot of webpage"
10
10
  p.url = "http://github.com/siuying/websnap"
@@ -0,0 +1,26 @@
1
+ class WkhtmlImageExecutable
2
+ attr_reader :system_platform
3
+
4
+ def initialize(args={})
5
+ @system_platform = args[:system_platform] || default_platform
6
+ end
7
+
8
+ def default_platform
9
+ RUBY_PLATFORM
10
+ end
11
+
12
+ def binary_wkhtmltoimage
13
+ case @system_platform
14
+ when /x86_64-linux/
15
+ 'wkhtmltoimage-amd64'
16
+ when /linux/
17
+ 'wkhtmltoimage-linux-i386-0.10.0'
18
+ when /darwin/
19
+ 'wkhtmltoimage-osx-i386-0.10.0'
20
+ else
21
+ raise "No bundled binaries found for your system. Please install wkhtmltopdf."
22
+ end
23
+ end
24
+ end
25
+
26
+
Binary file
@@ -1,21 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ require File.expand_path(File.dirname(__FILE__) + '/wkhtml_image_executable')
4
+
3
5
  executable = `which wkhtmltoimage`.chomp
4
6
 
5
7
  if executable.empty?
6
-
7
- binary = case RUBY_PLATFORM
8
- when /linux/
9
- 'wkhtmltoimage-linux-i386-0.10.0'
10
- when /darwin/
11
- 'wkhtmltoimage-osx-i386-0.10.0'
12
- else
13
- raise "No bundled binaries found for your system. Please install wkhtmltopdf."
14
- end
15
- executable = File.join(File.dirname(__FILE__), binary)
16
-
8
+ executable = File.join(File.dirname(__FILE__), WkhtmlImageExecutable.new.binary_wkhtmltoimage)
17
9
  end
18
10
 
19
11
  arguments = $*.map { |arg| arg.include?(' ') ? %Q("#{arg}") : arg }
20
12
 
21
- system(executable + " " + arguments.join(" "))
13
+ system(executable + " " + arguments.join(" "))
@@ -29,7 +29,7 @@ describe WebSnap::Snapper do
29
29
 
30
30
  it "should provide default options" do
31
31
  websnap = WebSnap::Snapper.new('<h1>Oh Hai</h1>')
32
- ['--crop-w', '--crop-h', '--crop-x', '--crop-y', '--format'].each do |option|
32
+ ['--format'].each do |option|
33
33
  websnap.options.should have_key(option)
34
34
  end
35
35
  end
@@ -2,21 +2,21 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "websnap"
5
- s.version = "0.1.4"
5
+ s.version = "0.1.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Francis Chong"]
9
- s.date = "2011-11-24"
9
+ s.date = "2012-12-13"
10
10
  s.description = "Create snapshot of webpage"
11
11
  s.email = ""
12
- s.executables = ["wkhtmltoimage-linux-i386-0.10.0", "wkhtmltoimage-osx-i386-0.10.0", "wkhtmltoimage-proxy"]
13
- s.extra_rdoc_files = ["LICENSE", "README.md", "bin/wkhtmltoimage-linux-i386-0.10.0", "bin/wkhtmltoimage-osx-i386-0.10.0", "bin/wkhtmltoimage-proxy", "lib/websnap.rb", "lib/websnap/source.rb", "lib/websnap/websnap.rb"]
14
- s.files = ["LICENSE", "Manifest", "README.md", "Rakefile", "bin/wkhtmltoimage-linux-i386-0.10.0", "bin/wkhtmltoimage-osx-i386-0.10.0", "bin/wkhtmltoimage-proxy", "lib/websnap.rb", "lib/websnap/source.rb", "lib/websnap/websnap.rb", "spec/fixtures/google.html", "spec/source_spec.rb", "spec/spec_helper.rb", "spec/websnap_spec.rb", "websnap.gemspec"]
12
+ s.executables = ["wkhtml_image_executable.rb", "wkhtmltoimage-amd64", "wkhtmltoimage-linux-i386-0.10.0", "wkhtmltoimage-osx-i386-0.10.0", "wkhtmltoimage-proxy"]
13
+ s.extra_rdoc_files = ["LICENSE", "README.md", "bin/wkhtml_image_executable.rb", "bin/wkhtmltoimage-amd64", "bin/wkhtmltoimage-linux-i386-0.10.0", "bin/wkhtmltoimage-osx-i386-0.10.0", "bin/wkhtmltoimage-proxy", "lib/websnap.rb", "lib/websnap/source.rb", "lib/websnap/websnap.rb"]
14
+ s.files = ["LICENSE", "Manifest", "README.md", "Rakefile", "bin/wkhtml_image_executable.rb", "bin/wkhtmltoimage-amd64", "bin/wkhtmltoimage-linux-i386-0.10.0", "bin/wkhtmltoimage-osx-i386-0.10.0", "bin/wkhtmltoimage-proxy", "lib/websnap.rb", "lib/websnap/source.rb", "lib/websnap/websnap.rb", "spec/fixtures/google.html", "spec/source_spec.rb", "spec/spec_helper.rb", "spec/websnap_spec.rb", "websnap.gemspec"]
15
15
  s.homepage = "http://github.com/siuying/websnap"
16
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Websnap", "--main", "README.md"]
17
17
  s.require_paths = ["lib"]
18
18
  s.rubyforge_project = "websnap"
19
- s.rubygems_version = "1.8.10"
19
+ s.rubygems_version = "1.8.23"
20
20
  s.summary = "Create snapshot of webpage"
21
21
 
22
22
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-24 00:00:00.000000000 Z
12
+ date: 2012-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70282342064160 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70282342064160
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: echoe
27
- requirement: &70282342062620 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70282342062620
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: mocha
38
- requirement: &70282342083920 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,17 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70282342083920
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  description: Create snapshot of webpage
48
63
  email: ''
49
64
  executables:
65
+ - wkhtml_image_executable.rb
66
+ - wkhtmltoimage-amd64
50
67
  - wkhtmltoimage-linux-i386-0.10.0
51
68
  - wkhtmltoimage-osx-i386-0.10.0
52
69
  - wkhtmltoimage-proxy
@@ -54,6 +71,8 @@ extensions: []
54
71
  extra_rdoc_files:
55
72
  - LICENSE
56
73
  - README.md
74
+ - bin/wkhtml_image_executable.rb
75
+ - bin/wkhtmltoimage-amd64
57
76
  - bin/wkhtmltoimage-linux-i386-0.10.0
58
77
  - bin/wkhtmltoimage-osx-i386-0.10.0
59
78
  - bin/wkhtmltoimage-proxy
@@ -65,6 +84,8 @@ files:
65
84
  - Manifest
66
85
  - README.md
67
86
  - Rakefile
87
+ - bin/wkhtml_image_executable.rb
88
+ - bin/wkhtmltoimage-amd64
68
89
  - bin/wkhtmltoimage-linux-i386-0.10.0
69
90
  - bin/wkhtmltoimage-osx-i386-0.10.0
70
91
  - bin/wkhtmltoimage-proxy
@@ -102,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
123
  version: '1.2'
103
124
  requirements: []
104
125
  rubyforge_project: websnap
105
- rubygems_version: 1.8.10
126
+ rubygems_version: 1.8.23
106
127
  signing_key:
107
128
  specification_version: 3
108
129
  summary: Create snapshot of webpage