Module: Scriptster
- Defined in:
- lib/scriptster.rb,
lib/scriptster/logger.rb,
lib/scriptster/version.rb,
lib/scriptster/shellcmd.rb,
lib/scriptster/configuration.rb
Overview
The public interface of scriptster is simple. It consists of two functions, cmd and log. The module can be used directly or included in your class.
Defined Under Namespace
Modules: ColourThemes, Logger Classes: Configuration, ShellCmd
Constant Summary collapse
- VERSION =
The version of this library
"0.2.3"
Class Method Summary collapse
-
.cmd(*args) ⇒ Object
Execute a shell command.
-
.configure {|c| ... } ⇒ Object
Use this method to reconfigure the library.
-
.log(*args) ⇒ Object
Pass a message to the logger.
-
.parse_args(docopt_string, argv = nil) ⇒ Array
Process command line arguments using docopt and return the array of options.
Instance Method Summary collapse
-
#cmd(*args) ⇒ Object
The same as Scriptster.cmd.
-
#log(*args) ⇒ Object
The same as Scriptster.log.
-
#parse_args(docopt_string, argv = nil) ⇒ Object
The same as Scriptster.parse_args.
Class Method Details
.cmd(*args) ⇒ Object
Execute a shell command
53 54 55 |
# File 'lib/scriptster.rb', line 53 def self.cmd(*args) ShellCmd.new *args end |
.configure {|c| ... } ⇒ Object
Use this method to reconfigure the library.
75 76 77 78 79 |
# File 'lib/scriptster.rb', line 75 def self.configure c = Configuration.new yield c c.apply end |
.log(*args) ⇒ Object
Pass a message to the logger.
39 40 41 |
# File 'lib/scriptster.rb', line 39 def self.log(*args) Logger::log *args end |
.parse_args(docopt_string, argv = nil) ⇒ Array
Process command line arguments using docopt and return the array of options.
86 87 88 |
# File 'lib/scriptster.rb', line 86 def self.parse_args(docopt_string, argv=nil) do_parse_args docopt_string, argv end |
Instance Method Details
#cmd(*args) ⇒ Object
The same as cmd.
60 61 62 |
# File 'lib/scriptster.rb', line 60 def cmd(*args) Scriptster.cmd *args end |
#log(*args) ⇒ Object
The same as log.
46 47 48 |
# File 'lib/scriptster.rb', line 46 def log(*args) Scriptster.log *args end |
#parse_args(docopt_string, argv = nil) ⇒ Object
The same as parse_args.
93 94 95 |
# File 'lib/scriptster.rb', line 93 def parse_args(docopt_string, argv=nil) Scriptster.do_parse_args docopt_string, argv end |