Module: U8
- Defined in:
- lib/u8.rb,
lib/u8/command.rb,
lib/u8/version.rb
Defined Under Namespace
Classes: Command
Constant Summary collapse
- VERSION =
"0.1.1"
Class Method Summary collapse
- ._ ⇒ Object
-
.command(cmd, args = {}) ⇒ Object
def config.
- .echo(*args) ⇒ Object
- .interactive ⇒ Object
- .shell(&block) ⇒ Object
Class Method Details
._ ⇒ Object
6 7 8 |
# File 'lib/u8.rb', line 6 def _ @_ end |
.command(cmd, args = {}) ⇒ Object
def config
16 17 18 |
# File 'lib/u8.rb', line 16 def command cmd, args={} U8::Command.new(cmd,args) end |
.echo(*args) ⇒ Object
10 11 12 13 |
# File 'lib/u8.rb', line 10 def echo *args args = args.is_a?(Array) ? args.join("\n") : args puts args.to_s end |
.interactive ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/u8.rb', line 24 def interactive while 1 echo eval(gets) end rescue StandardError => e echo e. interactive end |
.shell(&block) ⇒ Object
20 21 22 |
# File 'lib/u8.rb', line 20 def shell &block U8.instance_eval &block end |