This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ def non_mri?
47
47
def mri?
48
48
!defined? ( RUBY_ENGINE ) || RUBY_ENGINE == 'ruby'
49
49
end
50
+
51
+ def truffleruby?
52
+ defined? ( RUBY_ENGINE ) && RUBY_ENGINE == 'truffleruby'
53
+ end
50
54
end
51
55
52
56
# @api private
@@ -101,7 +105,7 @@ def supports_taint?
101
105
end
102
106
ripper_requirements = [ ComparableVersion . new ( RUBY_VERSION ) >= '1.9.2' ]
103
107
104
- ripper_requirements . push ( false ) if Ruby . rbx?
108
+ ripper_requirements . push ( false ) if Ruby . rbx? || Ruby . truffleruby?
105
109
106
110
if Ruby . jruby?
107
111
ripper_requirements . push ( Ruby . jruby_version >= '1.7.5' )
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ def ripper_works_correctly?
123
123
ripper_can_parse_source_including_keywordish_symbol?
124
124
end
125
125
126
+ def self . ripper_supported?
127
+ RubyFeatures . ripper_supported?
128
+ end
129
+
126
130
# https://github.com/jruby/jruby/issues/3386
127
131
def ripper_reports_correct_line_number?
128
132
in_sub_process_if_possible do
@@ -144,7 +148,7 @@ def ripper_can_parse_source_including_keywordish_symbol?
144
148
end
145
149
end
146
150
147
- it 'returns whether Ripper is correctly implemented in the current environment' do
151
+ it 'returns whether Ripper is correctly implemented in the current environment' , :if => ripper_supported? do
148
152
expect ( RubyFeatures . ripper_supported? ) . to eq ( ripper_is_implemented? && ripper_works_correctly? )
149
153
end
150
154
You can’t perform that action at this time.
0 commit comments