image-dumper 0.7.2 → 0.7.3
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.
- checksums.yaml +4 -4
- data/bin/dumper +1 -1
- data/lib/dumper/version.rb +1 -1
- data/spec/generic_spec.rb +28 -0
- data/spec/sankakucomplex_spec.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d66bc9aa5115f559df1c897bd99b31d30fb61b3e
|
4
|
+
data.tar.gz: 12de7bc0c5c732dcf112aa0135434c33417b081b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13c82e7304a2798b7e529728206955c22eb0084c0446bb92a6846d63c4281926fa860783d349291efa1b366dc5ea57567ad18645999a9d19baef24ca157515ed
|
7
|
+
data.tar.gz: 8072669a17108becb59941299061cf8e96ccd5ae8a211422db5bfd5b12f6b59e422b6a70f8a268dea7d77dacbb13eeb2182534cf4f2b26f54a5a5331318e880f
|
data/bin/dumper
CHANGED
@@ -111,7 +111,7 @@ options[:url].each_with_index { |url, i|
|
|
111
111
|
else Dumper::Profiles.send method, url, options[:path][i]
|
112
112
|
end
|
113
113
|
else
|
114
|
-
Dumper
|
114
|
+
Dumper.get_generic url, options[:path][i], options[:xpath]
|
115
115
|
end
|
116
116
|
rescue Nokogiri::XML::XPath::SyntaxError => e
|
117
117
|
puts e.to_s.gsub /expression/, 'xpath'
|
data/lib/dumper/version.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
require 'dumper'
|
3
|
+
require 'fastimage'
|
4
|
+
require 'fileutils'
|
5
|
+
|
6
|
+
describe 'Dumper' do
|
7
|
+
before do
|
8
|
+
@dir = 'tmp_generic'
|
9
|
+
Dir.mkdir @dir
|
10
|
+
end
|
11
|
+
|
12
|
+
after do
|
13
|
+
FileUtils.rm_r @dir
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'dumps a gallery using a custom xpath' do
|
17
|
+
url = 'http://task-force.lacumpa.biz/?p=2333'
|
18
|
+
Dumper.get_generic url, @dir, '//div[@class="entry-content"]/p/img/@src'
|
19
|
+
|
20
|
+
images = Dir["#{@dir}/*"]
|
21
|
+
expect(images.length).to be 1
|
22
|
+
|
23
|
+
image = FastImage.size images.first
|
24
|
+
expect(image).to be_kind_of(Array)
|
25
|
+
|
26
|
+
expect(image.last).to be 800
|
27
|
+
end
|
28
|
+
end
|
data/spec/sankakucomplex_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image-dumper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- spec/fakku_spec.rb
|
189
189
|
- spec/fc2_spec.rb
|
190
190
|
- spec/gelbooru_spec.rb
|
191
|
+
- spec/generic_spec.rb
|
191
192
|
- spec/imagebam_spec.rb
|
192
193
|
- spec/mangaeden_spec.rb
|
193
194
|
- spec/mangago_spec.rb
|
@@ -230,6 +231,7 @@ test_files:
|
|
230
231
|
- spec/fakku_spec.rb
|
231
232
|
- spec/fc2_spec.rb
|
232
233
|
- spec/gelbooru_spec.rb
|
234
|
+
- spec/generic_spec.rb
|
233
235
|
- spec/imagebam_spec.rb
|
234
236
|
- spec/mangaeden_spec.rb
|
235
237
|
- spec/mangago_spec.rb
|