radiodns 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- radiodns (0.0.2)
4
+ radiodns (0.1.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Summary
4
4
 
5
- This Ruby Gem provides utilities for working with the RadioDNS spec.
5
+ This Ruby Gem provides utilities for working with RadioDNS. It supports service CNAME resolution from bearer parameters and application discovery, corresponding to [v0.6.1 of the RadioDNS spec](http://radiodns.org/wp-content/uploads/2009/03/rdns011.pdf).
6
6
 
7
7
  ## Installation
8
8
 
@@ -38,20 +38,22 @@ Once you have a service you can perform application discovery
38
38
 
39
39
  radiovis_application = service.radiovis
40
40
 
41
- radiovis_application.host #=> "_radiovis._tcp.rdns.musicradio.com"
41
+ radiovis_application.host #=> "rdns.musicradio.com"
42
42
  radiovis_application.port #=> 61613
43
+ radiovis_application.type #=> :radiovis
43
44
 
44
45
  Or to get an array of supported applications
45
46
 
46
47
  service.applications
47
48
 
48
- Returns an array of Applications
49
+ which returns
49
50
 
50
- [#<RadioDNS::Application @host="_radioepg._tcp.rdns.musicradio.com", @port=61613>,
51
- #<RadioDNS::Application @host="_radiovis._tcp.rdns.musicradio.com", @port=61613>]
51
+ [#<RadioDNS::Application @host="rdns.musicradio.com", @port=61613, @type=:radioepg>,
52
+ #<RadioDNS::Application @host="rdns.musicradio.com", @port=61613, @type=:radiovis>]
52
53
 
53
54
  In the future these may become instances of specific classes that
54
- implement the application-specific behaviour.
55
+ implement application-specific behaviour, but I might make those
56
+ separate gems.
55
57
 
56
58
  ## TODO
57
59
 
@@ -36,7 +36,7 @@ module RadioDNS
36
36
  begin
37
37
  resource = resolver.getresource(host,
38
38
  Resolv::DNS::Resource::IN::SRV)
39
- Application.new :host => host, :port => resource.port
39
+ Application.new :host => cname, :port => resource.port, :type => service
40
40
  rescue Resolv::ResolvError
41
41
  nil
42
42
  end
@@ -44,10 +44,11 @@ module RadioDNS
44
44
  end
45
45
 
46
46
  class Application
47
- attr_accessor :host, :port
47
+ attr_accessor :host, :port, :type
48
48
  def initialize(params)
49
49
  @host = params[:host]
50
50
  @port = params[:port]
51
+ @type = params[:type]
51
52
  end
52
53
  end
53
54
 
@@ -1,3 +1,3 @@
1
1
  module Radiodns
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -45,8 +45,8 @@ describe "RadioDNS::Service" do
45
45
 
46
46
  application = @service.application(:some_application)
47
47
 
48
- assert_equal application.host, "_some_application._tcp.rdns.musicradio.com"
49
- assert_equal application.port, 1234
48
+ assert_equal "rdns.musicradio.com", application.host
49
+ assert_equal 1234, application.port
50
50
  end
51
51
 
52
52
  it "returns nil when lookup fails" do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: radiodns
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chris Lowis
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-06 00:00:00 +00:00
13
+ date: 2011-03-07 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  requirements: []
79
79
 
80
80
  rubyforge_project: radiodns
81
- rubygems_version: 1.6.1
81
+ rubygems_version: 1.5.0
82
82
  signing_key:
83
83
  specification_version: 3
84
84
  summary: Perform RadioDNS resolutions and service lookups