websnap 0.1.1 → 0.1.2

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/Manifest CHANGED
@@ -3,6 +3,7 @@ Manifest
3
3
  README.md
4
4
  Rakefile
5
5
  bin/wkhtmltoimage-linux-i386-0.10.0
6
+ bin/wkhtmltoimage-osx-i386-0.10.0
6
7
  bin/wkhtmltoimage-proxy
7
8
  lib/websnap.rb
8
9
  lib/websnap/source.rb
data/README.md CHANGED
@@ -5,11 +5,13 @@ Create snapshot of webpage. Uses [wkhtmltoimage](http://github.com/antialize/wkh
5
5
  ## Installation
6
6
 
7
7
  1. Install wkhtmltoimage (optional)
8
- ** WebSnap comes bundled with wkhtmltoimage binaries for Linux i386 (OSX i386 will be bundled, when it is available from [wkhtmltopdf] site)
9
- ** WebSnap defaults to user installed versions of wkhtmltoimage if found
10
- ** Installing wkhtmltoimage binary
11
- *** Download the latest binary from http://code.google.com/p/wkhtmltopdf/downloads/list
12
- *** Place the binary somewhere on your path (e.g /usr/local/bin)
8
+
9
+ * WebSnap comes bundled with wkhtmltoimage binaries for Linux i386 (OSX i386 will be bundled, when it is available from [wkhtmltopdf] site)
10
+ * WebSnap defaults to user installed versions of wkhtmltoimage if found
11
+ * Installing wkhtmltoimage binary
12
+ * Download the latest binary from http://code.google.com/p/wkhtmltopdf/downloads/list
13
+ * Place the binary somewhere on your path (e.g /usr/local/bin)
14
+
13
15
  2. Install WebSnap
14
16
 
15
17
  $ gem install websnap
@@ -21,7 +23,7 @@ Create snapshot of webpage. Uses [wkhtmltoimage](http://github.com/antialize/wkh
21
23
  snap = WebSnap.new('http://google.com', :format => 'png')
22
24
 
23
25
  # Get the binary image data
24
- png = snap.bytes
26
+ png = snap.to_bytes
25
27
 
26
28
  # Save the PDF to a file
27
29
  file = snap.to_file('/path/to/save/png')
@@ -30,6 +32,11 @@ Create snapshot of webpage. Uses [wkhtmltoimage](http://github.com/antialize/wkh
30
32
  kit = WebSnap.new('http://google.com')
31
33
  kit = WebSnap.new(File.new('/path/to/html'))
32
34
 
35
+ ## Attributions
36
+
37
+ * This application use wkhtmltoimage as backend
38
+ * This gem is a clone of PDFKit, which use wkhtmltopdf to generate PDF
39
+
33
40
  ## Note on Patches/Pull Requests
34
41
 
35
42
  * Fork the project.
data/Rakefile CHANGED
@@ -2,9 +2,9 @@ require 'rubygems'
2
2
  require 'echoe'
3
3
 
4
4
  require 'rake'
5
- require 'spec/rake/spectask'
5
+ #require 'spec/rake/spectask'
6
6
 
7
- Echoe.new("websnap", "0.1.1") do |p|
7
+ Echoe.new("websnap", "0.1.2") 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"
@@ -1,3 +1,2 @@
1
- require 'rubygems'
1
+ require 'websnap/source'
2
2
  require 'websnap/websnap'
3
- require 'websnap/source'
@@ -21,8 +21,6 @@ class WebSnap
21
21
  @stylesheets = []
22
22
 
23
23
  default_options = {
24
- :'scale-h' => '90',
25
- :'scale-w' => '120',
26
24
  :'crop-h' => '768',
27
25
  :'crop-w' => '1024',
28
26
  :'crop-x' => '0',
@@ -2,28 +2,27 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{websnap}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
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 = %q{2010-06-27}
9
+ s.date = %q{2011-05-05}
10
10
  s.description = %q{Create snapshot of webpage}
11
11
  s.email = %q{}
12
- s.executables = ["wkhtmltoimage-linux-i386-0.10.0", "wkhtmltoimage-proxy"]
13
- s.extra_rdoc_files = ["LICENSE", "README.md", "bin/wkhtmltoimage-linux-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-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 = ["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"]
15
15
  s.homepage = %q{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 = %q{websnap}
19
- s.rubygems_version = %q{1.3.6}
19
+ s.rubygems_version = %q{1.6.2}
20
20
  s.summary = %q{Create snapshot of webpage}
21
21
 
22
22
  if s.respond_to? :specification_version then
23
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
24
23
  s.specification_version = 3
25
24
 
26
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
25
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
27
26
  s.add_development_dependency(%q<rspec>, [">= 0"])
28
27
  s.add_development_dependency(%q<echoe>, [">= 0"])
29
28
  s.add_development_dependency(%q<mocha>, [">= 0"])
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websnap
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 31
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 1
9
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Francis Chong
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-06-27 00:00:00 +08:00
18
+ date: 2011-05-05 00:00:00 +08:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: rspec
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 3
27
30
  segments:
28
31
  - 0
29
32
  version: "0"
@@ -33,9 +36,11 @@ dependencies:
33
36
  name: echoe
34
37
  prerelease: false
35
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
36
40
  requirements:
37
41
  - - ">="
38
42
  - !ruby/object:Gem::Version
43
+ hash: 3
39
44
  segments:
40
45
  - 0
41
46
  version: "0"
@@ -45,9 +50,11 @@ dependencies:
45
50
  name: mocha
46
51
  prerelease: false
47
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
48
54
  requirements:
49
55
  - - ">="
50
56
  - !ruby/object:Gem::Version
57
+ hash: 3
51
58
  segments:
52
59
  - 0
53
60
  version: "0"
@@ -57,6 +64,7 @@ description: Create snapshot of webpage
57
64
  email: ""
58
65
  executables:
59
66
  - wkhtmltoimage-linux-i386-0.10.0
67
+ - wkhtmltoimage-osx-i386-0.10.0
60
68
  - wkhtmltoimage-proxy
61
69
  extensions: []
62
70
 
@@ -64,6 +72,7 @@ extra_rdoc_files:
64
72
  - LICENSE
65
73
  - README.md
66
74
  - bin/wkhtmltoimage-linux-i386-0.10.0
75
+ - bin/wkhtmltoimage-osx-i386-0.10.0
67
76
  - bin/wkhtmltoimage-proxy
68
77
  - lib/websnap.rb
69
78
  - lib/websnap/source.rb
@@ -74,6 +83,7 @@ files:
74
83
  - README.md
75
84
  - Rakefile
76
85
  - bin/wkhtmltoimage-linux-i386-0.10.0
86
+ - bin/wkhtmltoimage-osx-i386-0.10.0
77
87
  - bin/wkhtmltoimage-proxy
78
88
  - lib/websnap.rb
79
89
  - lib/websnap/source.rb
@@ -98,16 +108,20 @@ rdoc_options:
98
108
  require_paths:
99
109
  - lib
100
110
  required_ruby_version: !ruby/object:Gem::Requirement
111
+ none: false
101
112
  requirements:
102
113
  - - ">="
103
114
  - !ruby/object:Gem::Version
115
+ hash: 3
104
116
  segments:
105
117
  - 0
106
118
  version: "0"
107
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
+ none: false
108
121
  requirements:
109
122
  - - ">="
110
123
  - !ruby/object:Gem::Version
124
+ hash: 11
111
125
  segments:
112
126
  - 1
113
127
  - 2
@@ -115,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
129
  requirements: []
116
130
 
117
131
  rubyforge_project: websnap
118
- rubygems_version: 1.3.6
132
+ rubygems_version: 1.6.2
119
133
  signing_key:
120
134
  specification_version: 3
121
135
  summary: Create snapshot of webpage