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.1"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.cmd(*args) ⇒ Object

Execute a shell command

See Also:



49
50
51
# File 'lib/scriptster.rb', line 49

def self.cmd(*args)
  ShellCmd.new *args
end

.configure {|c| ... } ⇒ Object

Use this method to reconfigure the library.

Examples:

Scriptster::configure do |conf|
  conf.name = "my-script"
  conf.colours = :light
  conf.timestamps = false
end

Yields:

See Also:



71
72
73
74
75
# File 'lib/scriptster.rb', line 71

def self.configure
  c = Configuration.new
  yield c
  c.apply
end

.log(*args) ⇒ Object

Pass a message to the logger.



35
36
37
# File 'lib/scriptster.rb', line 35

def self.log(*args)
  Logger::log *args
end

Instance Method Details

#cmd(*args) ⇒ Object

The same as cmd.

See Also:



56
57
58
# File 'lib/scriptster.rb', line 56

def cmd(*args)
  ShellCmd.new *args
end

#log(*args) ⇒ Object

The same as log.

See Also:



42
43
44
# File 'lib/scriptster.rb', line 42

def log(*args)
  Logger::log *args
end