beatport 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/beatport.gemspec +3 -2
- data/lib/beatport.rb +9 -0
- data/spec/beatport_spec.rb +16 -0
- data/spec/catalog/artist_spec.rb +1 -1
- data/spec/spec_helper.rb +9 -0
- metadata +5 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/beatport.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{beatport}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mateo Murphy"]
|
12
|
-
s.date = %q{2011-12-
|
12
|
+
s.date = %q{2011-12-25}
|
13
13
|
s.description = %q{A ruby gem for accessing the beatport api}
|
14
14
|
s.email = %q{mateo.murphy@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -64,6 +64,7 @@ Gem::Specification.new do |s|
|
|
64
64
|
"lib/beatport/support/inflector.rb",
|
65
65
|
"lib/beatport/support/parser.rb",
|
66
66
|
"lib/beatport/support/query_builder.rb",
|
67
|
+
"spec/beatport_spec.rb",
|
67
68
|
"spec/catalog/account_type_spec.rb",
|
68
69
|
"spec/catalog/artist_spec.rb",
|
69
70
|
"spec/catalog/audio_format_spec.rb",
|
data/lib/beatport.rb
CHANGED
@@ -10,4 +10,13 @@ module Beatport
|
|
10
10
|
autoload :Item, 'beatport/item'
|
11
11
|
autoload :Price, 'beatport/price'
|
12
12
|
autoload :Support, 'beatport/support'
|
13
|
+
|
14
|
+
def self.const_missing(name)
|
15
|
+
if Beatport::Catalog.const_defined?(name)
|
16
|
+
$stderr << "Beatport::#{name} has moved to Beatport::Catalog::#{name}, please ajust your code accordingly"
|
17
|
+
Beatport::Catalog.const_get(name)
|
18
|
+
else
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
13
22
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Beatport do
|
4
|
+
describe '.const_missing' do
|
5
|
+
it "returns the constant within Catalog if it exists there" do
|
6
|
+
silence_stream($stderr) do
|
7
|
+
track = Beatport::Track.new
|
8
|
+
track.should be_a(Beatport::Catalog::Track)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "raises an NameError if the constant doesn't exist with Catalog" do
|
13
|
+
lambda { Beatport::Foo.new }.should raise_error(NameError, "uninitialized constant Beatport::Foo")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/spec/catalog/artist_spec.rb
CHANGED
@@ -10,7 +10,7 @@ module Beatport::Catalog
|
|
10
10
|
its (:type) { should == "artist" }
|
11
11
|
its (:name) { should == "Above & Beyond" }
|
12
12
|
its (:slug) { should == "above-and-beyond" }
|
13
|
-
its (:last_publish_date) { should
|
13
|
+
its (:last_publish_date) { should >= Date.new(2011, 12, 15)}
|
14
14
|
its (:biography) { should == "" }
|
15
15
|
its (:'genres.length') { should be > 1 }
|
16
16
|
its (:'sub_genres.length') { should be > 1 }
|
data/spec/spec_helper.rb
CHANGED
@@ -16,4 +16,13 @@ require 'log_buddy'
|
|
16
16
|
|
17
17
|
RSpec.configure do |config|
|
18
18
|
# some (optional) config here
|
19
|
+
end
|
20
|
+
|
21
|
+
def silence_stream(stream)
|
22
|
+
old_stream = stream.dup
|
23
|
+
stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
|
24
|
+
stream.sync = true
|
25
|
+
yield
|
26
|
+
ensure
|
27
|
+
stream.reopen(old_stream)
|
19
28
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beatport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mateo Murphy
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-12-
|
18
|
+
date: 2011-12-25 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- lib/beatport/support/inflector.rb
|
192
192
|
- lib/beatport/support/parser.rb
|
193
193
|
- lib/beatport/support/query_builder.rb
|
194
|
+
- spec/beatport_spec.rb
|
194
195
|
- spec/catalog/account_type_spec.rb
|
195
196
|
- spec/catalog/artist_spec.rb
|
196
197
|
- spec/catalog/audio_format_spec.rb
|