lastfm 1.27.1 → 1.27.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7932f8ef6da496e10123cc5bc240b713ef65395
4
- data.tar.gz: d53cbc0e32c1cd6b2238e1ae6fac7224684fc411
3
+ metadata.gz: 18953264038d0331b58860c837eb72858e142ad2
4
+ data.tar.gz: 0b5017d3c42d0171c252682da2c167ce738dd5fd
5
5
  SHA512:
6
- metadata.gz: b0b99c884b07000564a69955391b60a4452d808d374864c1e94d822581efad5d564948f47e0c8e54aaaac36cdae85161d8b98b66e96391629ae28c737099607a
7
- data.tar.gz: 5923778f2c4b8926ab51091368182c4bb9a980f1fc419881d1ad42cdf51784e991639abefeb02e2dfa98fd4193548dada46795cc4d4a635afedc7eace4a493f8
6
+ metadata.gz: 4f637061e5b4313a274f7e92383984138c111f8f3ee4fc68f55c4ec8dfdd9f8e4355b7d230ec727f0af7038525407b0ae6e18c703d2a8d99d32f321597812489
7
+ data.tar.gz: 0ebd92e374cd0afb203a687d029cda9e72de9a82619828389ab09e27682d4b7b265e8d0c5bcbe90b8948aaa84214ac1b5a6c980c0c2f8e28bc3da3c726bcc5d5
@@ -1,3 +1,6 @@
1
+ language: ruby
2
+ before_install:
3
+ - gem update bundler
1
4
  rvm:
2
5
  - 1.9.3
3
6
  - 2.0.0
@@ -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.27.1"
15
+ gem.version = "1.27.2"
16
16
  gem.license = 'MIT'
17
17
 
18
18
  gem.add_dependency "xml-simple"
@@ -20,5 +20,5 @@ Gem::Specification.new do |gem|
20
20
  gem.add_dependency 'activesupport', '>= 3.2.0'
21
21
 
22
22
  gem.add_development_dependency('rspec', ['~> 2.8.0'])
23
- gem.add_development_dependency('rake')
23
+ gem.add_development_dependency('rake', '< 11.0')
24
24
  end
@@ -6,10 +6,12 @@ class Lastfm
6
6
  attr_reader :xml
7
7
 
8
8
  def initialize(body)
9
+ body = fix_body(body)
10
+
9
11
  @xml = XmlSimple.xml_in(body, 'ForceArray' => ['image', 'tag', 'user', 'event', 'correction'])
10
12
  rescue REXML::ParseException
11
- @xml = XmlSimple.xml_in(body.encode(Encoding.find("ISO-8859-1"), :undef => :replace),
12
- 'ForceArray' => ['image', 'tag', 'user', 'event', 'correction'])
13
+ @xml = XmlSimple.xml_in(body.encode(Encoding.find("ISO-8859-1"), :undef => :replace),
14
+ 'ForceArray' => ['image', 'tag', 'user', 'event', 'correction'])
13
15
  end
14
16
 
15
17
  def success?
@@ -23,5 +25,19 @@ class Lastfm
23
25
  def error
24
26
  @xml['error']['code'].to_i
25
27
  end
28
+
29
+ private
30
+
31
+ def fix_body(body)
32
+ namespace_attr = 'xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"'
33
+
34
+ body.sub(/(<results[^>]*)/) do |str|
35
+ if str.match(namespace_attr)
36
+ str
37
+ else
38
+ '%s %s' % [str, namespace_attr]
39
+ end
40
+ end
41
+ end
26
42
  end
27
43
  end
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <lfm status="ok">
3
- <results for="Believe" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
3
+ <results for="Believe">
4
4
  <opensearch:Query role="request" searchTerms="Believe" startPage="1" />
5
5
  <opensearch:totalResults>3926</opensearch:totalResults>
6
6
  <opensearch:startIndex>0</opensearch:startIndex>
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <lfm status="ok">
3
- <results for="Believe" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
3
+ <results for="Believe">
4
4
  <opensearch:Query role="request" searchTerms="Believe" startPage="1" />
5
5
  <opensearch:totalResults>0</opensearch:totalResults>
6
6
  <opensearch:startIndex>0</opensearch:startIndex>
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <lfm status="ok">
3
- <results for="Believe" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
3
+ <results for="Believe">
4
4
  <opensearch:Query role="request" searchTerms="Believe" startPage="1" />
5
5
  <opensearch:totalResults>3926</opensearch:totalResults>
6
6
  <opensearch:startIndex>0</opensearch:startIndex>
@@ -1,5 +1,5 @@
1
1
  <lfm status="ok">
2
- <results xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" for="RADWIMPS">
2
+ <results for="RADWIMPS">
3
3
  <opensearch:Query role="request" searchTerms="RADWIMPS" startPage="1"/>
4
4
  <opensearch:totalResults>3</opensearch:totalResults>
5
5
  <opensearch:startIndex>0</opensearch:startIndex>
@@ -1,7 +1,7 @@
1
1
 
2
2
  <?xml version="1.0" encoding="utf-8"?>
3
3
  <lfm status="ok">
4
- <results for="disco" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
4
+ <results for="disco">
5
5
  <opensearch:Query role="request" searchTerms="disco" startPage="1" />
6
6
  <opensearch:totalResults>1172</opensearch:totalResults>
7
7
  <opensearch:startIndex>0</opensearch:startIndex>
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <lfm status="ok">
3
- <results xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" for="Believe">
3
+ <results for="Believe">
4
4
  <opensearch:Query role="request" searchTerms="Believe" startPage="1"/>
5
5
  <opensearch:totalResults>0</opensearch:totalResults>
6
6
  <opensearch:startIndex>0</opensearch:startIndex>
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <lfm status="ok">
3
- <results xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" for="Believe">
3
+ <results for="Believe">
4
4
  <opensearch:Query role="request" searchTerms="Believe" startPage="3"/>
5
5
  <opensearch:totalResults>40540</opensearch:totalResults>
6
6
  <opensearch:startIndex>20</opensearch:startIndex>
metadata CHANGED
@@ -1,85 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lastfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.1
4
+ version: 1.27.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - youpy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-03 00:00:00.000000000 Z
11
+ date: 2017-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: httparty
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.2.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.2.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.8.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.8.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - "<"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '11.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - "<"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '11.0'
83
83
  description: A ruby interface for Last.fm web services version 2.0
84
84
  email:
85
85
  - youpy@buycheapviagraonlinenow.com
@@ -87,9 +87,9 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - .gitignore
91
- - .rspec
92
- - .travis.yml
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
93
  - Gemfile
94
94
  - LICENSE
95
95
  - README.md
@@ -215,17 +215,17 @@ require_paths:
215
215
  - lib
216
216
  required_ruby_version: !ruby/object:Gem::Requirement
217
217
  requirements:
218
- - - '>='
218
+ - - ">="
219
219
  - !ruby/object:Gem::Version
220
220
  version: '0'
221
221
  required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  requirements:
223
- - - '>='
223
+ - - ">="
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  requirements: []
227
227
  rubyforge_project:
228
- rubygems_version: 2.0.14
228
+ rubygems_version: 2.5.1
229
229
  signing_key:
230
230
  specification_version: 4
231
231
  summary: A ruby interface for Last.fm web services version 2.0