ero_getter 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,5 +1,50 @@
1
1
  = ero_getter
2
2
 
3
+ ero_getter is downloader for ero gazou.
4
+
5
+ == usage
6
+ EroGetter.download(url)
7
+
8
+ automaticaly download in $HOME/ero_getter/#{site}/#{sub_directory}/
9
+
10
+ == support other sites
11
+
12
+ add lib/downloader/#{site_name}.rb
13
+
14
+ class #{SiteName} < EroGetter::Base
15
+ name 'Site Name'
16
+ url %r{http://example.com/archives/(\d+).html}
17
+ target "a > img" do |path| # use css selector
18
+ path.parent[:href] =~ /jpe?g|gif|png/ # filter like Array.select
19
+ end
20
+ sub_directory do
21
+ url.match(/(\d+)\.html/)[1]
22
+ end
23
+ filename {|attr| "%04d%s" % [attr[:index], attr[:ext]] } # if you want sequencial filename
24
+ end
25
+
26
+ make directory spec/samples/#{site_name}
27
+ and download sample of html source in spec/sample/#{site_name}/sample.html
28
+
29
+ add spec/downloader#{site_name}_spec.rb
30
+
31
+ require 'spec_helper'
32
+ describe #{SiteName} do
33
+ subject { @dl }
34
+ let(:url) { 'http://example.com/archives/01010101.html' }
35
+ before do
36
+ EroGetter.stub(:mkdir)
37
+ @dl = #{SiteName}.new(url)
38
+ fake(:get, url, '#{site_name}/sample.html')
39
+ end
40
+ its(:sub_directory) { should == '01010101' }
41
+ its("targets.count") { should == #{numbers of image} }
42
+ end
43
+
44
+ then pull request!
45
+
46
+ == see also
47
+ http://github.com/masarakki/ero_getter_server
3
48
 
4
49
  == Contributing to ero_getter
5
50
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
data/ero_getter.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ero_getter"
8
- s.version = "1.3.0"
8
+ s.version = "1.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["masarakki"]
@@ -154,7 +154,7 @@ class EroGetter::Base
154
154
 
155
155
  def filename(basename, index)
156
156
  if respond_to?(:_filename)
157
- _filename(index: index, basename: basename, ext: File.extname(basename))
157
+ _filename(:index => index, :basename => basename, :ext => File.extname(basename))
158
158
  else
159
159
  basename
160
160
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ero_getter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -211,7 +211,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
211
211
  version: '0'
212
212
  segments:
213
213
  - 0
214
- hash: 1186439750826119491
214
+ hash: 2588041468797638508
215
215
  required_rubygems_version: !ruby/object:Gem::Requirement
216
216
  none: false
217
217
  requirements: