candelabra 1.0.1 → 1.0.2

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- candelabra (0.0.1)
4
+ candelabra (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -21,6 +21,7 @@ module Candelabra
21
21
  :next => 'n',
22
22
  :quit => 'q',
23
23
  :change_station => 's',
24
+ :stations => 's',
24
25
  :tired => 't',
25
26
  :upcomming => 'u',
26
27
  :quick_mix => 'x',
@@ -47,7 +48,7 @@ module Candelabra
47
48
  else
48
49
  %x[ echo #{cmd} > #{Candelabra::Installer.ctl_path} ]
49
50
  end
50
- cmd
51
+ nil
51
52
  end
52
53
 
53
54
  # Wrapper for all the commands. This will give you the ability to call the following methods
@@ -135,7 +136,12 @@ module Candelabra
135
136
  end
136
137
 
137
138
  def flush
138
- output {|io| io.flush }
139
+ output do |io|
140
+ begin
141
+ io.read(1);
142
+ rescue
143
+ end
144
+ end
139
145
  end
140
146
 
141
147
  # The out put file for the commands
@@ -23,7 +23,13 @@ module Candelabra
23
23
  #
24
24
  # Returns...it's the initializer
25
25
  def initialize(args)
26
+ parse(args)
26
27
  @command = args.shift
28
+ @data = args
29
+ end
30
+
31
+ def banner
32
+ Installer.get_template 'banner'
27
33
  end
28
34
 
29
35
  # Take in the arguments from the command line and parse out any
@@ -34,17 +40,7 @@ module Candelabra
34
40
  @options ={}
35
41
  Candelabra::Configuration.go do |config|
36
42
  OptionParser.new( args ) do |opts|
37
- opts.banner = 'Usage: candelabra [command] [opts]'
38
-
39
- opts.on( '-e','--event [EVENT=DATA]',
40
- 'Send the EVENT to Candelabra.',
41
- 'if the extra DATA is supplied',
42
- 'set the EVENT to the DATA.' ) do |event_command|
43
-
44
- event, cmd = event_command.split('=')
45
- config.send( event + '=', cmd ) if cmd
46
- @options[event] = true
47
- end
43
+ opts.banner = banner
48
44
 
49
45
  opts.on_tail( '-h', '--help', 'Show this message' ) do
50
46
  puts opts
@@ -78,13 +74,12 @@ module Candelabra
78
74
  Candelabra::Pianobar.restart
79
75
  when 'install'
80
76
  Candelabra::Installer.run
81
- when 'event'
82
- # NOTE: this is mainly for debugging
83
- puts "On Song Start: #{ config.on_song_start }" if options['on_song_start']
84
- puts "On Song Finish: #{ config.on_song_finish }" if options['on_song_finish']
85
- puts "On Error: #{ config.on_error }" if options['on_error']
86
77
  when *cmds.keys
87
- Remote.send cmds[command].to_sym
78
+ if data.nil? || data.empty?
79
+ puts Remote.send cmds[command].to_sym
80
+ else
81
+ puts Remote.send cmds[command].to_sym, data
82
+ end
88
83
  else
89
84
  puts "No command given"
90
85
  end
@@ -0,0 +1,17 @@
1
+ usage: candelabra [command] [data]
2
+
3
+ Base Commands:
4
+ install
5
+ start
6
+ stop
7
+ restart
8
+
9
+ Controlling Pianobar
10
+ n(ext)
11
+ p(ause)
12
+ co(continue)
13
+ ch(change_station) # of station
14
+ t(ired)
15
+ u(pcomming)
16
+ q(ick_mix)
17
+
@@ -1,3 +1,3 @@
1
1
  module Candelabra
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,65 +1,45 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: candelabra
3
- version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 1
10
- version: 1.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ prerelease: !!null
11
6
  platform: ruby
12
7
  authors: []
13
-
14
- autorequire:
8
+ autorequire: !!null
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2011-02-16 00:00:00 -06:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2011-02-16 00:00:00.000000000 -06:00
12
+ default_executable: !!null
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: bundler
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &2153300860 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
18
+ requirements:
27
19
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 23
30
- segments:
31
- - 1
32
- - 0
33
- - 0
20
+ - !ruby/object:Gem::Version
34
21
  version: 1.0.0
35
22
  type: :development
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: minitest
39
23
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *2153300860
25
+ - !ruby/object:Gem::Dependency
26
+ name: minitest
27
+ requirement: &2153300400 !ruby/object:Gem::Requirement
41
28
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 11
46
- segments:
47
- - 2
48
- - 0
49
- - 2
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
50
32
  version: 2.0.2
51
33
  type: :development
52
- version_requirements: *id002
34
+ prerelease: false
35
+ version_requirements: *2153300400
53
36
  description: initial wrapper for pianobar
54
37
  email: []
55
-
56
- executables:
38
+ executables:
57
39
  - candelabra
58
40
  extensions: []
59
-
60
41
  extra_rdoc_files: []
61
-
62
- files:
42
+ files:
63
43
  - .gitignore
64
44
  - .rvmrc
65
45
  - Gemfile
@@ -77,6 +57,7 @@ files:
77
57
  - lib/candelabra/pianobar.rb
78
58
  - lib/candelabra/remote.rb
79
59
  - lib/candelabra/runner.rb
60
+ - lib/candelabra/templates/banner.erb
80
61
  - lib/candelabra/templates/config.erb
81
62
  - lib/candelabra/templates/header.erb
82
63
  - lib/candelabra/templates/setup_config_file.erb
@@ -94,38 +75,26 @@ files:
94
75
  has_rdoc: true
95
76
  homepage: http://rubygems.org/gems/candelabra
96
77
  licenses: []
97
-
98
- post_install_message:
78
+ post_install_message: !!null
99
79
  rdoc_options: []
100
-
101
- require_paths:
80
+ require_paths:
102
81
  - lib
103
- required_ruby_version: !ruby/object:Gem::Requirement
82
+ required_ruby_version: !ruby/object:Gem::Requirement
104
83
  none: false
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- hash: 3
109
- segments:
110
- - 0
111
- version: "0"
112
- required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
89
  none: false
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- hash: 23
118
- segments:
119
- - 1
120
- - 3
121
- - 6
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
122
93
  version: 1.3.6
123
94
  requirements: []
124
-
125
95
  rubyforge_project: candelabra
126
- rubygems_version: 1.4.2
127
- signing_key:
96
+ rubygems_version: 1.5.0
97
+ signing_key: !!null
128
98
  specification_version: 3
129
99
  summary: Wrapper for pianobar
130
100
  test_files: []
131
-