Class: Sbire

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#commandObject

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

#callObject



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