Class: Sbire
- Inherits:
-
Object
- Object
- Sbire
- Defined in:
- lib/sbire.rb
Constant Summary collapse
- BASE_DIRECTORY =
"#{Dir.home}/.sbire"- OUT_FILE =
"#{BASE_DIRECTORY}/.audiofile.flac"- PID_FILE =
"#{BASE_DIRECTORY}/.pid"- TEXT_FILE =
"#{BASE_DIRECTORY}/sbire.txt"- CONFIG_PATH =
"#{BASE_DIRECTORY}/config.yml"- COMMAND_PATH =
"#{BASE_DIRECTORY}/commands.yml"- CONFIG =
SbireConfig.new(CONFIG_PATH)
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(argv) ⇒ Sbire
constructor
A new instance of Sbire.
Constructor Details
#initialize(argv) ⇒ Sbire
Returns a new instance of Sbire.
25 26 27 |
# File 'lib/sbire.rb', line 25 def initialize(argv) @command = argv.first end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
19 20 21 |
# File 'lib/sbire.rb', line 19 def command @command end |
Class Method Details
.run(argv) ⇒ Object
21 22 23 |
# File 'lib/sbire.rb', line 21 def self.run(argv) self.new(argv).call end |
Instance Method Details
#call ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/sbire.rb', line 29 def call if command == "start" || command == "stop" || command == "save" send(command) else show("Command not found") end end |