image-dumper 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b407e2d5b0b28c20fa06b2d23dbee23779708433
4
- data.tar.gz: 45ecad3da5eb6b8242d7c9703ce1ca25fff0b73f
3
+ metadata.gz: d66bc9aa5115f559df1c897bd99b31d30fb61b3e
4
+ data.tar.gz: 12de7bc0c5c732dcf112aa0135434c33417b081b
5
5
  SHA512:
6
- metadata.gz: e9cf2ed50d3b15189aedec9116fdd644e9bfbfd465a127ede7dac0ca46614ce01f9ca29a9478415bbce9bfaebf51f5503a0cee956fbf6be875ba480b364e6935
7
- data.tar.gz: 45381a1bcff4732482918aa012e30ed3cc76a75a080e90bd0247a23086bcdf21dc6a5fcc13e2e866cbfa61d7052916d845f6498c0c2841c7369ab3faa62c8997
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::Profiles.get_generic url, options[:path][i], options[:xpath]
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'
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Dumper
21
21
  def self.version
22
- '0.7.2'
22
+ '0.7.3'
23
23
  end
24
24
  end
@@ -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
@@ -31,7 +31,7 @@ describe 'Dumper' do
31
31
  Dumper::Profiles.get_sankakucomplex url, @dir
32
32
 
33
33
  images = Dir["#{@dir}/*"]
34
- expect(images.length).to be 20
34
+ expect(images.length).to be >= 20
35
35
 
36
36
  image = FastImage.size images.last
37
37
  expect(image).to be_kind_of(Array)
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.2
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-01 00:00:00.000000000 Z
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