module Ijson::Command

Public Class Methods

included(base) click to toggle source
# File lib/ijson/command.rb, line 3
def self.included(base)
  base.send(:include, Hash) if base == ::Hash
  base.send(:include, Array) if base == ::Array
end
root=(value) click to toggle source
# File lib/ijson/command.rb, line 12
def self.root=(value)
  use_binding_of value
  ChangeDir.root = value
end
use_binding_of(env) click to toggle source
# File lib/ijson/command.rb, line 8
def self.use_binding_of env
  Ripl.shell.binding = env.instance_eval { binding }
end

Public Instance Methods

cat(*paths) click to toggle source
# File lib/ijson/command.rb, line 88
def cat *paths
  paths.inject(self) {|a, e| a[e]}
end
cd(*paths) click to toggle source
# File lib/ijson/command.rb, line 76
def cd *paths
  ChangeDir.new(self, paths).run
end
cd!(*paths) click to toggle source
# File lib/ijson/command.rb, line 80
def cd! *paths
  ChangeDir.new(self, paths, :root => true).run
end
pwd() click to toggle source
# File lib/ijson/command.rb, line 84
def pwd
  ChangeDir.current_path.map {|i| "[#{i}]" }.join
end