Module: Libv8

Defined in:
lib/libv8.rb,
lib/libv8/version.rb,
ext/libv8/arch.rb,
ext/libv8/make.rb,
ext/libv8/compiler.rb

Defined Under Namespace

Modules: Arch, Compiler, Make

Constant Summary collapse

VERSION =
"3.11.8.3"

Class Method Summary collapse

Class Method Details

.libv8_baseObject



15
16
17
# File 'lib/libv8.rb', line 15

def libv8_base
  libv8_object :base
end

.libv8_include_flagsObject



39
40
41
# File 'lib/libv8.rb', line 39

def libv8_include_flags
  "-I#{libv8_include_path}"
end

.libv8_include_pathObject



43
44
45
# File 'lib/libv8.rb', line 43

def libv8_include_path
  "#{libv8_source_path}/include"
end

.libv8_ldflagsObject



35
36
37
# File 'lib/libv8.rb', line 35

def libv8_ldflags
  "-L#{libv8_base} -L#{libv8_snapshot}"
end

.libv8_nosnapshotObject



23
24
25
# File 'lib/libv8.rb', line 23

def libv8_nosnapshot
  libv8_object :nosnapshot
end

.libv8_object(name) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/libv8.rb', line 7

def libv8_object(name)
  filename = "#{libv8_source_path}/out/#{Libv8::Arch.libv8_arch}.release/libv8_#{name}.#{$LIBEXT}"
  unless File.exists? filename
    filename = "#{libv8_source_path}/out/#{Libv8::Arch.libv8_arch}.release/obj.target/tools/gyp/libv8_#{name}.#{$LIBEXT}"
  end
  return filename
end

.libv8_objects(*names) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/libv8.rb', line 27

def libv8_objects(*names)
  names = [:base, :snapshot] if names.empty?
  names.map do |name|
    fail "no libv8 object #{name}" unless File.exists?(object = libv8_object(name))
    object
  end
end

.libv8_snapshotObject



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

def libv8_snapshot
  libv8_object :snapshot
end

.libv8_source_pathObject



47
48
49
# File 'lib/libv8.rb', line 47

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