rockstar 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +2 -2
- data/{README.rdoc → README.md} +16 -13
- data/VERSION +1 -1
- data/examples/artist.rb +7 -1
- data/lib/rockstar/album.rb +4 -2
- data/lib/rockstar/artist.rb +17 -5
- data/lib/rockstar/event.rb +1 -1
- data/lib/rockstar/track.rb +11 -4
- data/lib/rockstar/user.rb +1 -1
- data/lib/rockstar/venue.rb +1 -1
- data/rockstar.gemspec +6 -5
- data/test/fixtures/xml/artist/getevents_artist_Metallica.xml +1064 -0
- data/test/unit/test_album.rb +3 -0
- data/test/unit/test_artist.rb +10 -0
- data/test/unit/test_track.rb +2 -0
- metadata +6 -7
data/test/unit/test_album.rb
CHANGED
@@ -25,6 +25,7 @@ class TestAlbum < Test::Unit::TestCase
|
|
25
25
|
@album.load_info
|
26
26
|
assert_equal('http://www.last.fm/music/Carrie+Underwood/Some+Hearts', @album.url)
|
27
27
|
assert_equal(Time.mktime(2005, 11, 15, 00, 00, 00), @album.release_date)
|
28
|
+
assert_match(/debut album from fourth-season American Idol winner/, @album.summary)
|
28
29
|
end
|
29
30
|
|
30
31
|
test 'should be able to find an ablum' do
|
@@ -39,6 +40,7 @@ class TestAlbum < Test::Unit::TestCase
|
|
39
40
|
assert_equal('Some Hearts', album.name)
|
40
41
|
assert_equal('http://www.last.fm/music/Carrie+Underwood/Some+Hearts', album.url)
|
41
42
|
assert_equal(Time.mktime(2005, 11, 15, 00, 00, 00), album.release_date)
|
43
|
+
assert_match(/debut album from fourth-season American Idol winner/, album.summary)
|
42
44
|
end
|
43
45
|
|
44
46
|
test "should be able to request detailed album info on initialize" do
|
@@ -47,6 +49,7 @@ class TestAlbum < Test::Unit::TestCase
|
|
47
49
|
assert_equal('Some Hearts', album.name)
|
48
50
|
assert_equal('http://www.last.fm/music/Carrie+Underwood/Some+Hearts', album.url)
|
49
51
|
assert_equal(Time.mktime(2005, 11, 15, 00, 00, 00), album.release_date)
|
52
|
+
assert_match(/debut album from fourth-season American Idol winner/, album.summary)
|
50
53
|
end
|
51
54
|
|
52
55
|
test 'should have an image method that accepts a type' do
|
data/test/unit/test_artist.rb
CHANGED
@@ -18,12 +18,15 @@ class TestArtist < Test::Unit::TestCase
|
|
18
18
|
@artist.load_info
|
19
19
|
assert_equal("http://www.last.fm/music/Metallica", @artist.url)
|
20
20
|
assert_equal("65f4f0c5-ef9e-490c-aee3-909e7ae6b2ab", @artist.mbid)
|
21
|
+
assert_match(/an American metal band formed in 1981/, @artist.summary)
|
21
22
|
end
|
22
23
|
|
23
24
|
test "should load artist info when initialized" do
|
24
25
|
artist = Rockstar::Artist.new("Metallica", :include_info => true)
|
25
26
|
assert_equal("http://www.last.fm/music/Metallica", artist.url)
|
26
27
|
assert_equal("65f4f0c5-ef9e-490c-aee3-909e7ae6b2ab", artist.mbid)
|
28
|
+
assert_match(/an American metal band formed in 1981/, artist.summary)
|
29
|
+
assert_equal("http://userserve-ak.last.fm/serve/64/3679639.jpg", artist.images['medium'])
|
27
30
|
end
|
28
31
|
|
29
32
|
test 'should be able to find similar artists' do
|
@@ -78,4 +81,11 @@ class TestArtist < Test::Unit::TestCase
|
|
78
81
|
assert_equal('100', first.count)
|
79
82
|
assert_equal('http://www.last.fm/tag/thrash%20metal', first.url)
|
80
83
|
end
|
84
|
+
|
85
|
+
test 'should be able to find upcoming events' do
|
86
|
+
events = @artist.events
|
87
|
+
assert_equal(14, events.length)
|
88
|
+
assert_equal('The Big Four - Metallica, Slayer, Megadeth, Anthrax', events.first.title)
|
89
|
+
assert_equal('07/02/11', events.first.start_date.strftime("%D"))
|
90
|
+
end
|
81
91
|
end
|
data/test/unit/test_track.rb
CHANGED
@@ -26,6 +26,7 @@ class TestTrack < Test::Unit::TestCase
|
|
26
26
|
@track.load_info
|
27
27
|
assert_equal('http://www.last.fm/music/Carrie+Underwood/_/Before+He+Cheats', @track.url)
|
28
28
|
assert_equal('1040848', @track.playcount)
|
29
|
+
assert_match(/named the 2007 Single of the Year by the Country Music Association/, @track.summary)
|
29
30
|
end
|
30
31
|
|
31
32
|
test 'should be able to request detailed album info on initialize' do
|
@@ -33,6 +34,7 @@ class TestTrack < Test::Unit::TestCase
|
|
33
34
|
assert_equal('Carrie Underwood', track.artist)
|
34
35
|
assert_equal('http://www.last.fm/music/Carrie+Underwood/_/Before+He+Cheats', track.url)
|
35
36
|
assert_equal('1040848', track.playcount)
|
37
|
+
assert_match(/named the 2007 Single of the Year by the Country Music Association/, track.summary)
|
36
38
|
end
|
37
39
|
|
38
40
|
test 'should have albums' do
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rockstar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.6.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Bodo Tasche
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-05-29 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: hpricot
|
@@ -42,12 +41,12 @@ executables: []
|
|
42
41
|
extensions: []
|
43
42
|
|
44
43
|
extra_rdoc_files:
|
45
|
-
- README.
|
44
|
+
- README.md
|
46
45
|
files:
|
47
46
|
- History.txt
|
48
47
|
- MIT-LICENSE
|
49
48
|
- Manifest
|
50
|
-
- README.
|
49
|
+
- README.md
|
51
50
|
- Rakefile
|
52
51
|
- VERSION
|
53
52
|
- examples/.gitignore
|
@@ -82,6 +81,7 @@ files:
|
|
82
81
|
- rockstar.gemspec
|
83
82
|
- test/fixtures/xml/album/getinfo_album_Radio_Retalation_artist_Thievery_Corporation.xml
|
84
83
|
- test/fixtures/xml/album/getinfo_album_Some_Hearts_artist_Carrie_Underwood.xml
|
84
|
+
- test/fixtures/xml/artist/getevents_artist_Metallica.xml
|
85
85
|
- test/fixtures/xml/artist/getinfo_artist_Metallica.xml
|
86
86
|
- test/fixtures/xml/artist/getsimilar_artist_Metallica.xml
|
87
87
|
- test/fixtures/xml/artist/gettopalbums_artist_Metallica.xml
|
@@ -135,7 +135,6 @@ files:
|
|
135
135
|
- test/unit/test_track.rb
|
136
136
|
- test/unit/test_user.rb
|
137
137
|
- test/unit/test_venue.rb
|
138
|
-
has_rdoc: true
|
139
138
|
homepage: http://github.com/bitboxer/rockstar
|
140
139
|
licenses: []
|
141
140
|
|
@@ -159,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
158
|
requirements: []
|
160
159
|
|
161
160
|
rubyforge_project:
|
162
|
-
rubygems_version: 1.
|
161
|
+
rubygems_version: 1.7.2
|
163
162
|
signing_key:
|
164
163
|
specification_version: 3
|
165
164
|
summary: wrapper for audioscrobbler (last.fm) web services
|