image-dumper 0.7.7 → 0.7.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 142125bfd86802635caf3776cfd19bc7feae04fb
4
- data.tar.gz: 280d4de2b98d1794ac97cfaf6e38537c06e86d2d
3
+ metadata.gz: d2ace5b6364dd143c145f8e8c040daaa2891e431
4
+ data.tar.gz: db1b3cb9161a80ceaaca7a560f17eff74b8b8fd4
5
5
  SHA512:
6
- metadata.gz: 6f8e8b131e24836e9e34a6699b401f4ce38a0ee3a664c64cfd943455292af7bf170b6f0fbba23c32a2a07da61ce1e946fb28ba41fe8f0c4b7ae48e2aea691ff8
7
- data.tar.gz: 030273ac86759b0b3affff3cd0d2eed119e0a24c6ed6809610feb65995b558a5ed2763cde53bb0abdf9e2f187d8708cbe65e49e5d0b290946417fc6544aa1852
6
+ metadata.gz: 01e5d0b4c1249ddaaae309747928d08b6b3af951a95e6a419a32056010f608a2c3cf8327d62c0c4b9e6e54a8a949a900d9bb992c8d2c1251aee63b54dd7bde81
7
+ data.tar.gz: 4ca442105386b638942697e516751a6444897f0b6325f2e47195ca10669fba46cd3f16236759ddc1c2a35be5ce562cb990c9cc51d281d2eba4e72a84ebdc6d18
data/bin/dumper CHANGED
@@ -57,7 +57,7 @@ OptionParser.new do |o|
57
57
  end
58
58
 
59
59
  o.on '-p', '--path PATH', 'Target folder' do |path|
60
- options[:path] << path
60
+ options[:path] << File.expand_path(path)
61
61
  end
62
62
 
63
63
  o.on '-x', '--xpath XPATH', 'Use a custom xpath' do |xpath|
@@ -121,4 +121,4 @@ options[:url].each_with_index { |url, i|
121
121
  rescue URI::InvalidURIError => e
122
122
  puts "URL #{url} is not valid: #{e}"
123
123
  end
124
- }
124
+ }
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Dumper
21
21
  def self.version
22
- '0.7.7'
22
+ '0.7.8'
23
23
  end
24
24
  end
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.7
4
+ version: 0.7.8
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-11-20 00:00:00.000000000 Z
11
+ date: 2015-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -190,7 +190,6 @@ files:
190
190
  - lib/dumper/profiles/mangago.rb
191
191
  - lib/dumper/profiles/mangahere.rb
192
192
  - lib/dumper/profiles/multiplayer.rb
193
- - lib/dumper/profiles/redblow.rb
194
193
  - lib/dumper/profiles/sankakucomplex.rb
195
194
  - lib/dumper/profiles/teca.rb
196
195
  - lib/dumper/profiles/yande.rb
@@ -1,50 +0,0 @@
1
- #--
2
- # Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
3
- #
4
- # This file is part of Dumper.
5
- #
6
- # Dumper is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # Dumper is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with Dumper. If not, see <http://www.gnu.org/licenses/>.
18
- #++
19
-
20
- module Dumper
21
- module Profiles
22
-
23
- class RedBlow < Profile
24
- def dump(url, path, from, to)
25
- from -= 1
26
- to -= 1 if to >= 1
27
-
28
- Nokogiri::HTML(open(url)).xpath('//img[@class="attachment-medium"]/@src')[from..to].each { |p|
29
- @pool.process {
30
- Dumper.get path, p, { referer: url }
31
- }
32
- }
33
- end
34
- end
35
-
36
- class << self
37
- def get_redblow(url, path, from = 1, to = -1)
38
- RedBlow.new { |p|
39
- p.dump url, path, from, to
40
- p.shutdown
41
- }
42
- end
43
-
44
- def info_redblow
45
- { from: :enabled, to: :enabled, type: :images }
46
- end
47
- end
48
-
49
- end
50
- end