rdio 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/lib/rdio.rb +8 -8
  2. data/lib/rdio/base.rb +18 -18
  3. data/lib/rdio/types.rb +3 -0
  4. metadata +4 -4
data/lib/rdio.rb CHANGED
@@ -7,14 +7,6 @@ require 'logger'
7
7
 
8
8
  # third party
9
9
 
10
- # internal requires
11
- require 'rdio/base'
12
- require 'rdio/api'
13
- require 'rdio/oauth'
14
- require 'rdio/datatypes'
15
- require 'rdio/types'
16
- require 'rdio/call' #TODO
17
-
18
10
  module Rdio
19
11
  VERSION = '0.0.1'
20
12
 
@@ -77,6 +69,14 @@ HERE
77
69
  end
78
70
  end
79
71
 
72
+ # internal requires
73
+ require 'rdio/base'
74
+ require 'rdio/api'
75
+ require 'rdio/oauth'
76
+ require 'rdio/datatypes'
77
+ require 'rdio/types'
78
+ require 'rdio/call'
79
+
80
80
  # Silly syntax so you can say Rd::io...blah...blah...blah
81
81
  module Rd
82
82
 
data/lib/rdio/base.rb CHANGED
@@ -19,21 +19,6 @@ class Class
19
19
  end
20
20
 
21
21
  module Rdio
22
-
23
- # Adds 'str' to the array or string 'arr'
24
- def add_to_array(arr,str)
25
- if arr == nil
26
- return [str.to_s]
27
- end
28
- if arr == ''
29
- return [str.to_s]
30
- end
31
- if arr.is_a? Array
32
- return arr + [str.to_s]
33
- end
34
- return arr.to_s + ',' + str.to_s
35
- end
36
-
37
22
  # string -> string
38
23
  #
39
24
  # Converts camel-case string to underscore-delimited one.
@@ -50,6 +35,20 @@ module Rdio
50
35
  end
51
36
  s
52
37
  end
38
+
39
+ # Adds 'str' to the array or string 'arr'
40
+ def add_to_array(arr,str)
41
+ if arr == nil
42
+ return [str.to_s]
43
+ end
44
+ if arr == ''
45
+ return [str.to_s]
46
+ end
47
+ if arr.is_a? Array
48
+ return arr + [str.to_s]
49
+ end
50
+ return arr.to_s + ',' + str.to_s
51
+ end
53
52
 
54
53
  # array -> string
55
54
  #
@@ -102,6 +101,7 @@ module Rdio
102
101
  # This is done at the end of types.rb.
103
102
  #
104
103
  attr_accessor :symbols_to_types
104
+
105
105
  end
106
106
  self.symbols_to_types = {}
107
107
 
@@ -120,7 +120,7 @@ module Rdio
120
120
  def fill(x)
121
121
  syms_to_types = Rdio::symbols_to_types || {}
122
122
  x.each do |k,v|
123
- sym = camel2underscores(k).to_sym
123
+ sym = Rdio::camel2underscores(k).to_sym
124
124
  #
125
125
  # If we have an actual type for this symbol, then use that
126
126
  # type to construct this value. Otherwise, it's just a
@@ -144,7 +144,7 @@ module Rdio
144
144
  o = to_o v
145
145
  end
146
146
  begin
147
- sym_eq = (camel2underscores(k)+'=').to_sym
147
+ sym_eq = (Rdio::camel2underscores(k)+'=').to_sym
148
148
  self.send sym_eq,o
149
149
  rescue Exception => e
150
150
  Rdio::logger.warn "Couldn't find symbol: " +
@@ -229,7 +229,7 @@ module Rdio
229
229
  # url for the contained RdioOAuth instance
230
230
  #
231
231
  def get_pin=(get_pin)
232
- @oauth.get_pin = get_pin
232
+ @oauth.get_pin = get_pin
233
233
  end
234
234
 
235
235
  def get_pin
data/lib/rdio/types.rb CHANGED
@@ -1,4 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
+
3
+ include Rdio
4
+
2
5
  module Rdio
3
6
 
4
7
  # ----------------------------------------------------------------------
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdio
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeffrey Palm
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-10 00:00:00 -04:00
18
+ date: 2011-04-12 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency