Sha256: 178d174b0b6edae7740454d012d6c85aca59dd551055e8128f4d570a1d59b641

Contents?: true

Size: 993 Bytes

Versions: 18

Compression:

Stored size: 993 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "pathname"
require "rake"

MRUBY_DIR = Pathname.new(__dir__).join("../ext/enterprise_script_service/mruby")
raise(<<-MESSAGE) unless Dir.exist?(MRUBY_DIR.join("src"))

  The mruby source code appears to be missing. Did you clone this gem with
  submodules? If that is not the case or you are unsure, you can run the
  following commands:

    $ git submodule init
    $ git submodule update

MESSAGE

def within_mruby
  Dir.chdir(MRUBY_DIR) do
    original_mruby_config = ENV["MRUBY_CONFIG"]
    begin
      ENV["MRUBY_CONFIG"] = "../mruby_config.rb"
      yield
    ensure
      ENV["MRUBY_CONFIG"] = original_mruby_config
    end
  end
end

case ARGV[0]
when "compile"
  within_mruby do
    sh("ruby", "./minirake")
  end
when "clean"
  within_mruby do
    sh("ruby", "./minirake", "clean")
  end
when "clobber"
  within_mruby do
    sh("ruby", "./minirake", "deep_clean")
  end
else
  puts("#{__FILE__} compile|clean|clobber")
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
script_core-0.3.2 script/mkmruby
script_core-0.3.0 script/mkmruby
script_core-0.2.7 script/mkmruby
script_core-0.2.6 script/mkmruby
script_core-0.2.5 script/mkmruby
script_core-0.2.4 script/mkmruby
script_core-0.2.3 script/mkmruby
script_core-0.2.2 script/mkmruby
script_core-0.2.1 script/mkmruby
script_core-0.2.0 script/mkmruby
script_core-0.1.1 script/mkmruby
script_core-0.1.0 script/mkmruby
script_core-0.0.6 script/mkmruby
script_core-0.0.5 script/mkmruby
script_core-0.0.4 script/mkmruby
script_core-0.0.3 script/mkmruby
script_core-0.0.2 script/mkmruby
script_core-0.0.1 script/mkmruby