scrobbler-ng 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
+ :patch: 9
2
3
  :major: 2
3
- :minor: 0
4
- :patch: 8
5
4
  :build:
5
+ :minor: 0
@@ -78,7 +78,7 @@ module Scrobbler
78
78
  # @todo Try to make the best out of it
79
79
  end
80
80
  end
81
- end
81
+ end unless doc.root.nil? || doc.root.children.nil?
82
82
  elements
83
83
  end
84
84
 
@@ -223,12 +223,17 @@ module Scrobbler
223
223
  options = {:all => true}.merge options
224
224
  result = []
225
225
  if options.delete(:all)
226
- doc = Base.request(method, options)
226
+ doc = Base.request(method, options.merge(:page => 1))
227
227
  root = nil
228
228
  doc.root.children.each do |child|
229
229
  next unless child.name == parent.to_s
230
230
  root = child
231
231
  end
232
+ if root.nil? then
233
+ # Sometimes Last.fm returns an empty file if we query for sth not known
234
+ return []
235
+ end
236
+ #return nil if root.nil? # Sometimes Last.fm returns an empty XML file if there were no artists
232
237
  total_pages = root['totalPages'].to_i
233
238
  root.children.each do |child|
234
239
  next unless child.name == element.to_s.sub("Scrobbler::","").downcase
data/scrobbler-ng.gemspec CHANGED
@@ -5,19 +5,18 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{scrobbler-ng}
8
- s.version = "2.0.8"
8
+ s.version = "2.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["John Nunemaker", "Jonathan Rudenberg", "Uwe L. Korn"]
12
- s.date = %q{2010-08-11}
12
+ s.date = %q{2010-09-18}
13
13
  s.description = %q{A ruby library for accessing the Last.fm 2.0 API. It is higly optimized so that it uses less memory and parses XML (through Nokogiri) than other implementations.}
14
14
  s.email = %q{uwelk@xhochy.org}
15
15
  s.extra_rdoc_files = [
16
16
  "README.rdoc"
17
17
  ]
18
18
  s.files = [
19
- ".gitignore",
20
- "MIT-LICENSE",
19
+ "MIT-LICENSE",
21
20
  "README.rdoc",
22
21
  "Rakefile",
23
22
  "VERSION.yml",
@@ -59,30 +58,30 @@ Gem::Specification.new do |s|
59
58
  s.rubygems_version = %q{1.3.7}
60
59
  s.summary = %q{A ruby library for accessing the last.fm v2 webservices}
61
60
  s.test_files = [
62
- "test/unit/tag_spec.rb",
63
- "test/unit/playlist_spec.rb",
64
- "test/unit/album_spec.rb",
61
+ "test/spec_helper.rb",
62
+ "test/unit/user_spec.rb",
65
63
  "test/unit/radio_spec.rb",
66
- "test/unit/event_spec.rb",
64
+ "test/unit/tag_spec.rb",
65
+ "test/unit/geo_spec.rb",
67
66
  "test/unit/venue_spec.rb",
68
- "test/unit/user_spec.rb",
69
- "test/unit/artist_spec.rb",
70
- "test/unit/playing_test.rb",
71
67
  "test/unit/simpleauth_test.rb",
72
- "test/unit/geo_spec.rb",
73
- "test/unit/library_spec.rb",
68
+ "test/unit/playlist_spec.rb",
74
69
  "test/unit/track_spec.rb",
70
+ "test/unit/artist_spec.rb",
71
+ "test/unit/event_spec.rb",
72
+ "test/unit/album_spec.rb",
75
73
  "test/unit/authentication_spec.rb",
76
- "test/spec_helper.rb",
77
- "test/test_helper.rb",
78
- "test/mocks/library.rb",
74
+ "test/unit/playing_test.rb",
75
+ "test/unit/library_spec.rb",
79
76
  "test/mocks/rest.rb",
80
- "examples/tag.rb",
77
+ "test/mocks/library.rb",
78
+ "test/test_helper.rb",
81
79
  "examples/track.rb",
82
- "examples/user.rb",
80
+ "examples/album.rb",
83
81
  "examples/artist.rb",
84
- "examples/scrobble.rb",
85
- "examples/album.rb"
82
+ "examples/tag.rb",
83
+ "examples/user.rb",
84
+ "examples/scrobble.rb"
86
85
  ]
87
86
 
88
87
  if s.respond_to? :specification_version then
data/tasks/jeweler.rake CHANGED
@@ -13,7 +13,7 @@ begin
13
13
  s.add_development_dependency "fakeweb", ">= 0"
14
14
  s.add_dependency 'nokogiri', ">= 1.4.2"
15
15
 
16
- s.files.exclude 'test/**/*'
16
+ s.files.exclude 'test/**/*', '.gitignore'
17
17
  end
18
18
  Jeweler::GemcutterTasks.new
19
19
  rescue LoadError
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::Album do
4
4
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- require File.dirname(__FILE__) + '/../spec_helper.rb'
3
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
4
4
 
5
5
  describe Scrobbler::Artist do
6
6
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::Authentication do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::Event do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::Geo do
4
4
 
@@ -145,4 +145,4 @@ describe Scrobbler::Geo do
145
145
  end
146
146
  end
147
147
  end
148
- end
148
+ end
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::Library do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::Playlist do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::Radio do
4
4
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- require File.dirname(__FILE__) + '/../spec_helper.rb'
3
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
4
4
 
5
5
  describe Scrobbler::Tag do
6
6
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::Track do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::User do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
2
2
 
3
3
  describe Scrobbler::Venue do
4
4
  before do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrobbler-ng
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 8
10
- version: 2.0.8
9
+ - 9
10
+ version: 2.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Nunemaker
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-08-11 00:00:00 +02:00
20
+ date: 2010-09-18 00:00:00 +02:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -89,7 +89,6 @@ extensions: []
89
89
  extra_rdoc_files:
90
90
  - README.rdoc
91
91
  files:
92
- - .gitignore
93
92
  - MIT-LICENSE
94
93
  - README.rdoc
95
94
  - Rakefile
@@ -125,24 +124,24 @@ files:
125
124
  - tasks/rdoc.rake
126
125
  - tasks/tests.rake
127
126
  - tasks/yardoc.rake
128
- - test/unit/tag_spec.rb
129
- - test/unit/playlist_spec.rb
130
- - test/unit/album_spec.rb
127
+ - test/spec_helper.rb
128
+ - test/unit/user_spec.rb
131
129
  - test/unit/radio_spec.rb
132
- - test/unit/event_spec.rb
130
+ - test/unit/tag_spec.rb
131
+ - test/unit/geo_spec.rb
133
132
  - test/unit/venue_spec.rb
134
- - test/unit/user_spec.rb
135
- - test/unit/artist_spec.rb
136
- - test/unit/playing_test.rb
137
133
  - test/unit/simpleauth_test.rb
138
- - test/unit/geo_spec.rb
139
- - test/unit/library_spec.rb
134
+ - test/unit/playlist_spec.rb
140
135
  - test/unit/track_spec.rb
136
+ - test/unit/artist_spec.rb
137
+ - test/unit/event_spec.rb
138
+ - test/unit/album_spec.rb
141
139
  - test/unit/authentication_spec.rb
142
- - test/spec_helper.rb
143
- - test/test_helper.rb
144
- - test/mocks/library.rb
140
+ - test/unit/playing_test.rb
141
+ - test/unit/library_spec.rb
145
142
  - test/mocks/rest.rb
143
+ - test/mocks/library.rb
144
+ - test/test_helper.rb
146
145
  has_rdoc: true
147
146
  homepage: http://github.com/xhochy/scrobbler
148
147
  licenses: []
@@ -178,27 +177,27 @@ signing_key:
178
177
  specification_version: 3
179
178
  summary: A ruby library for accessing the last.fm v2 webservices
180
179
  test_files:
181
- - test/unit/tag_spec.rb
182
- - test/unit/playlist_spec.rb
183
- - test/unit/album_spec.rb
180
+ - test/spec_helper.rb
181
+ - test/unit/user_spec.rb
184
182
  - test/unit/radio_spec.rb
185
- - test/unit/event_spec.rb
183
+ - test/unit/tag_spec.rb
184
+ - test/unit/geo_spec.rb
186
185
  - test/unit/venue_spec.rb
187
- - test/unit/user_spec.rb
188
- - test/unit/artist_spec.rb
189
- - test/unit/playing_test.rb
190
186
  - test/unit/simpleauth_test.rb
191
- - test/unit/geo_spec.rb
192
- - test/unit/library_spec.rb
187
+ - test/unit/playlist_spec.rb
193
188
  - test/unit/track_spec.rb
189
+ - test/unit/artist_spec.rb
190
+ - test/unit/event_spec.rb
191
+ - test/unit/album_spec.rb
194
192
  - test/unit/authentication_spec.rb
195
- - test/spec_helper.rb
196
- - test/test_helper.rb
197
- - test/mocks/library.rb
193
+ - test/unit/playing_test.rb
194
+ - test/unit/library_spec.rb
198
195
  - test/mocks/rest.rb
199
- - examples/tag.rb
196
+ - test/mocks/library.rb
197
+ - test/test_helper.rb
200
198
  - examples/track.rb
201
- - examples/user.rb
199
+ - examples/album.rb
202
200
  - examples/artist.rb
201
+ - examples/tag.rb
202
+ - examples/user.rb
203
203
  - examples/scrobble.rb
204
- - examples/album.rb
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- rdoc
2
- doc/*
3
- pkg/*
4
- nbproject
5
- scrobbler-*.gem
6
- *.rb~
7
- *.rake~
8
- coverage
9
- spec.html
10
- catalog.xml
11
- .yardoc
12
- tmp
13
- .project
14
- .loadpath
15
- view*.sh
16
- .chomrium/