rspotify 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -0
- data/lib/rspotify/album.rb +0 -4
- data/lib/rspotify/artist.rb +0 -3
- data/lib/rspotify/base.rb +24 -5
- data/lib/rspotify/playlist.rb +3 -3
- data/lib/rspotify/track.rb +0 -4
- data/lib/rspotify/user.rb +0 -1
- data/lib/rspotify/version.rb +1 -1
- data/lib/rspotify.rb +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0f489f7b6248799f9c52fab33efa35debd4933a
|
4
|
+
data.tar.gz: c235ab00785d39e994950485cee2b994b2d2addb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04b88d2a1bff87009cbbb22139c9c8290a0a6880cd3edd587013f8d2e6ad0f078c6299fd7688c242426dc5439212e58676546948e735fa88a93606d780b1262f
|
7
|
+
data.tar.gz: 50b468779d68fdab5b7f3bf430a485570831dc231477c899a02a28ad10a5512b5e216e1603b1223ba42a01c8a023491a5367c184fe97d3eb5da2ffeccbf30e46
|
data/.travis.yml
ADDED
data/lib/rspotify/album.rb
CHANGED
@@ -2,9 +2,6 @@ module RSpotify
|
|
2
2
|
|
3
3
|
class Album < Base
|
4
4
|
|
5
|
-
attr_accessor :album_type, :artists, :available_markets, :external_ids, :genres, :images,
|
6
|
-
:name, :popularity, :release_date, :release_date_precision, :tracks
|
7
|
-
|
8
5
|
def self.find(id)
|
9
6
|
super(id, 'album')
|
10
7
|
end
|
@@ -36,6 +33,5 @@ module RSpotify
|
|
36
33
|
|
37
34
|
super(options)
|
38
35
|
end
|
39
|
-
|
40
36
|
end
|
41
37
|
end
|
data/lib/rspotify/artist.rb
CHANGED
data/lib/rspotify/base.rb
CHANGED
@@ -2,8 +2,6 @@ module RSpotify
|
|
2
2
|
|
3
3
|
class Base
|
4
4
|
|
5
|
-
attr_accessor :external_urls, :href, :id, :type, :uri
|
6
|
-
|
7
5
|
def self.find(id, type)
|
8
6
|
pluralized_type = "#{type}s"
|
9
7
|
type_class = eval type.capitalize
|
@@ -18,9 +16,9 @@ module RSpotify
|
|
18
16
|
|
19
17
|
json = RSpotify.get 'search',
|
20
18
|
params: {
|
21
|
-
q:
|
22
|
-
type:
|
23
|
-
limit:
|
19
|
+
q: query,
|
20
|
+
type: type,
|
21
|
+
limit: limit,
|
24
22
|
offset: offset
|
25
23
|
}
|
26
24
|
|
@@ -36,5 +34,26 @@ module RSpotify
|
|
36
34
|
@uri = options['uri']
|
37
35
|
end
|
38
36
|
|
37
|
+
def complete_object!
|
38
|
+
pluralized_type = "#{type}s"
|
39
|
+
initialize RSpotify.get("#{pluralized_type}/#{@id}")
|
40
|
+
end
|
41
|
+
|
42
|
+
def method_missing(method_name, *args)
|
43
|
+
attr = "@#{method_name}".to_sym
|
44
|
+
super unless instance_variables.include? attr
|
45
|
+
|
46
|
+
attr_value = instance_variable_get attr
|
47
|
+
return attr_value unless attr_value.nil?
|
48
|
+
|
49
|
+
complete_object!
|
50
|
+
instance_variable_get attr
|
51
|
+
end
|
52
|
+
|
53
|
+
def respond_to?(method_name)
|
54
|
+
attr = "@#{method_name}".to_sym
|
55
|
+
return true if instance_variables.include? attr
|
56
|
+
super
|
57
|
+
end
|
39
58
|
end
|
40
59
|
end
|
data/lib/rspotify/playlist.rb
CHANGED
@@ -2,9 +2,6 @@ module RSpotify
|
|
2
2
|
|
3
3
|
class Playlist < Base
|
4
4
|
|
5
|
-
attr_accessor :collaborative, :description, :followers,
|
6
|
-
:images, :name, :owner, :public, :tracks
|
7
|
-
|
8
5
|
def self.find(user_id, id)
|
9
6
|
json = RSpotify.auth_get("users/#{user_id}/playlists/#{id}")
|
10
7
|
Playlist.new json
|
@@ -34,5 +31,8 @@ module RSpotify
|
|
34
31
|
super(options)
|
35
32
|
end
|
36
33
|
|
34
|
+
def complete_object!
|
35
|
+
initialize RSpotify.auth_get("users/#{@owner.id}/playlists/#{@id}")
|
36
|
+
end
|
37
37
|
end
|
38
38
|
end
|
data/lib/rspotify/track.rb
CHANGED
@@ -2,9 +2,6 @@ module RSpotify
|
|
2
2
|
|
3
3
|
class Track < Base
|
4
4
|
|
5
|
-
attr_accessor :album, :artists, :available_markets, :disc_number, :duration_ms, :explicit,
|
6
|
-
:external_ids, :name, :popularity, :preview_url, :track_number
|
7
|
-
|
8
5
|
def self.find(id)
|
9
6
|
super(id, 'track')
|
10
7
|
end
|
@@ -35,6 +32,5 @@ module RSpotify
|
|
35
32
|
|
36
33
|
super(options)
|
37
34
|
end
|
38
|
-
|
39
35
|
end
|
40
36
|
end
|
data/lib/rspotify/user.rb
CHANGED
data/lib/rspotify/version.rb
CHANGED
data/lib/rspotify.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Sad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest_client
|
@@ -89,6 +89,7 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".gitignore"
|
91
91
|
- ".rspec"
|
92
|
+
- ".travis.yml"
|
92
93
|
- Gemfile
|
93
94
|
- LICENSE.txt
|
94
95
|
- README.md
|