forked from ruby-next/ruby-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.mspec
63 lines (48 loc) · 1.58 KB
/
default.mspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# frozen_string_literal: true
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
if defined?(Warning) && Warning.respond_to?(:[]=)
Warning[:experimental] = false
end
begin
require "pry-byebug"
rescue LoadError, NameError
end
begin
require "dead_end"
rescue LoadError, NameError
end
class MSpecScript
# Language features specs
set :language, %w[spec/language]
# Core library specs
set :core, %w[spec/core]
# Integration specs
set :integration, %w[spec/integration]
# Command line specs
set :cli, %w[spec/cli]
# Latest stable Ruby release specs
set :stable, get(:cli) + get(:language) + get(:core) + get(:integration)
end
ENV["RUBY_NEXT_EDGE"] = "1"
ENV["RUBY_NEXT_PROPOSED"] = "1"
require "backports/2.5" if ENV["CORE_EXT"] == "backports"
require "ruby-next/language"
require_relative "spec/support/eval_binding_rewriter"
require "ruby-next/language/runtime"
if ENV["CORE_EXT"] == "gem"
require "ruby-next/core_ext"
elsif ENV["CORE_EXT"] == "generated"
require "ruby-next/cli"
RubyNext::CLI.new.run(["core_ext", "--min-version", RUBY_VERSION, "-o", File.join(__dir__, "tmp", "core_ext.rb")])
require_relative "tmp/core_ext"
RubyNext::Core.strategy = :core_ext
elsif ENV["CORE_EXT"] == "backports"
require "ruby-next/core_ext"
RubyNext::Core.strategy = :backports
else
require "ruby-next/core/runtime"
end
$stdout.puts "Module refinements support: #{RubyNext::Utils.refine_modules?}"
$stdout.puts "Ruby Next core strategy: #{RubyNext::Core.strategy}"
$stdout.puts "Ruby Next transpile mode: #{RubyNext::Language.mode}"