Sha256: 8371d9a216a1e82498831dc687f547cb0fb74bd76e951c9cbe4c849d955b656a

Contents?: true

Size: 1002 Bytes

Versions: 41

Compression:

Stored size: 1002 Bytes

Contents

require 'rbconfig'
require 'shellwords'
require File.expand_path '../arch', __FILE__

module Libv8
  module Paths
    module_function

    def include_paths
      [Shellwords.escape(File.join(vendored_source_path, 'include'))]
    end

    def object_paths
      [:base, :libbase, :snapshot, :libplatform, :libsampler].map do |name|
        Shellwords.escape libv8_object(name)
      end
    end

    def config
      RbConfig::MAKEFILE_CONFIG
    end

    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

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

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

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
libv8-6.0.286.54.1-x86-linux ext/libv8/paths.rb
libv8-6.0.286.54.1-x86_64-linux ext/libv8/paths.rb
libv8-6.0.286.54.1-x86_64-freebsd-11 ext/libv8/paths.rb
libv8-6.0.286.54.1-x86_64-freebsd-10 ext/libv8/paths.rb
libv8-6.0.286.54.1-x86_64-darwin-16 ext/libv8/paths.rb
libv8-6.0.286.54.1-x86_64-darwin-15 ext/libv8/paths.rb
libv8-6.0.286.54.1-x86_64-darwin-14 ext/libv8/paths.rb
libv8-6.0.286.54.1-universal-darwin-16 ext/libv8/paths.rb
libv8-6.0.286.54.1-universal-darwin-15 ext/libv8/paths.rb
libv8-6.0.286.54.1-universal-darwin-14 ext/libv8/paths.rb
libv8-6.0.286.54.1 ext/libv8/paths.rb
libv8-6.0.286.54.1-arm-linux ext/libv8/paths.rb
libv8-6.0.286.54.1-amd64-freebsd-11 ext/libv8/paths.rb
libv8-6.0.286.54.1-amd64-freebsd-10 ext/libv8/paths.rb
libv8-6.0.286.54.1-aarch64-linux ext/libv8/paths.rb
libv8-6.0.286.54.0 ext/libv8/paths.rb
libv8-6.0.286.54.0beta2-x86_64-darwin-16 ext/libv8/paths.rb
libv8-6.0.286.54.0beta2-x86_64-darwin-15 ext/libv8/paths.rb
libv8-6.0.286.54.0beta2-x86_64-darwin-14 ext/libv8/paths.rb
libv8-6.0.286.54.0beta2-universal-darwin-16 ext/libv8/paths.rb