osub 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+ Version 2, December 2004
3
+
4
+ Copyright (C) 2011 Dave Wilkinson (Hackers of the Severed Hand) <wilkie+hotsh@xomb.org>
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified
7
+ copies of this license document, and changing it is allowed as long
8
+ as the name is changed.
9
+
10
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+
13
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
14
+
@@ -1,6 +1,7 @@
1
1
  require 'net/http'
2
2
  require 'uri'
3
3
 
4
+ require 'ostatus'
4
5
  require 'hmac-sha1'
5
6
 
6
7
  module OSub
@@ -18,8 +19,13 @@ module OSub
18
19
  @topic_url = topic_url
19
20
  end
20
21
 
22
+ # Actively searches for hubs by talking to publisher directly
23
+ def hubs
24
+ OStatus::Feed.from_url(topic_url).hubs
25
+ end
26
+
21
27
  # Subscribe to the topic through the given hub.
22
- def subscribe(hub_url = @topic_url, token = nil)
28
+ def subscribe(hub_url, token = nil)
23
29
  if token != nil
24
30
  @tokens << token.to_s
25
31
  end
@@ -27,7 +33,7 @@ module OSub
27
33
  end
28
34
 
29
35
  # Unsubscribe to the topic through the given hub.
30
- def unsubscribe(hub_url = @topic_url, token = nil)
36
+ def unsubscribe(hub_url, token = nil)
31
37
  if token != nil
32
38
  @tokens << token.to_s
33
39
  end
data/lib/osub/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module OSub
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/osub.rb CHANGED
@@ -1,3 +1,2 @@
1
- require_relative 'osub/subscriber'
2
1
  require_relative 'osub/subscription'
3
-
2
+ require_relative 'osub/subscribers'
data/osub.gemspec CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.rubyforge_project = "osub"
16
16
 
17
17
  s.add_dependency "ruby-hmac"
18
+ s.add_dependency "ostatus"
18
19
 
19
20
  s.files = `git ls-files`.split("\n")
20
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Hackers of the Severed Hand
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-14 00:00:00 -04:00
17
+ date: 2011-03-15 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -30,6 +30,19 @@ dependencies:
30
30
  version: "0"
31
31
  type: :runtime
32
32
  version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: ostatus
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ version: "0"
44
+ type: :runtime
45
+ version_requirements: *id002
33
46
  description: This is a simple implementation of a subscriber in the PubSubHubbub protocol.
34
47
  email:
35
48
  - hotsh@xomb.org
@@ -42,10 +55,11 @@ extra_rdoc_files: []
42
55
  files:
43
56
  - .gitignore
44
57
  - Gemfile
58
+ - LICENSE
45
59
  - Rakefile
46
60
  - lib/osub.rb
47
- - lib/osub/subscriber.rb
48
61
  - lib/osub/subscribers.rb
62
+ - lib/osub/subscription.rb
49
63
  - lib/osub/version.rb
50
64
  - osub.gemspec
51
65
  has_rdoc: true