Module: Kernel

Includes:
BuiltinCommands
Defined in:
lib/rust/helpers/io.rb,
lib/rust/commands/builtins.rb

Instance Method Summary collapse

Methods included from BuiltinCommands

builtins, #cd, commands, #exit, #help, #ls, #parser, #pwd, #read, register, register_builtin, #rm, #test, #type

Instance Method Details

#add(sym) ⇒ Object



43
44
45
# File 'lib/rust/commands/builtins.rb', line 43

def add(sym)
  BuiltinCommands.register(sym)
end

#ask(*arr) ⇒ Object

To be used by any parsers for all I/O



105
106
107
# File 'lib/rust/helpers/io.rb', line 105

def ask(*arr)
  Rust.io.ask(*arr)
end

#builtin_commandsObject



39
40
41
# File 'lib/rust/commands/builtins.rb', line 39

def builtin_commands
  BuiltinCommands.commands
end

#builtinsObject Also known as: internals



34
35
36
# File 'lib/rust/commands/builtins.rb', line 34

def builtins
  BuiltinCommands.builtins
end

#color(string, *colors) ⇒ Object



121
122
123
124
125
126
127
128
129
130
# File 'lib/rust/helpers/io.rb', line 121

def color( string, *colors )
  colors.map! do |c|
    if c.is_a? Symbol
      self.class.const_get(c.to_s.upcase)
    else
      c
    end
  end
  "#{colors.flatten.join}#{string}#{CLEAR}"
end

#err(*arr) ⇒ Object



113
114
115
# File 'lib/rust/helpers/io.rb', line 113

def err(*arr)
  Rust.io.err(*arr)
end

#say(*arr) ⇒ Object



117
118
119
# File 'lib/rust/helpers/io.rb', line 117

def say(*arr)
  Rust.io.say(*arr)
end

#tell(*arr) ⇒ Object



109
110
111
# File 'lib/rust/helpers/io.rb', line 109

def tell(*arr)
  Rust.io.tell(*arr)
end