ascraper 0.0.4 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/scraper/comics.rb +5 -0
- data/lib/scraper/version.rb +1 -1
- data/spec/comics_spec.rb +5 -0
- metadata +23 -37
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f5296c0af45d6045993b3ce40db70deda19123ad
|
4
|
+
data.tar.gz: 6829147dbd2daec963fba715b6e1120ad8ea381b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 07895e85741ce16a4602835a6eab6436431367b02b5064b3fa9d52a28930433db41f375f057af2a8cd0ae8b74341f379173b60208d952df2060182ea6265f618
|
7
|
+
data.tar.gz: b7280611a700294a19d30a17e934d622c443008e2fcbfb2f329ebf012b56fa20bc5ab0ac1d2c8e4a1946d9c4c0fe0ce9a9e740e272bb31869fa092412750c273
|
data/lib/scraper/comics.rb
CHANGED
@@ -20,6 +20,7 @@ module Scraper
|
|
20
20
|
result.other_images = other_images(comic)
|
21
21
|
result.download_link = download_link(comic)
|
22
22
|
result.tags = tags(comic)
|
23
|
+
result.description = description(comic)
|
23
24
|
|
24
25
|
results << result
|
25
26
|
end
|
@@ -28,6 +29,10 @@ module Scraper
|
|
28
29
|
results
|
29
30
|
end
|
30
31
|
|
32
|
+
def self.description(comic)
|
33
|
+
comic.at_css('.story_c').content.gsub(/\s+/, " ").strip
|
34
|
+
end
|
35
|
+
|
31
36
|
def self.main_image(comic)
|
32
37
|
comic.at_css('.story_c').search('img').map {|a| a['src']}.first
|
33
38
|
end
|
data/lib/scraper/version.rb
CHANGED
data/spec/comics_spec.rb
CHANGED
@@ -32,6 +32,11 @@ describe Scraper::Comics do
|
|
32
32
|
expect(@comic.main_image).not_to be_empty
|
33
33
|
end
|
34
34
|
|
35
|
+
it "should return a description" do
|
36
|
+
puts @comic.description
|
37
|
+
expect(@comic.description).not_to be_empty
|
38
|
+
end
|
39
|
+
|
35
40
|
it "should always return a download_link" do
|
36
41
|
puts @comic.download_link
|
37
42
|
expect(@comic.download_link).not_to be_empty
|
metadata
CHANGED
@@ -1,110 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ascraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.7
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ahmet
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.6'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '1.6'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: guard
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: guard-rspec
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: nokogiri
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
description: A Scraper.
|
@@ -114,10 +101,10 @@ executables: []
|
|
114
101
|
extensions: []
|
115
102
|
extra_rdoc_files: []
|
116
103
|
files:
|
117
|
-
- .gitignore
|
118
|
-
- .rspec
|
119
|
-
- .ruby-gemset
|
120
|
-
- .ruby-version
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".ruby-gemset"
|
107
|
+
- ".ruby-version"
|
121
108
|
- Gemfile
|
122
109
|
- Guardfile
|
123
110
|
- LICENSE.txt
|
@@ -134,27 +121,26 @@ files:
|
|
134
121
|
homepage: ''
|
135
122
|
licenses:
|
136
123
|
- MIT
|
124
|
+
metadata: {}
|
137
125
|
post_install_message:
|
138
126
|
rdoc_options: []
|
139
127
|
require_paths:
|
140
128
|
- lib
|
141
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
142
|
-
none: false
|
143
130
|
requirements:
|
144
|
-
- -
|
131
|
+
- - ">="
|
145
132
|
- !ruby/object:Gem::Version
|
146
133
|
version: '0'
|
147
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
|
-
none: false
|
149
135
|
requirements:
|
150
|
-
- -
|
136
|
+
- - ">="
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '0'
|
153
139
|
requirements: []
|
154
140
|
rubyforge_project:
|
155
|
-
rubygems_version:
|
141
|
+
rubygems_version: 2.2.2
|
156
142
|
signing_key:
|
157
|
-
specification_version:
|
143
|
+
specification_version: 4
|
158
144
|
summary: A Scraper.
|
159
145
|
test_files:
|
160
146
|
- spec/comics_spec.rb
|