beatport 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +3 -2
- data/VERSION +1 -1
- data/beatport.gemspec +12 -8
- data/lib/beatport/client.rb +9 -9
- data/spec/catalog/account_type_spec.rb +5 -5
- data/spec/catalog/artist_spec.rb +3 -3
- data/spec/catalog/autocomplete_spec.rb +6 -6
- data/spec/catalog/chart_overview_spec.rb +1 -2
- data/spec/catalog/chart_spec.rb +21 -21
- data/spec/catalog/genre_spec.rb +11 -11
- data/spec/catalog/home_spec.rb +2 -2
- data/spec/catalog/label_spec.rb +3 -3
- data/spec/catalog/release_spec.rb +2 -2
- data/spec/catalog/slide_spec.rb +7 -8
- data/spec/catalog/track_spec.rb +2 -2
- data/spec/spec_helper.rb +8 -3
- metadata +45 -58
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5f7142186f3f60e18258ca7b40d490eda3d53528
|
4
|
+
data.tar.gz: c2dd6a59d0b28252df1b50a9fda7ed0de63806c2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c49edc32fd74cca6503b44a97e9b18c2e3815d004d8565009e5daa8e51a6df89cebada2b9a06e936aa3be4fbde3813323ce8bacb4d41d93a83dba4e7f4fbf763
|
7
|
+
data.tar.gz: f0663196afa98a1247c784e11fda6b0313d456c7eb4914c06fed62bb920e606561cd1c8076a0cc0c62e9e61355816789285f48ab5f93ce405af124a67791ff95
|
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/beatport.gemspec
CHANGED
@@ -2,14 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: beatport 0.2.2 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "beatport"
|
8
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.2"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["Mateo Murphy"]
|
12
|
-
s.date = "
|
14
|
+
s.date = "2015-01-23"
|
13
15
|
s.description = "A ruby gem for accessing the beatport api"
|
14
16
|
s.email = "mateo.murphy@gmail.com"
|
15
17
|
s.extra_rdoc_files = [
|
@@ -100,12 +102,11 @@ Gem::Specification.new do |s|
|
|
100
102
|
]
|
101
103
|
s.homepage = "http://github.com/mateomurphy/beatport"
|
102
104
|
s.licenses = ["MIT"]
|
103
|
-
s.
|
104
|
-
s.rubygems_version = "1.8.25"
|
105
|
+
s.rubygems_version = "2.4.3"
|
105
106
|
s.summary = "ruby gem for accessing the beatport api"
|
106
107
|
|
107
108
|
if s.respond_to? :specification_version then
|
108
|
-
s.specification_version =
|
109
|
+
s.specification_version = 4
|
109
110
|
|
110
111
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
111
112
|
s.add_runtime_dependency(%q<addressable>, [">= 0"])
|
@@ -116,7 +117,8 @@ Gem::Specification.new do |s|
|
|
116
117
|
s.add_development_dependency(%q<webmock>, [">= 0"])
|
117
118
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
118
119
|
s.add_development_dependency(%q<log_buddy>, [">= 0"])
|
119
|
-
s.add_development_dependency(%q<rspec>, ["
|
120
|
+
s.add_development_dependency(%q<rspec>, ["~> 3.0"])
|
121
|
+
s.add_development_dependency(%q<rspec-its>, [">= 0"])
|
120
122
|
s.add_development_dependency(%q<yard>, [">= 0"])
|
121
123
|
s.add_development_dependency(%q<vcr>, [">= 0"])
|
122
124
|
else
|
@@ -128,7 +130,8 @@ Gem::Specification.new do |s|
|
|
128
130
|
s.add_dependency(%q<webmock>, [">= 0"])
|
129
131
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
130
132
|
s.add_dependency(%q<log_buddy>, [">= 0"])
|
131
|
-
s.add_dependency(%q<rspec>, ["
|
133
|
+
s.add_dependency(%q<rspec>, ["~> 3.0"])
|
134
|
+
s.add_dependency(%q<rspec-its>, [">= 0"])
|
132
135
|
s.add_dependency(%q<yard>, [">= 0"])
|
133
136
|
s.add_dependency(%q<vcr>, [">= 0"])
|
134
137
|
end
|
@@ -141,7 +144,8 @@ Gem::Specification.new do |s|
|
|
141
144
|
s.add_dependency(%q<webmock>, [">= 0"])
|
142
145
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
143
146
|
s.add_dependency(%q<log_buddy>, [">= 0"])
|
144
|
-
s.add_dependency(%q<rspec>, ["
|
147
|
+
s.add_dependency(%q<rspec>, ["~> 3.0"])
|
148
|
+
s.add_dependency(%q<rspec-its>, [">= 0"])
|
145
149
|
s.add_dependency(%q<yard>, [">= 0"])
|
146
150
|
s.add_dependency(%q<vcr>, [">= 0"])
|
147
151
|
end
|
data/lib/beatport/client.rb
CHANGED
@@ -4,9 +4,9 @@ module Beatport
|
|
4
4
|
@connection ||= Faraday.new do |conn|
|
5
5
|
conn.use Support::Middleware
|
6
6
|
conn.adapter Faraday.default_adapter # make requests with Net::HTTP
|
7
|
-
end
|
7
|
+
end
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def self.client
|
11
11
|
@client ||= Signet::OAuth1::Client.new(
|
12
12
|
:client_credential_key => Beatport.consumer_key,
|
@@ -15,23 +15,23 @@ module Beatport
|
|
15
15
|
:token_credential_secret => Beatport.access_token_secret
|
16
16
|
)
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
def self.builder
|
20
20
|
@builder ||= Support::QueryBuilder.new
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def self.uri(path, args)
|
24
24
|
Addressable::URI.new(
|
25
25
|
:scheme => 'https',
|
26
|
-
:host => 'api.beatport.com',
|
26
|
+
:host => 'oauth-api.beatport.com',
|
27
27
|
:path => "/catalog/3/#{path}",
|
28
28
|
:query_values => builder.process(*args)
|
29
|
-
)
|
29
|
+
)
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
def self.retrieve(path, klass, *args)
|
33
33
|
result = client.fetch_protected_resource(
|
34
|
-
:connection => connection,
|
34
|
+
:connection => connection,
|
35
35
|
:uri => uri(path, args).to_s
|
36
36
|
).body
|
37
37
|
|
@@ -51,6 +51,6 @@ module Beatport
|
|
51
51
|
else
|
52
52
|
raise Error.new("results is an unexpected class #{result['results'].class}")
|
53
53
|
end
|
54
|
-
end
|
54
|
+
end
|
55
55
|
end
|
56
56
|
end
|
@@ -14,7 +14,7 @@ module Beatport::Catalog
|
|
14
14
|
subject :account_type do
|
15
15
|
AccountType.all.first
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
it { should be_an(AccountType) }
|
19
19
|
its (:code) { should == "AMEX" }
|
20
20
|
its (:bpid) { should == 1 }
|
@@ -24,22 +24,22 @@ module Beatport::Catalog
|
|
24
24
|
its (:validation_regex) { should == /^3[47][0-9]{13}$/ }
|
25
25
|
its (:'images.small.url') { should == "https://secure-beatport.bpddn.com/images/creditcard/logo_cc_amex_37x23.gif"}
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
describe '.all' do
|
29
29
|
subject do
|
30
30
|
AccountType.all
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
its (:length) { should be > 1 }
|
34
34
|
end
|
35
35
|
|
36
36
|
describe '.find' do
|
37
37
|
context "by id" do
|
38
|
-
|
38
|
+
skip "Isn't currently supported by beatport"
|
39
39
|
# subject { AccountType.find(2) }
|
40
40
|
# its (:name) { should == "Visa" }
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
context "by name" do
|
44
44
|
subject do
|
45
45
|
AccountType.find('Visa')
|
data/spec/catalog/artist_spec.rb
CHANGED
@@ -20,13 +20,13 @@ module Beatport::Catalog
|
|
20
20
|
its (:slug) { should == "above-and-beyond" }
|
21
21
|
its (:url) { should == "http://www.beatport.com/artist/above-and-beyond/7181" }
|
22
22
|
its (:last_publish_date) { should >= Date.new(2011, 12, 15)}
|
23
|
-
its (:biography) {
|
23
|
+
its (:biography) { should_not be "" }
|
24
24
|
its (:'genres.length') { should be > 1 }
|
25
25
|
its (:'sub_genres.length') { should be > 1 }
|
26
26
|
its (:'top_downloads.length') { should be > 1 }
|
27
27
|
its (:'images.small.url') { should == "http://geo-media.beatport.com/image/491527.jpg" }
|
28
28
|
its (:'images.medium.url') { should == "http://geo-media.beatport.com/image/491530.jpg" }
|
29
|
-
its (:'images.large.url') { should == "http://geo-media.beatport.com/image/
|
29
|
+
its (:'images.large.url') { should == "http://geo-media.beatport.com/image/10529942.jpg" }
|
30
30
|
# its (:'featured_releases.length') { should be > 1 }
|
31
31
|
end
|
32
32
|
|
@@ -108,7 +108,7 @@ module Beatport::Catalog
|
|
108
108
|
end
|
109
109
|
|
110
110
|
it "should get all trance artists for above & beyond" do
|
111
|
-
|
111
|
+
skip "Request doesn't return any results"
|
112
112
|
|
113
113
|
artists = Artist.all :facets => {:genre_name => ['Trance', 'Progessive House']}
|
114
114
|
|
@@ -12,14 +12,14 @@ module Beatport::Catalog
|
|
12
12
|
|
13
13
|
describe 'stucture' do
|
14
14
|
subject { Autocomplete.query('lutzen').first }
|
15
|
-
|
15
|
+
|
16
16
|
its (:'name.downcase') { should match(/lutzen/) }
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
describe 'collection' do
|
20
20
|
subject { Autocomplete.query('lutzen') }
|
21
|
-
|
22
|
-
its (:host) { should == "api.beatport.com" }
|
21
|
+
|
22
|
+
its (:host) { should == "oauth-api.beatport.com" }
|
23
23
|
its (:path) { should == "/catalog/autocomplete" }
|
24
24
|
its (:query) { should == "query=lutzen" }
|
25
25
|
its (:page) { should == 1 }
|
@@ -31,10 +31,10 @@ module Beatport::Catalog
|
|
31
31
|
its (:facets) { should_not be_nil }
|
32
32
|
its (:spellcheck) { should be_nil }
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
describe '.query' do
|
36
36
|
subject { Autocomplete.query('lutzen', :page => 3, :per_page => 2) }
|
37
|
-
|
37
|
+
|
38
38
|
its (:page) { should == 3 }
|
39
39
|
its (:per_page) { should == 2 }
|
40
40
|
end
|
data/spec/catalog/chart_spec.rb
CHANGED
@@ -14,24 +14,24 @@ module Beatport::Catalog
|
|
14
14
|
|
15
15
|
describe 'structure' do
|
16
16
|
subject { Chart.find(15722) }
|
17
|
-
|
17
|
+
|
18
18
|
it { should be_a(Chart) }
|
19
19
|
its (:id) { should == 15722 }
|
20
20
|
its (:type) { should == "chart" }
|
21
|
-
its (:name) { should == "Nitrous Oxide – April Top 10" }
|
21
|
+
its (:name) { should == "Nitrous Oxide – April Top 10" }
|
22
22
|
its (:slug) { should == "nitrous-oxide-april-top-10" }
|
23
23
|
its (:description) { should == "" }
|
24
24
|
its (:publish_date) { should == Date.new(2009, 05, 12) }
|
25
|
-
its (:'price.to_s') { should == '
|
26
|
-
its (:'audio_format_fee.wav.to_s') { should == "6.
|
27
|
-
its (:'audio_format_fee.aiff.to_s') { should == "6.
|
25
|
+
its (:'price.to_s') { should == '12.42' }
|
26
|
+
its (:'audio_format_fee.wav.to_s') { should == "6.00" }
|
27
|
+
its (:'audio_format_fee.aiff.to_s') { should == "6.00" }
|
28
28
|
specify { subject.genres.map(&:name).should == ["Trance"] }
|
29
29
|
its (:'images.small.url') { should == "http://geo-media.beatport.com/image/491534.jpg"}
|
30
30
|
its (:'images.medium.url') { should == "http://geo-media.beatport.com/image/412921.jpg"}
|
31
|
-
its (:'images.large.url') { should == "http://geo-media.beatport.com/image/412922.jpg"}
|
32
|
-
its (:'tracks.length') { should ==
|
31
|
+
its (:'images.large.url') { should == "http://geo-media.beatport.com/image/412922.jpg"}
|
32
|
+
its (:'tracks.length') { should == 8 }
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
describe '.find' do
|
36
36
|
context 'with a single id' do
|
37
37
|
subject { Chart.find(15722) }
|
@@ -55,64 +55,64 @@ module Beatport::Catalog
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
describe '.all' do
|
60
60
|
it "should get arbitrary charts" do
|
61
61
|
charts = Chart.all
|
62
62
|
charts.length.should == 10
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
it "should get the first page with 5 charts per page" do
|
66
66
|
charts = Chart.all :per_page => 5, :page => 1
|
67
67
|
charts.length.should == 5
|
68
68
|
charts.page.should == 1
|
69
69
|
charts.per_page.should == 5
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
72
|
it "should get the first page with 5 charts per page, sorted by publish date and chart id, for the House genre" do
|
73
73
|
charts = Chart.all(:sort_by=> ['publishDate asc', 'chartId asc'], :genre_id=> 5, :per_page=>5, :page=>1)
|
74
74
|
charts.length.should == 5
|
75
|
-
|
75
|
+
|
76
76
|
old_id = nil
|
77
77
|
old_date = charts.first.publish_date
|
78
|
-
|
78
|
+
|
79
79
|
charts.each do |chart|
|
80
80
|
old_id = nil if old_date.to_s != chart.publish_date.to_s
|
81
|
-
|
81
|
+
|
82
82
|
# it's possible that the genre is a subgenre of house, so we'll disable this test for now
|
83
83
|
# chart.genres.map(&:id).should include(5)
|
84
84
|
chart.id.should be >= old_id if old_id
|
85
85
|
chart.publish_date.should be >= old_date if old_date
|
86
|
-
|
86
|
+
|
87
87
|
old_id = chart.id
|
88
88
|
old_date = chart.publish_date
|
89
89
|
end
|
90
90
|
end
|
91
|
-
|
91
|
+
|
92
92
|
it "should get arbitrary charts with filter metadata for all genre names and artist names" do
|
93
93
|
charts = Chart.all :return_facets => ['genre_name', 'performer_name']
|
94
|
-
|
94
|
+
|
95
95
|
# despite what the beatport api doc says, the query deoesn't return any performer names...
|
96
96
|
# charts.facets['fields']['performer_name'].count.should be > 1
|
97
|
-
charts.facets['fields']['genre_name'].count.should be > 1
|
97
|
+
charts.facets['fields']['genre_name'].count.should be > 1
|
98
98
|
end
|
99
99
|
|
100
100
|
it "should get all charts for trance and progressive house" do
|
101
101
|
charts = Chart.all :facets => {:genre_name => ['Trance', 'Progessive House']}
|
102
|
-
|
102
|
+
|
103
103
|
charts.each do |chart|
|
104
104
|
genres = chart['genres'].map { |a| a['name'] }
|
105
105
|
pp genres
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
109
|
-
|
109
|
+
|
110
110
|
describe '.featured' do
|
111
111
|
it "should get the featured charts for the Home page" do
|
112
112
|
charts = Chart.featured
|
113
113
|
charts.length.should be > 1
|
114
114
|
end
|
115
|
-
|
115
|
+
|
116
116
|
it "should get the featured charts for the Trance page" do
|
117
117
|
charts = Chart.featured :genre_id => 7
|
118
118
|
charts.length.should be > 1
|
data/spec/catalog/genre_spec.rb
CHANGED
@@ -13,7 +13,7 @@ module Beatport::Catalog
|
|
13
13
|
|
14
14
|
describe "structure" do
|
15
15
|
subject { Genre.find(7) }
|
16
|
-
|
16
|
+
|
17
17
|
it { should be_a(Genre) }
|
18
18
|
its (:name) { should == "Trance" }
|
19
19
|
its (:slug) { should == "trance" }
|
@@ -33,7 +33,7 @@ module Beatport::Catalog
|
|
33
33
|
end
|
34
34
|
=end
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
describe '.find' do
|
38
38
|
it "should retrieve information about the trance genre via its id" do
|
39
39
|
Genre.find(7).name.should == "Trance"
|
@@ -56,7 +56,7 @@ module Beatport::Catalog
|
|
56
56
|
genre.should be nil
|
57
57
|
end
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
describe '.all' do
|
61
61
|
it "should retrieve all genres" do
|
62
62
|
genres = Genre.all
|
@@ -64,27 +64,27 @@ module Beatport::Catalog
|
|
64
64
|
genres.length.should == genres.count
|
65
65
|
genres.length.should == genres.per_page
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
68
|
it "should retrieve genres with their subgenres" do
|
69
69
|
genres = Genre.all(:subgenres => true)
|
70
70
|
genres.first.subgenres.length.should be > 1
|
71
71
|
end
|
72
72
|
end
|
73
|
-
|
73
|
+
|
74
74
|
describe '.overview' do
|
75
75
|
it "should retrieve an overview" do
|
76
|
-
|
76
|
+
skip "deprecated?"
|
77
77
|
|
78
78
|
overview = Genre.overview
|
79
79
|
overview.length.should be > 0
|
80
80
|
overview.each do |genre|
|
81
81
|
genre.counts.releases.should be > 0
|
82
|
-
|
82
|
+
|
83
83
|
# This fails for glitch hop?
|
84
84
|
# genre.list.items.length.should == 3
|
85
85
|
end
|
86
86
|
end
|
87
|
-
|
87
|
+
|
88
88
|
end
|
89
89
|
|
90
90
|
describe '#top_downloads' do
|
@@ -93,15 +93,15 @@ module Beatport::Catalog
|
|
93
93
|
genre.top_downloads.length.should == 10
|
94
94
|
end
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
describe '#slideshow' do
|
98
98
|
it "should return the slideshow of a genre loaded via find" do
|
99
|
-
|
99
|
+
skip "deprecated?"
|
100
100
|
|
101
101
|
genre = Genre.find(7)
|
102
102
|
genre.slideshow.header.length.should be > 1
|
103
103
|
end
|
104
|
-
end
|
104
|
+
end
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
data/spec/catalog/home_spec.rb
CHANGED
@@ -3,10 +3,10 @@ require 'spec_helper'
|
|
3
3
|
module Beatport::Catalog
|
4
4
|
describe Home do
|
5
5
|
describe '.get' do
|
6
|
-
|
6
|
+
skip "deprecated?"
|
7
7
|
|
8
8
|
subject { Home.get }
|
9
|
-
|
9
|
+
|
10
10
|
#it { should be_a(Home) }
|
11
11
|
#its (:'slideshow.header.length') { should be >= 1 }
|
12
12
|
#its (:'slideshow.feature.length') { should be > 1 }
|
data/spec/catalog/label_spec.rb
CHANGED
@@ -19,7 +19,7 @@ module Beatport::Catalog
|
|
19
19
|
its (:name) { should == "Anjunadeep" }
|
20
20
|
its (:slug) { should == "anjunadeep" }
|
21
21
|
its (:url) { should == "http://www.beatport.com/label/anjunadeep/1390" }
|
22
|
-
|
22
|
+
skip "source type is no longer returned?"
|
23
23
|
#its (:source_type) { should == ["store", "mobile", "sushi"] }
|
24
24
|
|
25
25
|
its (:last_publish_date) { should > Date.new(2012, 9, 10) }
|
@@ -106,14 +106,14 @@ module Beatport::Catalog
|
|
106
106
|
|
107
107
|
describe '.featured' do
|
108
108
|
it "should get the featured labels for the Home page" do
|
109
|
-
|
109
|
+
skip "deprecated?"
|
110
110
|
|
111
111
|
labels = Label.featured
|
112
112
|
labels.length.should be > 1
|
113
113
|
end
|
114
114
|
|
115
115
|
it "should get the featured labels for the Trance page" do
|
116
|
-
|
116
|
+
skip "deprecated?"
|
117
117
|
|
118
118
|
labels = Label.featured :genre_id => 7
|
119
119
|
labels.length.should be > 1
|
@@ -33,7 +33,7 @@ module Beatport::Catalog
|
|
33
33
|
its (:'label.id') { should == 804 }
|
34
34
|
specify { subject.artists.map(&:name).should include("Paul Keeley") }
|
35
35
|
specify { subject.genres.map(&:name).sort.should == ["Progressive House", "Trance"] }
|
36
|
-
its (:'images.small.url') { should == "http://geo-media.beatport.com/image/
|
36
|
+
its (:'images.small.url') { should == "http://geo-media.beatport.com/image/392700.jpg" }
|
37
37
|
its (:'images.medium.url') { should == "http://geo-media.beatport.com/image/392700.jpg" }
|
38
38
|
its (:'images.large.url') { should == "http://geo-media.beatport.com/image/392701.jpg" }
|
39
39
|
its (:'discount.to_s') { should == "33.22" }
|
@@ -122,7 +122,7 @@ module Beatport::Catalog
|
|
122
122
|
end
|
123
123
|
|
124
124
|
it "should not give the same releases with justAdded true and false" do
|
125
|
-
|
125
|
+
skip "test will not give consistent results, revisit"
|
126
126
|
|
127
127
|
featured = Release.featured :genre_id => 7
|
128
128
|
just_added = Release.featured :genre_id => 7, :just_added => true
|
data/spec/catalog/slide_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module Beatport::Catalog
|
4
4
|
describe Slide do
|
5
|
-
|
5
|
+
skip "deprecated?"
|
6
6
|
|
7
7
|
=begin
|
8
8
|
describe '.header' do
|
@@ -10,7 +10,7 @@ module Beatport::Catalog
|
|
10
10
|
slides = Slide.header
|
11
11
|
slides.length.should be >= 1
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
it "should get the headers slides for the trance page" do
|
15
15
|
slides = Slide.header
|
16
16
|
slides.length.should be >= 1
|
@@ -22,7 +22,7 @@ module Beatport::Catalog
|
|
22
22
|
slides = Slide.feature
|
23
23
|
slides.length.should be > 1
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
it "should get the feature slides for the trance page" do
|
27
27
|
slides = Slide.feature
|
28
28
|
slides.length.should be > 1
|
@@ -34,7 +34,7 @@ module Beatport::Catalog
|
|
34
34
|
slides = Slide.small
|
35
35
|
slides.length.should be > 1
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
it "should get the small slides for the trance page" do
|
39
39
|
slides = Slide.small
|
40
40
|
slides.length.should be > 1
|
@@ -43,7 +43,6 @@ module Beatport::Catalog
|
|
43
43
|
=end
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
|
47
|
+
|
48
|
+
|
data/spec/catalog/track_spec.rb
CHANGED
@@ -12,7 +12,7 @@ module Beatport::Catalog
|
|
12
12
|
|
13
13
|
describe 'lazy loading' do
|
14
14
|
it "should lazy load artists" do
|
15
|
-
|
15
|
+
skip "Not implemented yet"
|
16
16
|
track = Track.all(:per_page => 1, :page => 1).first
|
17
17
|
end
|
18
18
|
end
|
@@ -31,7 +31,7 @@ module Beatport::Catalog
|
|
31
31
|
its (:publish_date) { should == Date.new(2010,05,17) }
|
32
32
|
#its (:sample_url) { should == 'http://geo-samples.beatport.com/lofi/1217790.LOFI.mp3' }
|
33
33
|
#its (:rtmp_stream_url) { should == 'rtmp://geo-rtmp-samples.beatport.com/beatport/_definst_/mp3:lofi_samples/items/volumes/volume7/items/1000000/200000/10000/7000/700/90/1217790.LOFI'}
|
34
|
-
its (:exclusive) { should
|
34
|
+
its (:exclusive) { should be false }
|
35
35
|
its (:url) { should == "http://www.beatport.com/track/tonight-ims-anthem-2009-above-and-beyond-remix/1217790" }
|
36
36
|
its (:'price.to_s') { should == "1.49" }
|
37
37
|
its (:'audio_format_fee.wav.to_s') { should == "0.75" }
|
data/spec/spec_helper.rb
CHANGED
@@ -10,26 +10,31 @@ end
|
|
10
10
|
|
11
11
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
12
12
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
13
|
+
|
14
|
+
require 'rspec/its'
|
13
15
|
require 'beatport'
|
14
16
|
require 'pp'
|
15
17
|
require 'log_buddy'
|
16
18
|
require 'vcr'
|
17
19
|
require 'config'
|
18
20
|
|
21
|
+
I18n.enforce_available_locales = false
|
19
22
|
|
20
23
|
VCR.configure do |c|
|
21
24
|
c.cassette_library_dir = 'spec/fixtures'
|
22
25
|
c.hook_into :webmock
|
23
26
|
c.allow_http_connections_when_no_cassette = false
|
24
27
|
c.default_cassette_options = {
|
25
|
-
:allow_playback_repeats => true,
|
26
|
-
:record => :new_episodes,
|
28
|
+
:allow_playback_repeats => true,
|
29
|
+
:record => :new_episodes,
|
27
30
|
:re_record_interval => 604800
|
28
31
|
}
|
29
32
|
end
|
30
33
|
|
31
34
|
RSpec.configure do |config|
|
32
|
-
|
35
|
+
config.expect_with :rspec do |c|
|
36
|
+
c.syntax = [:should, :expect]
|
37
|
+
end
|
33
38
|
# some (optional) config here
|
34
39
|
end
|
35
40
|
|
metadata
CHANGED
@@ -1,190 +1,181 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beatport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Mateo Murphy
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-01-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: addressable
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: signet
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: faraday
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 0.8.8
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: 0.8.8
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: money
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: 5.1.1
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: 5.1.1
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: bundler
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: webmock
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: jeweler
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - ">="
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: '0'
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: log_buddy
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - ">="
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: '0'
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- -
|
122
|
+
- - ">="
|
140
123
|
- !ruby/object:Gem::Version
|
141
124
|
version: '0'
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: rspec
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
|
-
- -
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '3.0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '3.0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec-its
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
148
144
|
- !ruby/object:Gem::Version
|
149
145
|
version: '0'
|
150
146
|
type: :development
|
151
147
|
prerelease: false
|
152
148
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
149
|
requirements:
|
155
|
-
- -
|
150
|
+
- - ">="
|
156
151
|
- !ruby/object:Gem::Version
|
157
152
|
version: '0'
|
158
153
|
- !ruby/object:Gem::Dependency
|
159
154
|
name: yard
|
160
155
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
156
|
requirements:
|
163
|
-
- -
|
157
|
+
- - ">="
|
164
158
|
- !ruby/object:Gem::Version
|
165
159
|
version: '0'
|
166
160
|
type: :development
|
167
161
|
prerelease: false
|
168
162
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
163
|
requirements:
|
171
|
-
- -
|
164
|
+
- - ">="
|
172
165
|
- !ruby/object:Gem::Version
|
173
166
|
version: '0'
|
174
167
|
- !ruby/object:Gem::Dependency
|
175
168
|
name: vcr
|
176
169
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
170
|
requirements:
|
179
|
-
- -
|
171
|
+
- - ">="
|
180
172
|
- !ruby/object:Gem::Version
|
181
173
|
version: '0'
|
182
174
|
type: :development
|
183
175
|
prerelease: false
|
184
176
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
177
|
requirements:
|
187
|
-
- -
|
178
|
+
- - ">="
|
188
179
|
- !ruby/object:Gem::Version
|
189
180
|
version: '0'
|
190
181
|
description: A ruby gem for accessing the beatport api
|
@@ -195,8 +186,8 @@ extra_rdoc_files:
|
|
195
186
|
- LICENSE.txt
|
196
187
|
- README.md
|
197
188
|
files:
|
198
|
-
- .document
|
199
|
-
- .rspec
|
189
|
+
- ".document"
|
190
|
+
- ".rspec"
|
200
191
|
- Gemfile
|
201
192
|
- LICENSE.txt
|
202
193
|
- README.md
|
@@ -278,29 +269,25 @@ files:
|
|
278
269
|
homepage: http://github.com/mateomurphy/beatport
|
279
270
|
licenses:
|
280
271
|
- MIT
|
272
|
+
metadata: {}
|
281
273
|
post_install_message:
|
282
274
|
rdoc_options: []
|
283
275
|
require_paths:
|
284
276
|
- lib
|
285
277
|
required_ruby_version: !ruby/object:Gem::Requirement
|
286
|
-
none: false
|
287
278
|
requirements:
|
288
|
-
- -
|
279
|
+
- - ">="
|
289
280
|
- !ruby/object:Gem::Version
|
290
281
|
version: '0'
|
291
|
-
segments:
|
292
|
-
- 0
|
293
|
-
hash: 746907513197344592
|
294
282
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
295
|
-
none: false
|
296
283
|
requirements:
|
297
|
-
- -
|
284
|
+
- - ">="
|
298
285
|
- !ruby/object:Gem::Version
|
299
286
|
version: '0'
|
300
287
|
requirements: []
|
301
288
|
rubyforge_project:
|
302
|
-
rubygems_version:
|
289
|
+
rubygems_version: 2.4.3
|
303
290
|
signing_key:
|
304
|
-
specification_version:
|
291
|
+
specification_version: 4
|
305
292
|
summary: ruby gem for accessing the beatport api
|
306
293
|
test_files: []
|