Top Level Namespace

Includes:
Skylight::Util

Defined Under Namespace

Modules: ActiveSupport, Kernel, Skylight, SqlLexer, ThreadSafe Classes: HighLine, IO, Object, String, StringIO, StringScanner, Thor

Constant Summary collapse

SKYLIGHT_INSTALL_LOG =
File.expand_path("../install.log", __FILE__)
SKYLIGHT_REQUIRED =
ENV.key?("SKYLIGHT_REQUIRED") && ENV['SKYLIGHT_REQUIRED'] !~ /^false$/i
SKYLIGHT_FETCH_LIB =
!ENV.key?('SKYLIGHT_FETCH_LIB') || ENV['SKYLIGHT_FETCH_LIB'] !~ /^false$/i
SKYLIGHT_HDR_PATH =

Directory where skylight.h exists

ENV['SKYLIGHT_HDR_PATH'] || ENV['SKYLIGHT_LIB_PATH'] || '.'
SKYLIGHT_LIB_PATH =
ENV['SKYLIGHT_LIB_PATH'] || File.expand_path("../../lib/skylight/native/#{Platform.tuple}", __FILE__)
LOG =

Setup logger

Logger.new(MultiIO.new(STDOUT, File.open(SKYLIGHT_INSTALL_LOG, 'a')))
SRC_PATH =

Where the ruby binding src is

File.expand_path('..', __FILE__)

Instance Method Summary collapse

Instance Method Details

#fail(msg, type = :error) ⇒ Object

Handles terminating in the case of a failure. If we have a bug, we do not want to break our customer’s deploy, but extconf.rb requires a Makefile to be present upon a successful exit. To satisfy this requirement, we create a dummy Makefile.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'ext/extconf.rb', line 30

def fail(msg, type=:error)
  LOG.send type, msg

  if SKYLIGHT_REQUIRED
    exit 1
  else
    File.open("Makefile", "w") do |file|
      file.puts "default:"
      file.puts "install:"
    end

    exit
  end
end

#find_file(file, root = nil) ⇒ Object

By this point, libskylight is present =====


130
131
132
133
134
135
136
# File 'ext/extconf.rb', line 130

def find_file(file, root = nil)
  path = File.expand_path(file, root || '.')

  unless File.exist?(path)
    fail "#{file} missing; path=#{root}"
  end
end