module Alda
The module serving as a namespace.
Constants
- COMMANDS
The array of available subcommands of alda executable.
Alda
is able to invokealda
at the command line. The subcommand is the name of the method invoked uponAlda
.The keyword arguments are interpreted as the subcommand options. To specify the command options, use
::[]
.The return value is the string output by the command in STDOUT.
If the exit code is nonzero, an
Alda::CommandLineError
is raised.Alda.version # => "Client version: 1.4.0\nServer version: [27713] 1.4.0\n" Alda.parse code: 'bassoon: o3 c' # => "{\"chord-mode\":false,\"current-instruments\":...}\n"
The available commands are:
help
,update
,repl
,up
,start_server
,init
,down
,stop_server
,downup
,restart_server
,list
,status
,version
,play
,stop
,parse
,instruments
, andexport
.- VERSION
The version number of alda-rb.
The same as that in alda-rb gem spec.
Attributes
The path to the alda
executable.
The default value is "alda"
, which will depend on your PATH
.
The commandline options set using ::[]
. Not the subcommand options. Clear it using ::clear_options
.
Public Class Methods
Sets the options of alda command. Not the subcommand options.
Alda[port: 1108].up # => "[1108] ..." Alda.status # => "[1108] ..."
Further set options will be merged. The options can be seen by ::options
. To clear them, use ::clear_options
.
# File lib/alda-rb/commandline.rb, line 100 def [] **opts @options.merge! opts self end
Whether the alda server is down.
# File lib/alda-rb/commandline.rb, line 133 def down? status.include? 'down' end
Start a REPL
session.
# File lib/alda-rb/repl.rb, line 12 def Alda.repl Alda::REPL.new.run end
Whether the alda server is up.
# File lib/alda-rb/commandline.rb, line 124 def up? status.include? 'up' end
Private Instance Methods
Whether the alda server is down.
# File lib/alda-rb/commandline.rb, line 133 def down? status.include? 'down' end
Whether the alda server is up.
# File lib/alda-rb/commandline.rb, line 124 def up? status.include? 'up' end