Module: Cargo

Defined in:
lib/cargo.rb

Constant Summary collapse

VERSION =
"0.0.2"

Instance Method Summary collapse

Instance Method Details

#export(cargo) ⇒ Object



16
17
18
# File 'lib/cargo.rb', line 16

def export(cargo)
  Thread.current[:cargo] = cargo
end

#import(file) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/cargo.rb', line 4

def import(file)
  unless file.match(/\.rb$/)
    file = "#{file}.rb"
  end

  load(file, true)

  Thread.current[:cargo].tap do
    Thread.current[:cargo] = nil
  end
end