candelabra 1.1.1.beta1 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- candelabra (1.1.1.beta)
4
+ candelabra (1.0.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/candelabra.gemspec CHANGED
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
5
5
  s.name = "candelabra"
6
6
  s.version = Candelabra::VERSION
7
7
  s.platform = Gem::Platform::RUBY
8
- s.authors = ['cajun']
9
- s.email = ['zac@kleinpeter.org']
8
+ s.authors = []
9
+ s.email = []
10
10
  s.homepage = "http://rubygems.org/gems/candelabra"
11
11
  s.summary = "Wrapper for pianobar"
12
12
  s.description = "initial wrapper for pianobar"
@@ -20,8 +20,17 @@ module Candelabra
20
20
  Remote.flush
21
21
  when 'userlogin'
22
22
  unless @pRet.to_i == 1
23
+ `notify-send Bad Username`
23
24
  `ps a | grep 'candelabra install' | cut -c1-5`.split("\n").each{|id| `kill #{id}` unless Process.pid == id.to_i }
24
25
  end
26
+
27
+ else
28
+ #`notify-send #{@pRet}`
29
+ #`notify-send #{command}`
30
+ #`notify-send #{command}`
31
+ #instance_variables.each do |i|
32
+ # `notify-send #{i}`
33
+ #end
25
34
  end
26
35
  end
27
36
 
@@ -89,9 +89,6 @@ module Candelabra
89
89
  end
90
90
 
91
91
  def start_pianobar
92
- Remote.flush
93
- Remote.flush_input
94
-
95
92
  if Pianobar.running?
96
93
  print "Restarting Pianobar with Autostation".ljust(CONSOLE_WIDTH + 20, '.')
97
94
  Pianobar.restart
@@ -116,13 +113,13 @@ module Candelabra
116
113
 
117
114
  if Pianobar.running?
118
115
  `echo '0' > #{Installer.input_path}` # forcing auto selection of the first station
119
- sleep( 5 )
116
+ sleep( 2 )
120
117
  puts ''
121
118
  puts "Select Auto station".center( CONSOLE_WIDTH + 20, ' ' )
119
+ stations = Remote.stations
120
+ stations.each { |s| puts s }
122
121
 
123
122
  begin
124
- stations = Remote.stations
125
- stations.each { |s| puts s }
126
123
  result = ask 'Select Station and press ENTER:'
127
124
  raise "You must enter the number of a valid station" unless result == result.to_i.to_s
128
125
  raise "That is not a valid station it must be a number between 0 and #{stations.size - 1}" unless (0..stations.size - 1).include? result.to_i
@@ -56,7 +56,7 @@ module Candelabra
56
56
 
57
57
  # Notify the user using growl
58
58
  def notify
59
- %x[growlnotify --image #{art_work} -t "Pianobar - #{stationName}" -m "Now Playing: #{artist} - #{title}"] if notify?
59
+ %x[growlnotify --image #{art_work} -t "Pianobar - #{stationName}" -m "Now Playing: #{artist} - #{title}"]
60
60
  end
61
61
 
62
62
  end
@@ -42,7 +42,6 @@ module Candelabra
42
42
  #
43
43
  # Returns command you passed in
44
44
  def execute_command cmd
45
- return nil unless Candelabra::Pianobar.running?
46
45
  if commands.include? cmd
47
46
  %x[ echo #{commands[cmd]} > #{Candelabra::Installer.ctl_path} ]
48
47
  else
@@ -124,7 +123,7 @@ module Candelabra
124
123
  # Returns an array of stations
125
124
  def stations
126
125
  list = []
127
- execute_command( :stations )
126
+ execute_command( :change_station )
128
127
  output do |io|
129
128
  io.lines.each do |line|
130
129
  /(\[\?\])/ =~ line
@@ -136,13 +135,15 @@ module Candelabra
136
135
  end
137
136
 
138
137
  def flush
139
- output { |io| loop { io.read_nonblock(1) } }
140
- rescue # TODO put the correct exception
141
- end
142
-
143
- def flush_input
144
- input { |io| loop { io.read_nonblock(1) } }
145
- rescue # TODO put the correct exception
138
+ output do |io|
139
+ loop do
140
+ begin
141
+ io.read_nonblock(1);
142
+ rescue
143
+ break
144
+ end
145
+ end
146
+ end
146
147
  end
147
148
 
148
149
  # The out put file for the commands
@@ -151,16 +152,6 @@ module Candelabra
151
152
  # Yields and IO reader for pianobar's output
152
153
  def output
153
154
  File.open( Candelabra::Installer.output_path, 'r+' ) do |io|
154
- yield(io)
155
- end
156
- end
157
-
158
- # The out put file for the commands
159
- # This contains all the output from pianobar
160
- #
161
- # Yields and IO reader for pianobar's output
162
- def input
163
- File.open( Candelabra::Installer.input_path, 'r+' ) do |io|
164
155
  yield( io )
165
156
  end
166
157
  end
@@ -1,3 +1,3 @@
1
1
  module Candelabra
2
- VERSION = "1.1.1.beta1"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,11 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: candelabra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1.beta1
5
- prerelease: 6
4
+ version: 1.1.1
5
+ prerelease: !!null
6
6
  platform: ruby
7
- authors:
8
- - cajun
7
+ authors: []
9
8
  autorequire: !!null
10
9
  bindir: bin
11
10
  cert_chain: []
@@ -14,7 +13,7 @@ default_executable: !!null
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: bundler
17
- requirement: &2153435960 !ruby/object:Gem::Requirement
16
+ requirement: &2153408540 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ~>
@@ -22,10 +21,10 @@ dependencies:
22
21
  version: 1.0.0
23
22
  type: :development
24
23
  prerelease: false
25
- version_requirements: *2153435960
24
+ version_requirements: *2153408540
26
25
  - !ruby/object:Gem::Dependency
27
26
  name: minitest
28
- requirement: &2153435500 !ruby/object:Gem::Requirement
27
+ requirement: &2153408080 !ruby/object:Gem::Requirement
29
28
  none: false
30
29
  requirements:
31
30
  - - ! '>='
@@ -33,10 +32,9 @@ dependencies:
33
32
  version: 2.0.2
34
33
  type: :development
35
34
  prerelease: false
36
- version_requirements: *2153435500
35
+ version_requirements: *2153408080
37
36
  description: initial wrapper for pianobar
38
- email:
39
- - zac@kleinpeter.org
37
+ email: []
40
38
  executables:
41
39
  - candelabra
42
40
  extensions: []