concert_calendar 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ ##
4
+ # Student Name: Matthew Anderson
5
+ # Homework Week: 9
6
+
7
+ require 'test/unit'
8
+ require 'mine_tunes.rb'
9
+ require 'concert_calendar.rb'
10
+
11
+ class TestConcertCalendar < Test::Unit::TestCase
12
+ def setup
13
+ @concert_calendar = ConcertCalendar.new
14
+ end
15
+
16
+ def test_initialize
17
+ assert ConcertCalendar.new
18
+ end
19
+ end
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ ##
4
+ # Student Name: Matthew Anderson
5
+ # Homework Week: 9
6
+
7
+ require 'test/unit'
8
+ require 'event.rb'
9
+
10
+ class TestEvent < Test::Unit::TestCase
11
+ def setup
12
+ @event = Event.new(:artists => ["Bloc Party", "Counting Crows", "Massive Attack"], :date => "9/6/2009", :venue_name => "First Avenue & 7th St Entry", :venue_city => "Minneapolis", :venue_state => "MN", :venue_zip => "55403")
13
+ end
14
+
15
+ def test_artists
16
+ expected = [
17
+ "Bloc Party",
18
+ "Counting Crows",
19
+ "Massive Attack"
20
+ ]
21
+
22
+ assert_equal expected, @event.artists
23
+ end
24
+
25
+ def test_date
26
+ assert_equal "9/6/2009", @event.date
27
+ end
28
+
29
+ def test_venue_name
30
+ assert_equal "First Avenue & 7th St Entry", @event.venue_name
31
+ end
32
+
33
+ def test_venue_city
34
+ assert_equal "Minneapolis", @event.venue_city
35
+ end
36
+
37
+ def test_venue_state
38
+ assert_equal "MN", @event.venue_state
39
+ end
40
+
41
+ def test_venue_zip
42
+ assert_equal "55403", @event.venue_zip
43
+ end
44
+ end
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ ##
4
+ # Student Name: Matthew Anderson
5
+ # Homework Week: 9
6
+
7
+ require 'test/unit'
8
+ require 'mine_concerts.rb'
9
+
10
+ class TestMineConcerts < Test::Unit::TestCase
11
+ CONCERTS = MineConcerts.new("98029", "./test/iTunes Music Library.xml")
12
+
13
+ def setup
14
+ @event = []
15
+ @event << Event.new(
16
+ :artists => ["Bloc Party", "Counting Crows", "Massive Attack"],
17
+ :date => "9/6/2009",
18
+ :venue_name => "First Avenue & 7th St Entry",
19
+ :venue_city => "Minneapolis",
20
+ :venue_state => "MN",
21
+ :venue_zip => "55403",
22
+ :url => "http://www.jambase.com/shows/"
23
+ )
24
+
25
+ @recommended_concerts = (CONCERTS.recommend_concerts @event).shift
26
+ end
27
+
28
+ def test_create_event
29
+ assert Event.new(
30
+ :artists => ["Bloc Party", "Counting Crows", "Massive Attack"],
31
+ :date => "9/6/2009",
32
+ :venue_name => "First Avenue & 7th St Entry",
33
+ :venue_city => "Minneapolis",
34
+ :venue_state => "MN",
35
+ :venue_zip => "55403",
36
+ :url => "http://www.jambase.com/shows/"
37
+ )
38
+ end
39
+
40
+ def test_recommended_concert_date
41
+ actual = @recommended_concerts.date
42
+
43
+ assert_equal "9/6/2009", actual
44
+ end
45
+
46
+ def test_recommended_concert_artist
47
+ actual = @recommended_concerts.artists
48
+ expected = [
49
+ "Bloc Party",
50
+ "Counting Crows",
51
+ "Massive Attack"
52
+ ]
53
+
54
+ assert_equal expected, actual
55
+ end
56
+
57
+ def test_recommended_concert_venue_name
58
+ actual = @recommended_concerts.venue_name
59
+
60
+ assert_equal "First Avenue & 7th St Entry", actual
61
+ end
62
+
63
+ def test_recommended_concert_venue_city
64
+ actual = @recommended_concerts.venue_city
65
+
66
+ assert_equal "Minneapolis", actual
67
+ end
68
+
69
+ def test_recommended_concert_venue_state
70
+ actual = @recommended_concerts.venue_state
71
+
72
+ assert_equal "MN", actual
73
+ end
74
+
75
+ def test_recommended_concert_venue_zip
76
+ actual = @recommended_concerts.venue_zip
77
+
78
+ assert_equal "55403", actual
79
+ end
80
+
81
+ def test_recommended_concert_url
82
+ actual = @recommended_concerts.url
83
+
84
+ assert_equal "http://www.jambase.com/shows/", actual
85
+ end
86
+ end
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ ##
4
+ # Student Name: Matthew Anderson
5
+ # Homework Week: 9
6
+
7
+ require 'test/unit'
8
+ require 'mine_tunes.rb'
9
+
10
+ class TestMineTunes < Test::Unit::TestCase
11
+ MINER = MineTunes.new("./test/iTunes Music Library.xml")
12
+
13
+ def test_create_track
14
+ assert Track.new(:track_id => "879", :name => "Banquet", :artist => "Bloc Party", :album => "Silent Alarm", :total_time => "200990")
15
+ end
16
+
17
+ def test_number_of_tracks
18
+ actual = MINER.number_of_tracks
19
+
20
+ assert_equal 1482, actual
21
+ end
22
+
23
+ def test_names_of_artists
24
+ actual = MINER.names_of_artists.first
25
+
26
+ assert_equal("Ray LaMontagne", actual)
27
+ end
28
+
29
+ def test_number_of_artists
30
+ actual = MINER.number_of_artists
31
+
32
+ assert_equal 302, actual
33
+ end
34
+
35
+ def test_number_of_albms
36
+ actual = MINER.number_of_albums
37
+
38
+ assert_equal 401, actual
39
+ end
40
+
41
+ def test_total_play_time
42
+ actual = MINER.total_play_time
43
+
44
+ assert_equal 391690853, actual
45
+ end
46
+
47
+ def test_most_played_tracks
48
+ actual = MINER.most_played_tracks 10
49
+ expected = [
50
+ "[15] Bloc Party - Like Eating Glass",
51
+ "[14] Bloc Party - Positive Tension",
52
+ "[13] Junior Boys - In the Morning",
53
+ "[13] Bloc Party - She's Hearing Voices",
54
+ "[13] The Chemical Brothers - Believe",
55
+ "[13] The Shins - Spilt Needles",
56
+ "[13] The Polish Ambassador - Infiltrating the UN",
57
+ "[12] Matt Pond PA - The Trees and the Wild",
58
+ "[12] Hood - Any Hopeful Thoughts Arrive",
59
+ "[12] Bloc Party - The Pioneers"
60
+ ]
61
+
62
+ assert_equal expected, actual
63
+ end
64
+
65
+ def test_most_recently_played_tracks
66
+ actual = MINER.most_recently_played_tracks 10
67
+ expected = [
68
+ "[Wed Dec 10 05:48:01 UTC 2008] Audi of America - Notes on Progress",
69
+ "[Wed Dec 10 02:18:40 UTC 2008] Stefano Bollani - Antonia",
70
+ "[Wed Dec 10 02:13:47 UTC 2008] The Tea Party - Pulse",
71
+ "[Wed Dec 10 02:09:37 UTC 2008] Regina Spektor - Hotel Song",
72
+ "[Wed Dec 10 02:06:09 UTC 2008] Jamiroquai - Time Won't Wait",
73
+ "[Wed Dec 10 02:01:06 UTC 2008] Orbital - Way Out",
74
+ "[Wed Dec 10 01:53:05 UTC 2008] Pete Yorn - June",
75
+ "[Wed Dec 10 01:50:31 UTC 2008] Matthew Good - Champions of Nothing",
76
+ "[Wed Dec 10 01:39:35 UTC 2008] Silverchair - Untitled",
77
+ "[Wed Dec 10 01:36:04 UTC 2008] Paul Oakenfold - Northsky (Blackwatch)"
78
+ ]
79
+
80
+ assert_equal expected, actual
81
+ end
82
+ end
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ ##
4
+ # Student Name: Matthew Anderson
5
+ # Homework Week: 9
6
+
7
+ require 'test/unit'
8
+ require 'track.rb'
9
+
10
+ class TestTrack < Test::Unit::TestCase
11
+ def setup
12
+ @track = Track.new(:track_id => "879", :name => "Banquet", :artist => "Bloc Party", :album => "Silent Alarm", :total_time => "200990")
13
+ end
14
+
15
+ def test_track_id
16
+ assert_equal "879", @track.track_id
17
+ end
18
+
19
+ def test_track_name
20
+ assert_equal "Banquet", @track.name
21
+ end
22
+
23
+ def test_track_artist
24
+ assert_equal "Bloc Party", @track.artist
25
+ end
26
+
27
+ def test_track_album
28
+ assert_equal "Silent Alarm", @track.album
29
+ end
30
+
31
+ def test_track_total_time
32
+ assert_equal "200990", @track.total_time
33
+ end
34
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: concert_calendar
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Matthew Anderson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-20 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: nokogiri
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: icalendar
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: hoe
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 1.8.2
44
+ version:
45
+ description: Create a personalized concert calendar and host it on your own server for subscription. First, this app parses your iTunes Music Library and retrieves a list of your artists. Second, it retrieves a list of local concerts in your area using your ZIP code. Third, it recommends the concerts you should attend by finding any concerts that include an artist found in your iTunes library. These recommended concerts are converted to iCal format and written to an .ics file. Lastly, the app uploads the .ics file to a server of your choice via FTP. Once hosted, you can subscribe to your personalized concert calendar using any modern calendar application. Rock on!
46
+ email:
47
+ - wandering.matt@gmail.com
48
+ executables:
49
+ - concert_calendar
50
+ extensions: []
51
+
52
+ extra_rdoc_files:
53
+ - History.txt
54
+ - Manifest.txt
55
+ - README.txt
56
+ files:
57
+ - History.txt
58
+ - Manifest.txt
59
+ - README.txt
60
+ - Rakefile
61
+ - bin/concert_calendar
62
+ - config/config.yml
63
+ - lib/concert_calendar.rb
64
+ - lib/event.rb
65
+ - lib/mine_concerts.rb
66
+ - lib/mine_tunes.rb
67
+ - lib/track.rb
68
+ - test/iTunes Music Library.xml
69
+ - test/test_concert_calendar.rb
70
+ - test/test_event.rb
71
+ - test/test_mine_concerts.rb
72
+ - test/test_mine_tunes.rb
73
+ - test/test_track.rb
74
+ has_rdoc: true
75
+ homepage: http://rubyforge.org/projects/uwruby
76
+ post_install_message:
77
+ rdoc_options:
78
+ - --main
79
+ - README.txt
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: "0"
87
+ version:
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: "0"
93
+ version:
94
+ requirements: []
95
+
96
+ rubyforge_project: uwruby
97
+ rubygems_version: 1.2.0
98
+ signing_key:
99
+ specification_version: 2
100
+ summary: Create a personalized concert calendar and host it on your own server for subscription
101
+ test_files:
102
+ - test/test_concert_calendar.rb
103
+ - test/test_event.rb
104
+ - test/test_mine_concerts.rb
105
+ - test/test_mine_tunes.rb
106
+ - test/test_track.rb