ruby-hackernews 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ require 'rake/testtask'
9
9
 
10
10
  spec = Gem::Specification.new do |s|
11
11
  s.name = 'ruby-hackernews'
12
- s.version = '1.0.1'
12
+ s.version = '1.1.0'
13
13
  s.add_dependency('require_all', '>= 1.1.0')
14
14
  s.add_dependency('mechanize', '>= 1.0.0')
15
15
  s.has_rdoc = false
@@ -5,8 +5,4 @@ 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')
9
-
10
- Entry.all.first.comments.each do |comment|
11
- p comment.text
12
- end
8
+ require_all File.join(File.dirname(__FILE__), 'ruby-hackernews', 'services')
@@ -9,4 +9,8 @@ class CommentsInfo
9
9
  @page = page
10
10
  end
11
11
 
12
+ def id
13
+ return page[/\d+/]
14
+ end
15
+
12
16
  end
@@ -42,6 +42,14 @@ class Entry
42
42
  return @time.time
43
43
  end
44
44
 
45
+ def id
46
+ return @comments_info.id
47
+ end
48
+
49
+ def comments_count
50
+ return @comments_info.count
51
+ end
52
+
45
53
  def write_comment(text)
46
54
  return CommentService.new.write_comment(@comments_info.page, text)
47
55
  end
metadata CHANGED
@@ -1,13 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-hackernews
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 0
9
- - 1
10
- version: 1.0.1
4
+ version: 1.1.0
11
5
  platform: ruby
12
6
  authors:
13
7
  - Andrea Dallera
@@ -15,41 +9,29 @@ autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
11
 
18
- date: 2010-09-10 00:00:00 +02:00
12
+ date: 2010-10-18 00:00:00 +02:00
19
13
  default_executable:
20
14
  dependencies:
21
15
  - !ruby/object:Gem::Dependency
22
16
  name: require_all
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
26
20
  requirements:
27
21
  - - ">="
28
22
  - !ruby/object:Gem::Version
29
- hash: 19
30
- segments:
31
- - 1
32
- - 1
33
- - 0
34
23
  version: 1.1.0
35
- type: :runtime
36
- version_requirements: *id001
24
+ version:
37
25
  - !ruby/object:Gem::Dependency
38
26
  name: mechanize
39
- prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
42
30
  requirements:
43
31
  - - ">="
44
32
  - !ruby/object:Gem::Version
45
- hash: 23
46
- segments:
47
- - 1
48
- - 0
49
- - 0
50
33
  version: 1.0.0
51
- type: :runtime
52
- version_requirements: *id002
34
+ version:
53
35
  description: An interface to Hacker News
54
36
  email: andrea@andreadallera.com
55
37
  executables: []
@@ -61,29 +43,29 @@ extra_rdoc_files: []
61
43
  files:
62
44
  - README.rdoc
63
45
  - Rakefile
46
+ - lib/ruby-hackernews.rb
64
47
  - lib/ruby-hackernews/domain/comment/comment.rb
65
- - lib/ruby-hackernews/domain/user.rb
48
+ - lib/ruby-hackernews/domain/entry/entry.rb
49
+ - lib/ruby-hackernews/domain/entry/comments_info.rb
66
50
  - lib/ruby-hackernews/domain/entry/link_info.rb
67
- - lib/ruby-hackernews/domain/entry/voting_info.rb
68
51
  - lib/ruby-hackernews/domain/entry/time_info.rb
52
+ - lib/ruby-hackernews/domain/entry/voting_info.rb
69
53
  - lib/ruby-hackernews/domain/entry/user_info.rb
70
- - lib/ruby-hackernews/domain/entry/entry.rb
71
- - lib/ruby-hackernews/domain/entry/comments_info.rb
54
+ - lib/ruby-hackernews/domain/user.rb
55
+ - lib/ruby-hackernews/services/mechanize_context.rb
56
+ - lib/ruby-hackernews/services/voting_service.rb
57
+ - lib/ruby-hackernews/services/comment_service.rb
58
+ - lib/ruby-hackernews/services/entry_service.rb
59
+ - lib/ruby-hackernews/services/configuration_service.rb
60
+ - lib/ruby-hackernews/services/parsers/entry_page_parser.rb
72
61
  - lib/ruby-hackernews/services/parsers/link_info_parser.rb
73
62
  - lib/ruby-hackernews/services/parsers/entry_parser.rb
74
- - lib/ruby-hackernews/services/parsers/voting_info_parser.rb
75
63
  - lib/ruby-hackernews/services/parsers/user_info_parser.rb
76
- - lib/ruby-hackernews/services/parsers/time_info_parser.rb
77
- - lib/ruby-hackernews/services/parsers/entry_page_parser.rb
64
+ - lib/ruby-hackernews/services/parsers/voting_info_parser.rb
78
65
  - lib/ruby-hackernews/services/parsers/comments_info_parser.rb
79
- - lib/ruby-hackernews/services/voting_service.rb
80
- - lib/ruby-hackernews/services/mechanize_context.rb
81
- - lib/ruby-hackernews/services/comment_service.rb
66
+ - lib/ruby-hackernews/services/parsers/time_info_parser.rb
82
67
  - lib/ruby-hackernews/services/login_service.rb
83
- - lib/ruby-hackernews/services/entry_service.rb
84
68
  - lib/ruby-hackernews/services/not_authenticated_error.rb
85
- - lib/ruby-hackernews/services/configuration_service.rb
86
- - lib/ruby-hackernews.rb
87
69
  has_rdoc: true
88
70
  homepage: http://github.com/bolthar/ruby-hackernews
89
71
  licenses: []
@@ -94,27 +76,21 @@ rdoc_options: []
94
76
  require_paths:
95
77
  - lib
96
78
  required_ruby_version: !ruby/object:Gem::Requirement
97
- none: false
98
79
  requirements:
99
80
  - - ">="
100
81
  - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
103
- - 0
104
82
  version: "0"
83
+ version:
105
84
  required_rubygems_version: !ruby/object:Gem::Requirement
106
- none: false
107
85
  requirements:
108
86
  - - ">="
109
87
  - !ruby/object:Gem::Version
110
- hash: 3
111
- segments:
112
- - 0
113
88
  version: "0"
89
+ version:
114
90
  requirements: []
115
91
 
116
92
  rubyforge_project:
117
- rubygems_version: 1.3.7
93
+ rubygems_version: 1.3.5
118
94
  signing_key:
119
95
  specification_version: 3
120
96
  summary: An interface to Hacker News