Module: Libv8::Paths

Defined in:
ext/libv8/paths.rb

Class Method Summary collapse

Class Method Details

.configObject



19
20
21
# File 'ext/libv8/paths.rb', line 19

def config
  RbConfig::MAKEFILE_CONFIG
end

.include_pathsObject



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

def include_paths
  [Shellwords.escape("#{vendored_source_path}/include")]
end

.libv8_object(name) ⇒ Object



23
24
25
26
27
28
29
# File 'ext/libv8/paths.rb', line 23

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

.libv8_profileObject



31
32
33
34
35
# File 'ext/libv8/paths.rb', line 31

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

.object_pathsObject



13
14
15
16
17
# File 'ext/libv8/paths.rb', line 13

def object_paths
  [libv8_object(:base), libv8_object(:snapshot)].map do |path|
    Shellwords.escape path
  end
end

.vendored_source_pathObject



37
38
39
# File 'ext/libv8/paths.rb', line 37

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