ruby-hackernews 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/lib/ruby-hackernews/domain/entry/comments_info.rb +2 -2
- data/lib/ruby-hackernews/domain/entry/entry.rb +2 -2
- data/lib/ruby-hackernews/services/parsers/comments_info_parser.rb +2 -2
- data/lib/ruby-hackernews/services/parsers/entry_parser.rb +1 -1
- data/lib/ruby-hackernews.rb +7 -1
- metadata +8 -3
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ require 'rake/testtask'
|
|
8
8
|
|
9
9
|
spec = Gem::Specification.new do |s|
|
10
10
|
s.name = 'ruby-hackernews'
|
11
|
-
s.version = '1.1.
|
11
|
+
s.version = '1.1.2'
|
12
12
|
s.add_dependency('require_all', '>= 1.1.0')
|
13
13
|
s.add_dependency('mechanize', '>= 1.0.0')
|
14
14
|
s.has_rdoc = false
|
@@ -25,4 +25,4 @@ Rake::GemPackageTask.new(spec) do |p|
|
|
25
25
|
p.gem_spec = spec
|
26
26
|
p.need_tar = true
|
27
27
|
p.need_zip = true
|
28
|
-
end
|
28
|
+
end
|
@@ -6,11 +6,11 @@ class CommentsInfoParser
|
|
6
6
|
|
7
7
|
def parse
|
8
8
|
comments_info = nil
|
9
|
-
if @element
|
9
|
+
if @element && @element['href'] =~ /id/
|
10
10
|
comments = @element.inner_html.split[0].to_i
|
11
11
|
comments_page = @element['href']
|
12
12
|
comments_info = CommentsInfo.new(comments, comments_page)
|
13
13
|
end
|
14
14
|
return comments_info
|
15
15
|
end
|
16
|
-
end
|
16
|
+
end
|
data/lib/ruby-hackernews.rb
CHANGED
@@ -5,4 +5,10 @@ require 'mechanize'
|
|
5
5
|
require 'require_all'
|
6
6
|
|
7
7
|
require_all File.join(File.dirname(__FILE__), 'ruby-hackernews', 'domain')
|
8
|
-
require_all File.join(File.dirname(__FILE__), 'ruby-hackernews', 'services')
|
8
|
+
require_all File.join(File.dirname(__FILE__), 'ruby-hackernews', 'services')
|
9
|
+
|
10
|
+
entries = Entry.all(2)
|
11
|
+
|
12
|
+
entries.each do |entry|
|
13
|
+
p entry.id, entries.index(entry)
|
14
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-hackernews
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Andrea Dallera
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-
|
18
|
+
date: 2011-09-09 00:00:00 +02:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
@@ -25,6 +26,7 @@ dependencies:
|
|
25
26
|
requirements:
|
26
27
|
- - ">="
|
27
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 19
|
28
30
|
segments:
|
29
31
|
- 1
|
30
32
|
- 1
|
@@ -40,6 +42,7 @@ dependencies:
|
|
40
42
|
requirements:
|
41
43
|
- - ">="
|
42
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 23
|
43
46
|
segments:
|
44
47
|
- 1
|
45
48
|
- 0
|
@@ -95,6 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
98
|
requirements:
|
96
99
|
- - ">="
|
97
100
|
- !ruby/object:Gem::Version
|
101
|
+
hash: 3
|
98
102
|
segments:
|
99
103
|
- 0
|
100
104
|
version: "0"
|
@@ -103,6 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
107
|
requirements:
|
104
108
|
- - ">="
|
105
109
|
- !ruby/object:Gem::Version
|
110
|
+
hash: 3
|
106
111
|
segments:
|
107
112
|
- 0
|
108
113
|
version: "0"
|