jimmy_jukebox 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/LICENSE.txt +340 -0
  2. data/bin/jload_jukebox +29 -0
  3. data/bin/jplay_jukebox +49 -0
  4. data/bin/load_jukebox +29 -0
  5. data/bin/play_jukebox +49 -0
  6. data/lib/jimmy_jukebox/artists.rb +45 -0
  7. data/lib/jimmy_jukebox/song_loader.rb +119 -0
  8. data/lib/jimmy_jukebox/songs/ArtTatum.yml +169 -0
  9. data/lib/jimmy_jukebox/songs/ArtieShaw.yml +581 -0
  10. data/lib/jimmy_jukebox/songs/BennieMoten.yml +108 -0
  11. data/lib/jimmy_jukebox/songs/BennyGoodman.yml +402 -0
  12. data/lib/jimmy_jukebox/songs/BillieHoliday.yml +64 -0
  13. data/lib/jimmy_jukebox/songs/BixBeiderbecke.yml +96 -0
  14. data/lib/jimmy_jukebox/songs/CharlieChristian.yml +9 -0
  15. data/lib/jimmy_jukebox/songs/CharlieParker.yml +33 -0
  16. data/lib/jimmy_jukebox/songs/ColemanHawkins.yml +17 -0
  17. data/lib/jimmy_jukebox/songs/CountBasie.yml +45 -0
  18. data/lib/jimmy_jukebox/songs/DizzyGillespie.yml +4 -0
  19. data/lib/jimmy_jukebox/songs/DjangoReinhardt.yml +76 -0
  20. data/lib/jimmy_jukebox/songs/DukeEllington.yml +159 -0
  21. data/lib/jimmy_jukebox/songs/EarlHines.yml +99 -0
  22. data/lib/jimmy_jukebox/songs/FletcherHenderson.yml +159 -0
  23. data/lib/jimmy_jukebox/songs/JamesPJohnson.yml +9 -0
  24. data/lib/jimmy_jukebox/songs/JellyRollMorton.yml +90 -0
  25. data/lib/jimmy_jukebox/songs/KingOliver.yml +61 -0
  26. data/lib/jimmy_jukebox/songs/LionelHampton.yml +149 -0
  27. data/lib/jimmy_jukebox/songs/LouisArmstrong.yml +151 -0
  28. data/lib/jimmy_jukebox/songs/MilesDavis.yml +9 -0
  29. data/lib/jimmy_jukebox/songs/OriginalDixielandJazzBand.yml +46 -0
  30. data/lib/jimmy_jukebox/songs/RedNorvo.yml +40 -0
  31. data/lib/jimmy_jukebox/songs/SidneyBechet.yml +26 -0
  32. data/lib/jimmy_jukebox/user_config.rb +202 -0
  33. data/lib/jimmy_jukebox/version.rb +3 -0
  34. data/lib/jimmy_jukebox.rb +120 -0
  35. data/roadmap.txt +20 -0
  36. data/spec/jimmy_jukebox_spec.rb +161 -0
  37. data/spec/song_loader_spec.rb +190 -0
  38. data/spec/spec_helper.rb +5 -0
  39. data/spec/user_config_spec.rb +148 -0
  40. metadata +192 -0
@@ -0,0 +1,5 @@
1
+ RSpec.configure do |config|
2
+ config.before(:suite) do
3
+ ARGV.clear
4
+ end
5
+ end
@@ -0,0 +1,148 @@
1
+ require 'spec_helper'
2
+ require 'fakefs/safe'
3
+ require File.dirname(__FILE__) + '/../lib/jimmy_jukebox/user_config'
4
+ include JimmyJukebox
5
+
6
+ describe UserConfig do
7
+
8
+ before(:all) do
9
+ #ARGV.delete_if { |val| true }
10
+ ARGV.clear
11
+ #ARGV.pop
12
+ end
13
+
14
+ #describe "#configure_preferences" do
15
+ # context "when configuration file does not exist" do
16
+ # config_path = File.expand_path(File.join("~",".jimmy_jukebox","configuration"))
17
+ # FakeFS do
18
+ # File.exist?(config_path).should be_false
19
+ # end
20
+ # end
21
+ #end
22
+
23
+ #describe "#set_default_mp3_dir" do
24
+ #
25
+ #
26
+ #end
27
+
28
+ describe "#top_music_dir" do
29
+
30
+ it "should parse '~/Music'" do
31
+ UserConfig.top_music_dir("~/Music").should == "/home/james/Music"
32
+ end
33
+
34
+ it "should parse '/home/james/Music'" do
35
+ UserConfig.top_music_dir("/home/james/Music").should == "/home/james/Music"
36
+ end
37
+
38
+ it "should parse '~/Music/Rock/The_Eagles/hotel_california.mp3'" do
39
+ UserConfig.top_music_dir("~/Music/Rock/The_Eagles/hotel_california.mp3").should == "/home/james/Music"
40
+ end
41
+
42
+ it "should parse '~/Music/Rock/The Eagles/Hotel California.mp3'" do
43
+ UserConfig.top_music_dir("~/Music/Rock/The Eagles/Hotel California.mp3").should == "/home/james/Music"
44
+ end
45
+
46
+ it "should parse '~/My Music'" do
47
+ UserConfig.top_music_dir("~/My Music").should == "/home/james/My Music"
48
+ end
49
+
50
+ end
51
+
52
+ context "with no command line parameter" do
53
+
54
+ before(:each) do
55
+ ARGV.delete_if { |val| true }
56
+ end
57
+
58
+ it "does not complain when ogg123 & mpg123 both installed" do
59
+ uc = UserConfig.new
60
+ uc.should_receive(:`).with("which ogg123").and_return("/usr/bin/ogg123")
61
+ uc.should_receive(:`).with("which mpg123").and_return("/usr/bin/mpg123")
62
+ uc.should_not_receive(:puts)
63
+ uc.send(:set_music_players)
64
+ uc.instance_variable_get(:@ogg_player).should == "ogg123"
65
+ uc.instance_variable_get(:@mp3_player).should == "mpg123"
66
+ end
67
+
68
+ it "does not complain when ogg123 & mpg321 both installed but not mpg123" do
69
+ uc = UserConfig.new
70
+ uc.should_receive(:`).with("which ogg123").and_return("/usr/bin/ogg123")
71
+ uc.should_receive(:`).with("which mpg123").and_return("")
72
+ uc.should_receive(:`).with("which mpg321").and_return("/usr/bin/mpg321")
73
+ uc.should_not_receive(:puts)
74
+ uc.send(:set_music_players)
75
+ uc.instance_variable_get(:@ogg_player).should == "ogg123"
76
+ uc.instance_variable_get(:@mp3_player).should == "mpg321"
77
+ end
78
+
79
+ it "complains when ogg123 installed but mpg123, mpg321, music123, afplay & play not installed" do
80
+ uc = UserConfig.new
81
+ uc.instance_variable_set(:@ogg_player, nil)
82
+ uc.instance_variable_set(:@mp3_player, nil)
83
+ uc.should_receive(:`).at_least(:once).with("which ogg123").and_return("/usr/bin/ogg123")
84
+ uc.should_receive(:`).at_least(:once).with("which mpg123").and_return("")
85
+ uc.should_receive(:`).at_least(:once).with("which mpg321").and_return("")
86
+ uc.should_receive(:`).at_least(:once).with("which music123").and_return("")
87
+ uc.should_receive(:`).at_least(:once).with("which afplay").and_return("")
88
+ uc.should_receive(:`).at_least(:once).with("which mplayer").and_return("")
89
+ uc.should_receive(:`).at_least(:once).with("which play").and_return("")
90
+ uc.should_receive(:puts).with("*** YOU CANNOT PLAY MP3S -- YOU MIGHT WANT TO INSTALL MPG123 OR MPG321 ***")
91
+ uc.send(:set_music_players)
92
+ uc.instance_variable_get(:@ogg_player).should == "ogg123"
93
+ uc.instance_variable_get(:@mp3_player).should be_false
94
+ end
95
+
96
+ it "complains when mpg123 installed but ogg123, mpg321, music123, afplay & play not installed" do
97
+ uc = UserConfig.new
98
+ uc.instance_variable_set(:@ogg_player, nil)
99
+ uc.instance_variable_set(:@mp3_player, nil)
100
+ uc.should_receive(:`).at_least(:once).with("which ogg123").and_return("")
101
+ uc.should_receive(:`).at_least(:once).with("which music123").and_return("")
102
+ uc.should_receive(:`).at_least(:once).with("which mpg123").and_return("/usr/bin/mpg123")
103
+ uc.should_receive(:`).at_least(:once).with("which afplay").and_return("")
104
+ uc.should_receive(:`).at_least(:once).with("which mplayer").and_return("")
105
+ uc.should_receive(:`).at_least(:once).with("which play").and_return("")
106
+ uc.should_receive(:puts).with("*** YOU CANNOT PLAY OGG FILES -- YOU MIGHT WANT TO INSTALL OGG123 ***")
107
+ uc.send(:set_music_players)
108
+ uc.instance_variable_get(:@ogg_player).should be_false
109
+ uc.instance_variable_get(:@mp3_player).should == "mpg123"
110
+ end
111
+
112
+ it "complains when mpg321 installed but mpg123, music123, ogg123, afplay & play not installed" do
113
+ uc = UserConfig.new
114
+ uc.instance_variable_set(:@ogg_player, nil)
115
+ uc.instance_variable_set(:@mp3_player, nil)
116
+ uc.should_receive(:`).at_least(:once).with("which ogg123").and_return("")
117
+ uc.should_receive(:`).at_least(:once).with("which mpg123").and_return("")
118
+ uc.should_receive(:`).at_least(:once).with("which music123").and_return("")
119
+ uc.should_receive(:`).at_least(:once).with("which mpg321").and_return("/usr/bin/mpg321")
120
+ uc.should_receive(:`).at_least(:once).with("which afplay").and_return("")
121
+ uc.should_receive(:`).at_least(:once).with("which mplayer").and_return("")
122
+ uc.should_receive(:`).at_least(:once).with("which play").and_return("")
123
+ uc.should_receive(:puts).with("*** YOU CANNOT PLAY OGG FILES -- YOU MIGHT WANT TO INSTALL OGG123 ***")
124
+ uc.send(:set_music_players)
125
+ uc.instance_variable_get(:@ogg_player).should be_false
126
+ uc.instance_variable_get(:@mp3_player).should == "mpg321"
127
+ end
128
+
129
+ it "prints message and exits when mpg123, mpg321, ogg123, music123, afplay & play all not installed" do
130
+ uc = UserConfig.new
131
+ uc.instance_variable_set(:@ogg_player, nil)
132
+ uc.instance_variable_set(:@mp3_player, nil)
133
+ uc.should_receive(:`).at_least(:once).with("which ogg123").and_return("")
134
+ uc.should_receive(:`).at_least(:once).with("which mpg123").and_return("")
135
+ uc.should_receive(:`).at_least(:once).with("which music123").and_return("")
136
+ uc.should_receive(:`).at_least(:once).with("which mpg321").and_return("")
137
+ uc.should_receive(:`).at_least(:once).with("which afplay").and_return("")
138
+ uc.should_receive(:`).at_least(:once).with("which mplayer").and_return("")
139
+ uc.should_receive(:`).at_least(:once).with("which play").and_return("")
140
+ error_msg = "*** YOU CANNOT PLAY MP3S OR OGG FILES -- YOU MIGHT WANT TO INSTALL ogg123 AND mpg123/mpg321 BEFORE USING JIMMYJUKEBOX ***"
141
+ uc.should_receive(:puts).with(error_msg)
142
+ lambda { uc.send(:set_music_players) }.should raise_error SystemExit
143
+ end
144
+
145
+ end
146
+
147
+ end
148
+
metadata ADDED
@@ -0,0 +1,192 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jimmy_jukebox
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 6
10
+ version: 0.2.6
11
+ platform: ruby
12
+ authors:
13
+ - James Lavin
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-08-22 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rspec
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :development
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: rspec-core
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ type: :development
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: rspec-mocks
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ type: :development
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec-expectations
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ type: :development
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: fakefs
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ type: :development
89
+ version_requirements: *id005
90
+ - !ruby/object:Gem::Dependency
91
+ name: fakeweb
92
+ prerelease: false
93
+ requirement: &id006 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ hash: 3
99
+ segments:
100
+ - 0
101
+ version: "0"
102
+ type: :development
103
+ version_requirements: *id006
104
+ description: jimmy_jukebox plays random MP3 & OGG songs under a directory (or set of directories) and can download music
105
+ email: james@jameslavin.com
106
+ executables:
107
+ - play_jukebox
108
+ - load_jukebox
109
+ - jplay_jukebox
110
+ - jload_jukebox
111
+ extensions: []
112
+
113
+ extra_rdoc_files: []
114
+
115
+ files:
116
+ - roadmap.txt
117
+ - LICENSE.txt
118
+ - lib/jimmy_jukebox/song_loader.rb
119
+ - lib/jimmy_jukebox/user_config.rb
120
+ - lib/jimmy_jukebox/version.rb
121
+ - lib/jimmy_jukebox/artists.rb
122
+ - lib/jimmy_jukebox.rb
123
+ - lib/jimmy_jukebox/songs/BennieMoten.yml
124
+ - lib/jimmy_jukebox/songs/MilesDavis.yml
125
+ - lib/jimmy_jukebox/songs/BixBeiderbecke.yml
126
+ - lib/jimmy_jukebox/songs/LionelHampton.yml
127
+ - lib/jimmy_jukebox/songs/CountBasie.yml
128
+ - lib/jimmy_jukebox/songs/DizzyGillespie.yml
129
+ - lib/jimmy_jukebox/songs/DjangoReinhardt.yml
130
+ - lib/jimmy_jukebox/songs/LouisArmstrong.yml
131
+ - lib/jimmy_jukebox/songs/JellyRollMorton.yml
132
+ - lib/jimmy_jukebox/songs/CharlieChristian.yml
133
+ - lib/jimmy_jukebox/songs/BillieHoliday.yml
134
+ - lib/jimmy_jukebox/songs/ArtTatum.yml
135
+ - lib/jimmy_jukebox/songs/CharlieParker.yml
136
+ - lib/jimmy_jukebox/songs/KingOliver.yml
137
+ - lib/jimmy_jukebox/songs/OriginalDixielandJazzBand.yml
138
+ - lib/jimmy_jukebox/songs/EarlHines.yml
139
+ - lib/jimmy_jukebox/songs/BennyGoodman.yml
140
+ - lib/jimmy_jukebox/songs/ArtieShaw.yml
141
+ - lib/jimmy_jukebox/songs/ColemanHawkins.yml
142
+ - lib/jimmy_jukebox/songs/JamesPJohnson.yml
143
+ - lib/jimmy_jukebox/songs/RedNorvo.yml
144
+ - lib/jimmy_jukebox/songs/DukeEllington.yml
145
+ - lib/jimmy_jukebox/songs/FletcherHenderson.yml
146
+ - lib/jimmy_jukebox/songs/SidneyBechet.yml
147
+ - spec/spec_helper.rb
148
+ - spec/user_config_spec.rb
149
+ - spec/jimmy_jukebox_spec.rb
150
+ - spec/song_loader_spec.rb
151
+ - bin/play_jukebox
152
+ - bin/load_jukebox
153
+ - bin/jplay_jukebox
154
+ - bin/jload_jukebox
155
+ homepage: https://github.com/JamesLavin/jimmy_jukebox
156
+ licenses: []
157
+
158
+ post_install_message:
159
+ rdoc_options: []
160
+
161
+ require_paths:
162
+ - lib
163
+ required_ruby_version: !ruby/object:Gem::Requirement
164
+ none: false
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ hash: 3
169
+ segments:
170
+ - 0
171
+ version: "0"
172
+ required_rubygems_version: !ruby/object:Gem::Requirement
173
+ none: false
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ hash: 3
178
+ segments:
179
+ - 0
180
+ version: "0"
181
+ requirements: []
182
+
183
+ rubyforge_project: jimmy_jukebox
184
+ rubygems_version: 1.8.5
185
+ signing_key:
186
+ specification_version: 3
187
+ summary: plays your MP3 & OGG files and lets you easily download music
188
+ test_files:
189
+ - spec/spec_helper.rb
190
+ - spec/user_config_spec.rb
191
+ - spec/jimmy_jukebox_spec.rb
192
+ - spec/song_loader_spec.rb