Runtime assertions for Ruby literal.fun
ruby
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Attempt improved compatibility

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

+12 -5
+1 -1
Gemfile
··· 6 6 7 7 gem "quickdraw", git: "https://github.com/joeldrapper/quickdraw.git" 8 8 gem "benchmark-ips" 9 - gem "solargraph" 9 + gem "solargraph", platform: :ruby 10 10 gem "rubocop" 11 11 gem "ruby-lsp" 12 12 gem "simplecov"
+1
Gemfile.lock
··· 114 114 arm64-darwin 115 115 java 116 116 ruby 117 + universal-java-19 117 118 x86-linux 118 119 x86_64-darwin 119 120 x86_64-linux
+6 -4
lib/literal/enum.rb
··· 171 171 end 172 172 end 173 173 174 - TracePoint.trace(:end) do |tp| 175 - it = tp.self 174 + if RUBY_ENGINE != "truffleruby" 175 + TracePoint.trace(:end) do |tp| 176 + it = tp.self 176 177 177 - if Class === it && it < Literal::Enum 178 - it.__after_defined__ 178 + if Class === it && it < Literal::Enum 179 + it.__after_defined__ 180 + end 179 181 end 180 182 end
+4
test/enum.test.rb
··· 14 14 Red = new(1, hex: "#FF0000") 15 15 Green = new(2, hex: "#00FF00") 16 16 Blue = new(3, hex: "#0000FF") 17 + 18 + __after_defined__ if RUBY_ENGINE == "truffleruby" 17 19 end 18 20 19 21 class Switch < Literal::Enum(_Boolean) ··· 24 26 Off = new(false) do 25 27 def toggle = On 26 28 end 29 + 30 + __after_defined__ if RUBY_ENGINE == "truffleruby" 27 31 end 28 32 29 33 test do