metallum 0.2.3 → 0.2.4
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.
- data/.rvmrc +1 -1
- data/CHANGELOG +13 -5
- data/lib/metallum/band.rb +1 -1
- data/lib/metallum/metallum.rb +6 -3
- data/lib/metallum/version.rb +1 -1
- data/spec/metallum/album_spec.rb +30 -26
- data/spec/metallum/band_spec.rb +4 -4
- metadata +32 -37
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use 1.9.
|
1
|
+
rvm use 1.9.3
|
data/CHANGELOG
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
|
1
|
+
13.04.2011
|
2
2
|
----------
|
3
3
|
Peco Danajlovski <vortexmk@gmail.com>
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
* Version bump to 0.1.0
|
4
|
+
* Fixed some bugs
|
5
|
+
* Updated the specs
|
6
|
+
* Version bump to 0.2.4
|
8
7
|
|
9
8
|
10.09.2011
|
10
9
|
----------
|
@@ -15,3 +14,12 @@ Peco Danajlovski <vortexmk@gmail.com>
|
|
15
14
|
* Moved Band and Album under Metallum namespace
|
16
15
|
* Fixed gem dependencies
|
17
16
|
* Version bump to 0.2.3
|
17
|
+
|
18
|
+
09.09.2011
|
19
|
+
----------
|
20
|
+
Peco Danajlovski <vortexmk@gmail.com>
|
21
|
+
* Started this CHANGELOG
|
22
|
+
* Introduced guard for automatic testing
|
23
|
+
* Implemented fetching basic band info
|
24
|
+
* Version bump to 0.1.0
|
25
|
+
|
data/lib/metallum/band.rb
CHANGED
data/lib/metallum/metallum.rb
CHANGED
@@ -8,12 +8,15 @@ module Metallum
|
|
8
8
|
@agent = Mechanize.new
|
9
9
|
@page = @agent.get(url)
|
10
10
|
@discography = @agent.get("http://www.metal-archives.com/band/discography/id/#{extract_band_id}/tab/all")
|
11
|
+
rescue
|
12
|
+
# TODO: PD: Code smell
|
13
|
+
# Do nothing
|
11
14
|
end
|
12
15
|
|
13
16
|
def fetch_band
|
14
|
-
band = Band.new(@page, @discography)
|
17
|
+
band = Band.new(@page, @discography)
|
15
18
|
end
|
16
|
-
|
19
|
+
|
17
20
|
def fetch_album
|
18
21
|
album = Album.new(@page)
|
19
22
|
end
|
@@ -21,7 +24,7 @@ module Metallum
|
|
21
24
|
def extract_band_id
|
22
25
|
@page.uri.to_s.match(/\/(\d+)/)[1]
|
23
26
|
end
|
24
|
-
|
27
|
+
|
25
28
|
end
|
26
29
|
|
27
30
|
end
|
data/lib/metallum/version.rb
CHANGED
data/spec/metallum/album_spec.rb
CHANGED
@@ -2,44 +2,48 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe "Album" do
|
4
4
|
|
5
|
-
before(:
|
5
|
+
before(:all) do
|
6
6
|
@album_url = "http://www.metal-archives.com/albums/Dream_Theater/A_Dramatic_Turn_of_Events/309671"
|
7
7
|
@agent = Metallum::Agent.new(@album_url)
|
8
8
|
@album = @agent.fetch_album
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
@album.title.should == "A Dramatic Turn of Events"
|
13
|
-
end
|
11
|
+
context "album info" do
|
14
12
|
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
it "should fetch the title of the album" do
|
14
|
+
@album.title.should == "A Dramatic Turn of Events"
|
15
|
+
end
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
it "should fetch the name of the band" do
|
18
|
+
@album.band_name.should == "Dream Theater"
|
19
|
+
end
|
22
20
|
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
it "should fetch the type of the album" do
|
22
|
+
@album.album_type.should == "Full-length"
|
23
|
+
end
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
it "should fetch the release date" do
|
26
|
+
@album.release_date.should == "September 13th, 2011"
|
27
|
+
end
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
it "should fetch the record label" do
|
30
|
+
@album.record_label.should == "Roadrunner Records"
|
31
|
+
end
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
it "should fetch track list" do
|
34
|
+
@album.track_list.size == 9
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should fetch track titles" do
|
38
|
+
@album.track_list[0].title.should == "On the Backs of Angels"
|
39
|
+
@album.track_list[8].title.should == "Beneath the Surface"
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should fetch the track length" do
|
43
|
+
@album.track_list[3].duration.should == "06:57"
|
44
|
+
@album.track_list[6].duration.should == "03:56"
|
45
|
+
end
|
39
46
|
|
40
|
-
it "should fetch the track length" do
|
41
|
-
@album.track_list[3].duration.should == "06:57"
|
42
|
-
@album.track_list[6].duration.should == "03:56"
|
43
47
|
end
|
44
48
|
|
45
49
|
end
|
data/spec/metallum/band_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe "Band" do
|
4
4
|
|
5
|
-
before(:
|
5
|
+
before(:all) do
|
6
6
|
@band_url = 'http://www.metal-archives.com/bands/Blind_Guardian/3'
|
7
7
|
@agent = Metallum::Agent.new(@band_url)
|
8
8
|
@band = @agent.fetch_band
|
@@ -14,7 +14,7 @@ describe "Band" do
|
|
14
14
|
band = @agent.fetch_band
|
15
15
|
band.name.should == "Hell"
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
it "should fetch the band's name from url for band 'Blind Guardian'" do
|
19
19
|
@band.name.should == "Blind Guardian"
|
20
20
|
end
|
@@ -44,11 +44,11 @@ describe "Band" do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should fetch band's record label" do
|
47
|
-
@band.record_label.should == "Nuclear Blast
|
47
|
+
@band.record_label.should == "Nuclear Blast"
|
48
48
|
end
|
49
49
|
|
50
50
|
it "should fetch band's photo url" do
|
51
|
-
@band.photo_url.should == "http://www.metal-archives.com/images/3/3_photo.jpg"
|
51
|
+
@band.photo_url.should == "http://www.metal-archives.com/images/3/3_photo.jpg?1846"
|
52
52
|
end
|
53
53
|
|
54
54
|
it "should fetch band's logo url" do
|
metadata
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: metallum
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.4
|
4
5
|
prerelease:
|
5
|
-
version: 0.2.3
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Peco Danajlovski
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-04-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: mechanize
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
18
|
+
requirements:
|
22
19
|
- - ~>
|
23
|
-
- !ruby/object:Gem::Version
|
20
|
+
- !ruby/object:Gem::Version
|
24
21
|
version: 2.0.1
|
25
22
|
type: :runtime
|
26
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.0.1
|
27
30
|
description: Metallum is a simple gem that fetches various data from metal-archives.com
|
28
|
-
email:
|
31
|
+
email:
|
29
32
|
- vortexmk@gmail.com
|
30
33
|
executables: []
|
31
|
-
|
32
34
|
extensions: []
|
33
|
-
|
34
35
|
extra_rdoc_files: []
|
35
|
-
|
36
|
-
files:
|
36
|
+
files:
|
37
37
|
- .gitignore
|
38
38
|
- .rspec
|
39
39
|
- .rvmrc
|
@@ -51,33 +51,28 @@ files:
|
|
51
51
|
- spec/metallum/band_spec.rb
|
52
52
|
- spec/metallum/metallum_spec.rb
|
53
53
|
- spec/spec_helper.rb
|
54
|
-
|
55
|
-
homepage: ""
|
54
|
+
homepage: ''
|
56
55
|
licenses: []
|
57
|
-
|
58
56
|
post_install_message:
|
59
57
|
rdoc_options: []
|
60
|
-
|
61
|
-
require_paths:
|
58
|
+
require_paths:
|
62
59
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
61
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version:
|
69
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
67
|
none: false
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version:
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
75
72
|
requirements: []
|
76
|
-
|
77
73
|
rubyforge_project: metallum
|
78
|
-
rubygems_version: 1.
|
74
|
+
rubygems_version: 1.8.19
|
79
75
|
signing_key:
|
80
76
|
specification_version: 3
|
81
77
|
summary: Metallum is a simple gem that fetches various data from metal-archives.com
|
82
78
|
test_files: []
|
83
|
-
|