Class: RouteC::CLI
- Inherits:
-
Thor
- Object
- Thor
- RouteC::CLI
- Defined in:
- lib/route_c/cli.rb
Instance Method Summary collapse
Instance Method Details
#lights(station, direction) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/route_c/cli.rb', line 23 def lights station, direction routec = RouteC::Query.new station, direction, [:time] if ['console'] puts routec.to_a.inspect else routec.to_lights end end |
#version ⇒ Object
7 8 9 |
# File 'lib/route_c/cli.rb', line 7 def version puts "routec version #{VERSION}" end |
#watch ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/route_c/cli.rb', line 37 def watch if ['daemon'] file = File.new(File.join('/', 'tmp', '.pid'), 'w+') file.write(Process.pid) file.rewind file.close end print 'Waiting for you to push the button... ' PiPiper.watch pin: Lights. do RouteC::CLI.new.watching end PiPiper.wait end |