gracenote 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gracenote.rb +4 -2
  3. data/lib/gracenote/HTTP.rb +26 -25
  4. metadata +31 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d4bdc1ae286f082a3230f516c9750a09a010ed2
4
- data.tar.gz: e921c97c0b4946b1487e7c1c1e05db37ec535674
3
+ metadata.gz: bef5d85e077a1105e732be2f48d752f0a8d4d461
4
+ data.tar.gz: 69da1b11b881b34bbd777d52a222df0c870acdff
5
5
  SHA512:
6
- metadata.gz: d6b4e28f592b05afa5441469288ea7e0a606d7bc882ba2f0a1c9cb646060032a185003cb067c07296430b0c73e36d64b09fa5527eba0e306de6fd6efce9fd7d7
7
- data.tar.gz: b2d9b321bb97a238a5e7b94a752b7dac1ebde804df27dcf34cf638d8e0fd08deb5cec6c4c1938fcf4528a555df04859c03f0e99277f91ed0c582de36bfa072a5
6
+ metadata.gz: 44d7f5b49d757be36fd99c726269b37a9ff3ab201e49362347f37d005d0a759817137018bb5535bccf8e9fd48cf06a8c87a1d491cefa1c17318e2aaa8b86d812
7
+ data.tar.gz: c29724bd101476f6d422c8c3299eb2b7d9ff9b0e6338b5d55b9b5f9c71cdfb58a2fcbc2084a7d47c7f22a93992733ae7c78b95dd2eedc0f6a726c6f443058806
@@ -7,6 +7,8 @@ class Gracenote
7
7
  @@ALL_RESULTS = '1'
8
8
  @@BEST_MATCH_ONLY = '0'
9
9
 
10
+ attr_accessor :clientID, :clientTag, :userID, :apiURL
11
+
10
12
  # Function: initialize
11
13
  # Sets the following instance variables
12
14
  # clientID
@@ -38,7 +40,7 @@ class Gracenote
38
40
  end
39
41
 
40
42
  if not @userID.nil?
41
- p "user already registered. No need to register again"
43
+ puts "user already registered. No need to register again"
42
44
  return @userID
43
45
  end
44
46
 
@@ -250,7 +252,7 @@ class Gracenote
250
252
  # Arguments:
251
253
  # query
252
254
  def api (query)
253
- return HTTP.post(@apiURL, query)
255
+ return Gracenote::HTTP.post(@apiURL, query)
254
256
  end
255
257
 
256
258
  # Function: constructQueryReq
@@ -9,33 +9,34 @@ require 'curb'
9
9
  require 'rack'
10
10
  require 'uri'
11
11
 
12
- class HTTP
13
- def self.get(path, cookie='')
14
- uri = URI(path)
15
- req = Net::HTTP.new(uri.host, uri.port)
16
- req.read_timeout = 60
17
- req.use_ssl = (uri.scheme == "https") ? true : false
18
- headers = {'Cookie' => cookie}
19
-
20
- resp = req.get( uri.path, headers)
21
- return resp
22
- end
23
-
24
- def self.post(path, data='', cookie='')
25
- uri = URI(path)
26
- req = Net::HTTP.new(uri.host, uri.port)
27
- req.read_timeout = 60
28
- req.use_ssl = (uri.scheme == "https") ? true : false
29
- headers = {'Cookie' => cookie, "Content-Type" => "application/xml"}
12
+ class Gracenote
13
+ class HTTP
14
+ def self.get(path, cookie='')
15
+ uri = URI(path)
16
+ req = Net::HTTP.new(uri.host, uri.port)
17
+ req.read_timeout = 60
18
+ req.use_ssl = (uri.scheme == "https") ? true : false
19
+ headers = {'Cookie' => cookie}
30
20
 
31
- if data.class.to_s == 'String'
32
- reqdata = data;
33
- else
34
- reqdata = Rack::Utils.build_nested_query(data)
21
+ resp = req.get( uri.path, headers)
22
+ return resp
35
23
  end
36
24
 
37
- resp = req.request_post( uri.path, reqdata, headers)
38
- return resp
39
- end
25
+ def self.post(path, data='', cookie='')
26
+ uri = URI(path)
27
+ req = Net::HTTP.new(uri.host, uri.port)
28
+ req.read_timeout = 60
29
+ req.use_ssl = (uri.scheme == "https") ? true : false
30
+ headers = {'Cookie' => cookie, "Content-Type" => "application/xml"}
31
+
32
+ if data.class.to_s == 'String'
33
+ reqdata = data;
34
+ else
35
+ reqdata = Rack::Utils.build_nested_query(data)
36
+ end
40
37
 
38
+ resp = req.request_post( uri.path, reqdata, headers)
39
+ return resp
40
+ end
41
+ end
41
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gracenote
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - nobelium
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-24 00:00:00.000000000 Z
11
+ date: 2016-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: curb
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - '>='
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rack
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  description: Gracenote web api gem
70
98
  email:
71
99
  - me@vignesh.info
@@ -95,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
123
  version: '0'
96
124
  requirements: []
97
125
  rubyforge_project:
98
- rubygems_version: 2.1.11
126
+ rubygems_version: 2.0.14
99
127
  signing_key:
100
128
  specification_version: 4
101
129
  summary: This gem is a wrapper for the gracenote web api