musicbrainz-ruby 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/musicbrainz.rb +16 -8
  2. metadata +67 -7
data/lib/musicbrainz.rb CHANGED
@@ -1,15 +1,23 @@
1
1
  require 'rubygems'
2
2
  require 'httparty'
3
+ require 'hashie'
3
4
 
4
- class MusicBrainz
5
- include HTTParty
6
- base_uri 'musicbrainz.org'
5
+ module MusicBrainz
6
+ class Client
7
+ include HTTParty
8
+ include Hashie
7
9
 
8
- def artist(musicbrainz_id, params = {})
9
- options = {}
10
- options[:query] = {:type => 'xml'}
11
- options[:query].merge!(params)
10
+ base_uri 'musicbrainz.org/ws/1'
12
11
 
13
- self.class.get("/ws/1/artist/#{musicbrainz_id}", options)
12
+ def request(path, params)
13
+ options = {:query => {:type => 'xml'}}
14
+ options[:query].merge!(params)
15
+
16
+ Mash.new(self.class.get(path, options)).metadata
17
+ end
18
+
19
+ def artist(musicbrainz_id = nil, params = {})
20
+ request("/artist/#{musicbrainz_id}", params)
21
+ end
14
22
  end
15
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: musicbrainz-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Robin Tweedie
@@ -15,10 +15,70 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-12 00:00:00 +00:00
18
+ date: 2011-01-16 00:00:00 +00:00
19
19
  default_executable:
20
- dependencies: []
21
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: httparty
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 5
30
+ segments:
31
+ - 0
32
+ - 6
33
+ - 1
34
+ version: 0.6.1
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: hashie
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ - 4
49
+ version: "0.4"
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: rspec
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 11
61
+ segments:
62
+ - 2
63
+ - 4
64
+ version: "2.4"
65
+ type: :development
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ name: fakeweb
69
+ prerelease: false
70
+ requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 9
76
+ segments:
77
+ - 1
78
+ - 3
79
+ version: "1.3"
80
+ type: :development
81
+ version_requirements: *id004
22
82
  description:
23
83
  email: robin@songkick.com
24
84
  executables: []
@@ -64,6 +124,6 @@ rubyforge_project:
64
124
  rubygems_version: 1.4.2
65
125
  signing_key:
66
126
  specification_version: 3
67
- summary: HTTParty wrapper for MusicBrainz XML Web Service
127
+ summary: Simple Ruby wrapper for MusicBrainz XML Web Service
68
128
  test_files: []
69
129