Class: HTTPShell::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/httpshell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEnvironment

Returns a new instance of Environment.



8
9
10
11
# File 'lib/httpshell.rb', line 8

def initialize
  @variables = {}
  @working_path = "http://"
end

Instance Attribute Details

#variablesObject (readonly)

Returns the value of attribute variables.



5
6
7
# File 'lib/httpshell.rb', line 5

def variables
  @variables
end

#working_pathObject

Returns the value of attribute working_path.



6
7
8
# File 'lib/httpshell.rb', line 6

def working_path
  @working_path
end

Instance Method Details

#cd(path) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/httpshell.rb', line 13

def cd(path)
  if /^(http|https|file):\/\//i =~ path
    cd_absolutely(path)
  else
    cd_relatively(path)
  end
end