gns 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,5 +17,6 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
  gem.add_dependency 'foreverb'
20
+ gem.add_dependency 'httpclient'
20
21
  gem.add_dependency 'terminal-notifier'
21
22
  end
@@ -1,12 +1,13 @@
1
1
  require 'rss'
2
2
  require 'openssl'
3
- require 'open-uri'
3
+ require 'httpclient'
4
4
 
5
5
  module Gns
6
6
  class GithubAtom
7
7
  def initialize(url, start_time = Time.now)
8
8
  @url = url
9
9
  @last_updated = start_time
10
+ @client = HTTPClient.new
10
11
  end
11
12
 
12
13
  def recent_items
@@ -18,10 +19,14 @@ module Gns
18
19
  end
19
20
 
20
21
  def get_atom_items
21
- RSS::Parser.parse(open(@url, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE)).items.map {|item|
22
+ RSS::Parser.parse(get_atom).items.map {|item|
22
23
  GithubItem.new(item)
23
24
  }
24
25
  end
26
+
27
+ def get_atom
28
+ @client.get_content(@url)
29
+ end
25
30
  end
26
31
 
27
32
  class GithubItem
@@ -1,3 +1,3 @@
1
1
  module Gns
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-15 00:00:00.000000000 Z
12
+ date: 2012-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: foreverb
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: httpclient
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
30
46
  - !ruby/object:Gem::Dependency
31
47
  name: terminal-notifier
32
48
  requirement: !ruby/object:Gem::Requirement