image-dumper 0.7.4 → 0.7.5

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: d0e4fff957b63d713ee158eb5c504fa903cdd577
4
- data.tar.gz: b7a9edfe7d007c3e60f07edc2282aa3addf85698
3
+ metadata.gz: e8dbee0af9972d03975b2a6fd659565f68693b88
4
+ data.tar.gz: 2ad6e5c0a864e99ea6bc8662a6236dea62fc44f5
5
5
  SHA512:
6
- metadata.gz: add2a19b0900a45f670414e85a224b92813e807aa3e728eeb6994ecfb1640734fb5218925fd7709ab26c8f1fb72f3dd220279d9608858b903344e04238ee68fc
7
- data.tar.gz: 20439b3a99f11fc52d8bfc5b62f37e0d812c16f3326101af19fa38d0ba18d39585c630c44ebc18f5bac9911442969c0ce7d9f93a8f40b2d6bc6d109cb542afea
6
+ metadata.gz: 7797954b7e441e5d017e3883d6bdbc4dffc73c9132207f2576c0ca08704918c2fa82365ef8bec92a1d861719731769997615fb70244235ece7713764d0e613f5
7
+ data.tar.gz: 9025ef1bb8a131d2e875424b290f184436553ab0bd00eaea73e928bc670fe6dc6ceba6af6e62eebfe76d4cb791d9e110061ed1ea97c1bf0a879997a931094e5c
data/bin/dumper CHANGED
File without changes
data/lib/dumper.rb CHANGED
@@ -37,6 +37,8 @@ require 'dumper/profiles'
37
37
  require 'dumper/dumper'
38
38
  require 'dumper/version'
39
39
 
40
+ OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
41
+
40
42
  Dir.glob(File.expand_path("../dumper/profiles/*.rb", __FILE__)).each { |f|
41
43
  require "dumper/profiles/#{File.basename(f).split(?.)[0]}"
42
44
  }
data/lib/dumper/logger.rb CHANGED
@@ -1,61 +1,61 @@
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
- class Logger
22
-
23
- class << self
24
- def redirect_on(where, file)
25
- @@where = where
26
- @@file = !file || file.empty? ? 'dumper.log' : file
27
- end
28
-
29
- def log_on_file(file, data)
30
- File.open(file, ?a) { |file|
31
- data.each { |status, message|
32
- file.puts status == :critical_error_dump ? message.inspect : message
33
- }
34
- }
35
- end
36
-
37
- def log_on_screen(data)
38
- data.each { |status, message|
39
- if status == :critical_error_dump
40
- p message
41
- else
42
- puts message
43
- end
44
- }
45
- end
46
- end
47
-
48
- def initialize
49
- @@where = :screen
50
- end
51
-
52
- def update(data)
53
- if @@where == :file
54
- Logger.log_on_file @@file, data
55
- else
56
- Logger.log_on_screen(data) if Dumper.verbose?
57
- end
58
- end
59
-
60
- end
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
+ class Logger
22
+
23
+ class << self
24
+ def redirect_on(where, file)
25
+ @@where = where
26
+ @@file = !file || file.empty? ? 'dumper.log' : file
27
+ end
28
+
29
+ def log_on_file(file, data)
30
+ File.open(file, ?a) { |file|
31
+ data.each { |status, message|
32
+ file.puts status == :critical_error_dump ? message.inspect : message
33
+ }
34
+ }
35
+ end
36
+
37
+ def log_on_screen(data)
38
+ data.each { |status, message|
39
+ if status == :critical_error_dump
40
+ p message
41
+ else
42
+ puts message
43
+ end
44
+ }
45
+ end
46
+ end
47
+
48
+ def initialize
49
+ @@where = :screen
50
+ end
51
+
52
+ def update(data)
53
+ if @@where == :file
54
+ Logger.log_on_file @@file, data
55
+ else
56
+ Logger.log_on_screen(data) if Dumper.verbose?
57
+ end
58
+ end
59
+
60
+ end
61
61
  end
@@ -1,45 +1,45 @@
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
- class Profile
22
- include Dumper
23
- include Alakazam
24
-
25
- def initialize(&block)
26
- add_observer Dumper::Logger.new
27
-
28
- min = pool_size[:min]
29
- max = pool_size[:max]
30
-
31
- @pool = Thread.pool min, max
32
- notify_observers error: "Using #{min}:#{max || min} threads..."
33
-
34
- instance_eval &block
35
- end
36
-
37
- def dump(url, path, *args)
38
- raise NotImplementedError
39
- end
40
-
41
- def shutdown
42
- @pool.shutdown
43
- end
44
- end
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
+ class Profile
22
+ include Dumper
23
+ include Alakazam
24
+
25
+ def initialize(&block)
26
+ add_observer Dumper::Logger.new
27
+
28
+ min = pool_size[:min]
29
+ max = pool_size[:max]
30
+
31
+ @pool = Thread.pool min, max
32
+ notify_observers error: "Using #{min}:#{max || min} threads..."
33
+
34
+ instance_eval &block
35
+ end
36
+
37
+ def dump(url, path, *args)
38
+ raise NotImplementedError
39
+ end
40
+
41
+ def shutdown
42
+ @pool.shutdown
43
+ end
44
+ end
45
45
  end
@@ -1,24 +1,24 @@
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
- Profile = Dumper::Profile
23
- end
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
+ Profile = Dumper::Profile
23
+ end
24
24
  end
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Dumper
21
21
  def self.version
22
- '0.7.4'
22
+ '0.7.5'
23
23
  end
24
- end
24
+ end
data/spec/generic_spec.rb CHANGED
@@ -1,28 +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
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
28
  end
data/spec/mangago_spec.rb CHANGED
@@ -18,10 +18,10 @@ describe 'Dumper' do
18
18
  Dumper::Profiles.get_mangago url, @dir
19
19
 
20
20
  images = Dir["#{@dir}/*"]
21
- expect(images.length).to be 21
21
+ expect(images.length).to be >= 20
22
22
 
23
23
  image = FastImage.size images.last
24
- expect(image).to be_kind_of(Array)
24
+ expect(image).to be_kind_of(Array)
25
25
 
26
26
  expect(image.last).to be 1300
27
27
  end
metadata CHANGED
@@ -1,153 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image-dumper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
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-03-11 00:00:00.000000000 Z
11
+ date: 2014-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: certified
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: addressable
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thread
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: alakazam
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rake
98
+ name: parallel_tests
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
- type: :development
104
+ type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rspec
112
+ name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: fastimage
126
+ name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: parallel_tests
140
+ name: fastimage
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  description: A dumper to download whole galleries from board like 4chan, imagebam,
@@ -158,9 +158,12 @@ executables:
158
158
  extensions: []
159
159
  extra_rdoc_files: []
160
160
  files:
161
+ - bin/dumper
162
+ - lib/dumper.rb
161
163
  - lib/dumper/dumper.rb
162
164
  - lib/dumper/logger.rb
163
165
  - lib/dumper/profile.rb
166
+ - lib/dumper/profiles.rb
164
167
  - lib/dumper/profiles/4chan.rb
165
168
  - lib/dumper/profiles/behoimi.rb
166
169
  - lib/dumper/profiles/booru.rb
@@ -177,10 +180,8 @@ files:
177
180
  - lib/dumper/profiles/sankakucomplex.rb
178
181
  - lib/dumper/profiles/teca.rb
179
182
  - lib/dumper/profiles/yande.rb
180
- - lib/dumper/profiles.rb
181
183
  - lib/dumper/utils.rb
182
184
  - lib/dumper/version.rb
183
- - lib/dumper.rb
184
185
  - spec/4chan_spec.rb
185
186
  - spec/behoimi_spec.rb
186
187
  - spec/booru_spec.rb
@@ -198,7 +199,6 @@ files:
198
199
  - spec/sankakucomplex_spec.rb
199
200
  - spec/teca_spec.rb
200
201
  - spec/yande_spec.rb
201
- - bin/dumper
202
202
  homepage: https://github.com/RoxasShadow
203
203
  licenses:
204
204
  - GPL-3
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  version: '0'
220
220
  requirements: []
221
221
  rubyforge_project:
222
- rubygems_version: 2.0.3
222
+ rubygems_version: 2.2.2
223
223
  signing_key:
224
224
  specification_version: 4
225
225
  summary: Fetch and download image gallery.