Module: Ruar::Setup::ClassMethods

Defined in:
lib/ruar/setup.rb

Instance Method Summary collapse

Instance Method Details

#activateObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/ruar/setup.rb', line 22

def activate
  return if @activated

  @activated = true

  require_relative 'core_ext/kernel_require'
  @entrypoint.activate

  puts 'Ruar Activated!'.green
end

#cipherObject



41
42
43
# File 'lib/ruar/setup.rb', line 41

def cipher
  @cipher ||= Ruar::Cipher.new
end

#eval(path, bind = TOPLEVEL_BINDING) ⇒ Object



33
34
35
# File 'lib/ruar/setup.rb', line 33

def eval(path, bind = TOPLEVEL_BINDING)
  @entrypoint.eval(path, bind)
end

#path_prefixObject



18
19
20
# File 'lib/ruar/setup.rb', line 18

def path_prefix
  @path_prefix
end

#read(path) ⇒ Object



37
38
39
# File 'lib/ruar/setup.rb', line 37

def read(path)
  @entrypoint.read(path)
end

#setup(archive: nil, entry: nil, rien: false) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/ruar/setup.rb', line 10

def setup(archive: nil, entry: nil, rien: false)
  @entrypoint ||= Ruar::EntryPoint.new(archive: archive, entry: entry)
  # Rien uses relative path when it compiles the Ruby code
  @path_prefix ||= rien ? Pathname.new('') : Pathname.new('/_from/_ruar/_internal')

  self
end