radavis_last_fm 0.0.6 → 0.0.7
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/.rspec +1 -0
- data/README.md +2 -0
- data/last_fm.gemspec +9 -9
- data/lib/last_fm.rb +12 -0
- data/lib/last_fm/version.rb +1 -1
- data/spec/spec_helper.rb +1 -5
- metadata +51 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19116e18daa8b661f7e87f394bef11d4d96e0f2d
|
4
|
+
data.tar.gz: c77f63d6475ce821bbacffc9b9f891e62cb7dd00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e26f5651bc4d31a43965aa040e7a66baadbdb1b8214cfde58d47268c1043cefd2bcaead8aacd289dcde2181835d8a370e2c1f46a485d7611d7f5275967447651
|
7
|
+
data.tar.gz: b118a53a98bca41a1a4e2104c0bed40ecf5652cde8eaf6e2c7714121293a8afa5c820e236f517f119d545a931b4256bf3c946a6a5667bfcc950797e8472350fe
|
data/.gitignore
CHANGED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@ Uses the Last.fm API to retrieve information for Artists and Albums
|
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
7
|
+
```
|
7
8
|
artist = LastFM::Artist.search('Nirvana').first
|
8
9
|
artist.name # 'Nirvana'
|
9
10
|
artist.image # 'http://userserve-ak.last.fm/serve/126s/416571.jpg'
|
@@ -11,6 +12,7 @@ artist.image # 'http://userserve-ak.last.fm/serve/126s/416571.jpg'
|
|
11
12
|
album = LastRubyFm::Album.search('Purple')[1]
|
12
13
|
album.artist # 'Stone Temple Pilots'
|
13
14
|
album.tracks # retrieves a list of LastRubyFm::Track objects for the given album
|
15
|
+
```
|
14
16
|
|
15
17
|
## Contributing
|
16
18
|
|
data/last_fm.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["rdavis.bacs@gmail.com"]
|
11
11
|
spec.description = %q{API Wrapper for last.fm}
|
12
12
|
spec.summary = %q{An API Wrapper for last.fm using Faraday, VCR, and RSpec}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "http://www.github.com/radavis/last_fm"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -18,13 +18,13 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "faraday"
|
22
|
-
spec.add_dependency "multi_json"
|
21
|
+
spec.add_dependency "faraday", "0.9.0"
|
22
|
+
spec.add_dependency "multi_json", "1.10.1"
|
23
23
|
|
24
|
-
|
25
|
-
spec.add_development_dependency "rake"
|
26
|
-
spec.add_development_dependency "rspec"
|
27
|
-
spec.add_development_dependency "webmock"
|
28
|
-
spec.add_development_dependency "vcr"
|
29
|
-
spec.add_development_dependency "pry"
|
24
|
+
spec.add_development_dependency "bundler", "1.6.2"
|
25
|
+
spec.add_development_dependency "rake", "10.3.2"
|
26
|
+
spec.add_development_dependency "rspec", "3.0.0"
|
27
|
+
spec.add_development_dependency "webmock", "1.18.0"
|
28
|
+
spec.add_development_dependency "vcr", "2.9.2"
|
29
|
+
spec.add_development_dependency "pry", "0.10.1"
|
30
30
|
end
|
data/lib/last_fm.rb
CHANGED
@@ -14,6 +14,18 @@ module LastFM
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.api_key
|
17
|
+
load_api_key_from_env if not has_key?
|
17
18
|
@api_key
|
18
19
|
end
|
20
|
+
|
21
|
+
def self.has_key?
|
22
|
+
!@api_key.nil? and @api_key != ''
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.load_api_key_from_env
|
26
|
+
@api_key = ENV['lastfm_api_key']
|
27
|
+
if not has_key?
|
28
|
+
raise "API key not found! Try 'export lastfm_api_key=YOUR_KEY'"
|
29
|
+
end
|
30
|
+
end
|
19
31
|
end
|
data/lib/last_fm/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -2,7 +2,7 @@ require 'rspec'
|
|
2
2
|
require 'vcr'
|
3
3
|
require_relative '../lib/last_fm'
|
4
4
|
|
5
|
-
LastFM.
|
5
|
+
LastFM.load_api_key_from_env
|
6
6
|
|
7
7
|
VCR.configure do |c|
|
8
8
|
c.cassette_library_dir = 'spec/cassettes'
|
@@ -11,7 +11,3 @@ VCR.configure do |c|
|
|
11
11
|
c.default_cassette_options = { record: :new_episodes }
|
12
12
|
c.filter_sensitive_data('<LASTFM API KEY>') { LastFM.api_key }
|
13
13
|
end
|
14
|
-
|
15
|
-
RSpec.configure do |c|
|
16
|
-
c.treat_symbols_as_metadata_keys_with_true_values = true
|
17
|
-
end
|
metadata
CHANGED
@@ -1,113 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radavis_last_fm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.9.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
|
-
version:
|
26
|
+
version: 0.9.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: multi_json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '
|
31
|
+
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.10.1
|
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
|
-
version:
|
40
|
+
version: 1.10.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.6.2
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.6.2
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - '
|
59
|
+
- - '='
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
61
|
+
version: 10.3.2
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - '
|
66
|
+
- - '='
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
68
|
+
version: 10.3.2
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - '
|
73
|
+
- - '='
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 3.0.0
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - '
|
80
|
+
- - '='
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: 3.0.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: webmock
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- - '
|
87
|
+
- - '='
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
89
|
+
version: 1.18.0
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- - '
|
94
|
+
- - '='
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
96
|
+
version: 1.18.0
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: vcr
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- - '
|
101
|
+
- - '='
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 2.9.2
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- - '
|
108
|
+
- - '='
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 2.9.2
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: pry
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- - '
|
115
|
+
- - '='
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: 0.10.1
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- - '
|
122
|
+
- - '='
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
124
|
+
version: 0.10.1
|
111
125
|
description: API Wrapper for last.fm
|
112
126
|
email:
|
113
127
|
- rdavis.bacs@gmail.com
|
@@ -115,7 +129,8 @@ executables: []
|
|
115
129
|
extensions: []
|
116
130
|
extra_rdoc_files: []
|
117
131
|
files:
|
118
|
-
- .gitignore
|
132
|
+
- ".gitignore"
|
133
|
+
- ".rspec"
|
119
134
|
- Gemfile
|
120
135
|
- LICENSE.txt
|
121
136
|
- README.md
|
@@ -138,7 +153,7 @@ files:
|
|
138
153
|
- spec/last_fm/album_spec.rb
|
139
154
|
- spec/last_fm/artist_spec.rb
|
140
155
|
- spec/spec_helper.rb
|
141
|
-
homepage:
|
156
|
+
homepage: http://www.github.com/radavis/last_fm
|
142
157
|
licenses:
|
143
158
|
- MIT
|
144
159
|
metadata: {}
|
@@ -148,17 +163,17 @@ require_paths:
|
|
148
163
|
- lib
|
149
164
|
required_ruby_version: !ruby/object:Gem::Requirement
|
150
165
|
requirements:
|
151
|
-
- -
|
166
|
+
- - ">="
|
152
167
|
- !ruby/object:Gem::Version
|
153
168
|
version: '0'
|
154
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
170
|
requirements:
|
156
|
-
- -
|
171
|
+
- - ">="
|
157
172
|
- !ruby/object:Gem::Version
|
158
173
|
version: '0'
|
159
174
|
requirements: []
|
160
175
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.
|
176
|
+
rubygems_version: 2.2.2
|
162
177
|
signing_key:
|
163
178
|
specification_version: 4
|
164
179
|
summary: An API Wrapper for last.fm using Faraday, VCR, and RSpec
|
@@ -173,3 +188,4 @@ test_files:
|
|
173
188
|
- spec/last_fm/album_spec.rb
|
174
189
|
- spec/last_fm/artist_spec.rb
|
175
190
|
- spec/spec_helper.rb
|
191
|
+
has_rdoc:
|