Module: Kernel

Defined in:
lib/ruby_archive/patch/kernel.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.open(path, mode = 'r', perm = 0666, &block) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/ruby_archive/patch/kernel.rb', line 11

def open path,mode='r',perm=0666,&block
  if path[0] == '|'[0]
    return ruby_archive_original_open(path,mode,&block)
  else
    return File::open(path,mode,perm,&block)
  end
end

Instance Method Details

#load_extension(full_path) ⇒ Object

loads an extension given the _full path_



70
71
72
73
74
75
76
77
78
79
# File 'lib/ruby_archive/patch/kernel.rb', line 70

def load_extension full_path
  orig_loaded_features = $LOADED_FEATURES.dup
  unless File.in_archive?(full_path)
    ruby_archive_original_kernel_require(full_path)
  else
    raise LoadError, "Can't load native extensions from archives (yet)"
  end
  $LOADED_FEATURES.replace(orig_loaded_features)
  return true
end

#ruby_archive_original_kernel_requireObject

Alias for the original Kernel#require



83
# File 'lib/ruby_archive/patch/kernel.rb', line 83

alias ruby_archive_original_kernel_require require