Module: Libv8::Paths

Defined in:
ext/libv8/paths.rb

Class Method Summary collapse

Class Method Details

.configObject



16
17
18
# File 'ext/libv8/paths.rb', line 16

def config
  RbConfig::MAKEFILE_CONFIG
end

.include_pathsObject



8
9
10
# File 'ext/libv8/paths.rb', line 8

def include_paths
  ["#{vendored_source_path}/include"]
end

.libv8_object(name) ⇒ Object



20
21
22
23
24
25
26
# File 'ext/libv8/paths.rb', line 20

def libv8_object(name)
  filename = "#{libv8_profile}/libv8_#{name}.#{config['LIBEXT']}"
  unless File.exists? filename
    filename = "#{libv8_profile}/obj.target/tools/gyp/libv8_#{name}.#{config['LIBEXT']}"
  end
  return filename
end

.libv8_profileObject



28
29
30
31
32
# File 'ext/libv8/paths.rb', line 28

def libv8_profile
  base = "#{vendored_source_path}/out/#{Libv8::Arch.libv8_arch}"
  debug = "#{base}.debug"
  File.exists?(debug) ? debug : "#{base}.release"
end

.object_pathsObject



12
13
14
# File 'ext/libv8/paths.rb', line 12

def object_paths
  [libv8_object(:base), libv8_object(:snapshot)]
end

.vendored_source_pathObject



34
35
36
# File 'ext/libv8/paths.rb', line 34

def vendored_source_path
  File.expand_path "../../../vendor/v8", __FILE__
end