lastfm 1.25.0 → 1.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +5 -0
- data/lastfm.gemspec +1 -1
- data/lib/lastfm.rb +5 -0
- data/lib/lastfm/method_category/group.rb +16 -0
- data/lib/lastfm/method_category/user.rb +1 -1
- data/spec/fixtures/group_get_members.xml +13 -0
- data/spec/method_specs/group_spec.rb +22 -0
- data/spec/method_specs/user_spec.rb +3 -3
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d75da0eb84e97b713db6269b03898aa030dd269
|
4
|
+
data.tar.gz: e634865474c9d7f0942537d34c059bac4a030d3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31bd09f2c32dfb2a080cf4f543a2efe8b64a117993308e97051547f4ca8129b7def45e9fbbf824a7e4bcfc9b15b142dd77570a8282748cdc1e80f477b6faa4c9
|
7
|
+
data.tar.gz: 8950457ca4a2fdcbd0f113979152dadaec1ae293f25ecae9f8b6acac977289e0d288a585881bbef92993707be9f4831703630b96070d568e86d8b13a76512286
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -61,6 +61,7 @@ It supports methods which require [authentication](http://www.last.fm/api/authen
|
|
61
61
|
|
62
62
|
### Tag
|
63
63
|
|
64
|
+
* [tag.getInfo](http://www.last.fm/api/show/tag.getInfo)
|
64
65
|
* [tag.getTopAlbums](http://www.last.fm/api/show/tag.getTopAlbums)
|
65
66
|
* [tag.getTopArtists](http://www.last.fm/api/show/tag.getTopArtists)
|
66
67
|
* [tag.getTopTracks](http://www.last.fm/api/show/tag.getTopTracks)
|
@@ -111,6 +112,10 @@ It supports methods which require [authentication](http://www.last.fm/api/authen
|
|
111
112
|
|
112
113
|
* [geo.getEvents](http://www.last.fm/api/show?service#270)
|
113
114
|
|
115
|
+
### Group
|
116
|
+
|
117
|
+
* [group.getMembers](http://www.last.fm/api/show/group.getMembers)
|
118
|
+
|
114
119
|
### Library
|
115
120
|
|
116
121
|
* [library.getArtists](http://www.last.fm/api/show?service#322)
|
data/lastfm.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
13
13
|
gem.name = %q{lastfm}
|
14
14
|
gem.require_paths = ["lib"]
|
15
|
-
gem.version = "1.
|
15
|
+
gem.version = "1.26.0"
|
16
16
|
gem.license = 'MIT'
|
17
17
|
|
18
18
|
gem.add_dependency "xml-simple"
|
data/lib/lastfm.rb
CHANGED
@@ -13,6 +13,7 @@ require 'lastfm/method_category/artist'
|
|
13
13
|
require 'lastfm/method_category/auth'
|
14
14
|
require 'lastfm/method_category/event'
|
15
15
|
require 'lastfm/method_category/geo'
|
16
|
+
require 'lastfm/method_category/group'
|
16
17
|
require 'lastfm/method_category/library'
|
17
18
|
require 'lastfm/method_category/tag'
|
18
19
|
require 'lastfm/method_category/tasteometer'
|
@@ -59,6 +60,10 @@ class Lastfm
|
|
59
60
|
MethodCategory::Geo.new(self)
|
60
61
|
end
|
61
62
|
|
63
|
+
def group
|
64
|
+
MethodCategory::Group.new(self)
|
65
|
+
end
|
66
|
+
|
62
67
|
def library
|
63
68
|
MethodCategory::Library.new(self)
|
64
69
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Lastfm
|
2
|
+
module MethodCategory
|
3
|
+
class Group < Base
|
4
|
+
regular_method(
|
5
|
+
:get_members,
|
6
|
+
:required => [:group],
|
7
|
+
:optional => [
|
8
|
+
[:limit, nil],
|
9
|
+
[:page, nil]
|
10
|
+
]
|
11
|
+
) do |response|
|
12
|
+
Util.force_array(response.xml['members']['user'])
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<lfm status="ok">
|
2
|
+
<members for="Linux" page="1" perPage="50" totalPages="1" total="1">
|
3
|
+
<user>
|
4
|
+
<name>RJ</name>
|
5
|
+
<realname>Richard Jones</realname>
|
6
|
+
<image size="small">http://test.com/1.jpg</image>
|
7
|
+
<image size="medium">http://test.com/2.jpg</image>
|
8
|
+
<image size="large">http://test.com/3.jpg</image>
|
9
|
+
<image size="extralarge">http://test.com/4.jpg</image>
|
10
|
+
<url>http://www.last.fm/user/RJ</url>
|
11
|
+
</user>
|
12
|
+
</members>
|
13
|
+
</lfm>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe '#group' do
|
4
|
+
before { init_lastfm }
|
5
|
+
|
6
|
+
it 'should return an instance of Lastfm::Group' do
|
7
|
+
@lastfm.group.should be_an_instance_of(Lastfm::MethodCategory::Group)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#get_members' do
|
11
|
+
it 'should get the members\' info' do
|
12
|
+
@lastfm.should_receive(:request).with('group.getMembers', {
|
13
|
+
:group => 'Linux',
|
14
|
+
:limit => nil,
|
15
|
+
:page => nil
|
16
|
+
}).and_return(make_response('group_get_members'))
|
17
|
+
members = @lastfm.group.get_members(:group => 'Linux')
|
18
|
+
members[0]['name'].should == 'RJ'
|
19
|
+
members.size.should == 1
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -227,7 +227,7 @@ describe '#user' do
|
|
227
227
|
:limit => nil,
|
228
228
|
:to => nil,
|
229
229
|
:from => nil
|
230
|
-
}).and_return(make_response('user_get_recent_tracks'))
|
230
|
+
}, :get, true, true).and_return(make_response('user_get_recent_tracks'))
|
231
231
|
tracks = @lastfm.user.get_recent_tracks(:user => 'test')
|
232
232
|
tracks[1]['artist']['content'].should == 'Kylie Minogue'
|
233
233
|
tracks.size.should == 2
|
@@ -240,8 +240,8 @@ describe '#user' do
|
|
240
240
|
:limit => nil,
|
241
241
|
:to => nil,
|
242
242
|
:from => nil
|
243
|
-
}).and_return(make_response('user_get_recent_tracks_malformed'))
|
244
|
-
|
243
|
+
}, :get, true, true).and_return(make_response('user_get_recent_tracks_malformed'))
|
244
|
+
@lastfm.user.get_recent_tracks(:user => 'test')
|
245
245
|
end
|
246
246
|
end
|
247
247
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lastfm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- youpy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xml-simple
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/lastfm/method_category/chart.rb
|
106
106
|
- lib/lastfm/method_category/event.rb
|
107
107
|
- lib/lastfm/method_category/geo.rb
|
108
|
+
- lib/lastfm/method_category/group.rb
|
108
109
|
- lib/lastfm/method_category/library.rb
|
109
110
|
- lib/lastfm/method_category/radio.rb
|
110
111
|
- lib/lastfm/method_category/tag.rb
|
@@ -132,6 +133,7 @@ files:
|
|
132
133
|
- spec/fixtures/chart_get_top_tracks.xml
|
133
134
|
- spec/fixtures/event_get_info.xml
|
134
135
|
- spec/fixtures/geo_get_events.xml
|
136
|
+
- spec/fixtures/group_get_members.xml
|
135
137
|
- spec/fixtures/library_get_artists.xml
|
136
138
|
- spec/fixtures/library_get_tracks.xml
|
137
139
|
- spec/fixtures/ng.xml
|
@@ -181,6 +183,7 @@ files:
|
|
181
183
|
- spec/method_specs/chart_spec.rb
|
182
184
|
- spec/method_specs/event_spec.rb
|
183
185
|
- spec/method_specs/geo_spec.rb
|
186
|
+
- spec/method_specs/group_spec.rb
|
184
187
|
- spec/method_specs/library_spec.rb
|
185
188
|
- spec/method_specs/radio_spec.rb
|
186
189
|
- spec/method_specs/tag_spec.rb
|
@@ -210,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
213
|
version: '0'
|
211
214
|
requirements: []
|
212
215
|
rubyforge_project:
|
213
|
-
rubygems_version: 2.2.1
|
216
|
+
rubygems_version: 2.2.0.rc.1
|
214
217
|
signing_key:
|
215
218
|
specification_version: 4
|
216
219
|
summary: A ruby interface for Last.fm web services version 2.0
|
@@ -234,6 +237,7 @@ test_files:
|
|
234
237
|
- spec/fixtures/chart_get_top_tracks.xml
|
235
238
|
- spec/fixtures/event_get_info.xml
|
236
239
|
- spec/fixtures/geo_get_events.xml
|
240
|
+
- spec/fixtures/group_get_members.xml
|
237
241
|
- spec/fixtures/library_get_artists.xml
|
238
242
|
- spec/fixtures/library_get_tracks.xml
|
239
243
|
- spec/fixtures/ng.xml
|
@@ -283,6 +287,7 @@ test_files:
|
|
283
287
|
- spec/method_specs/chart_spec.rb
|
284
288
|
- spec/method_specs/event_spec.rb
|
285
289
|
- spec/method_specs/geo_spec.rb
|
290
|
+
- spec/method_specs/group_spec.rb
|
286
291
|
- spec/method_specs/library_spec.rb
|
287
292
|
- spec/method_specs/radio_spec.rb
|
288
293
|
- spec/method_specs/tag_spec.rb
|