Last active
December 21, 2015 15:38
-
-
Save akiray03/6327546 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ruby t.rb | |
| OK | |
| $ ./tmp/mruby/bin/mruby t.rb | |
| not found class A | |
| t.rb:11: uninitialized constant A (NameError) | |
| $ ./tmp/mruby/bin/mruby t2.rb | |
| OK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A | |
| end | |
| module Kernel | |
| def hoge | |
| A # found class A | |
| begin | |
| ['a'].each do |i| | |
| A # not found class A | |
| puts "OK" | |
| end | |
| rescue NameError => e | |
| puts "not found class A" | |
| p e | |
| end | |
| end | |
| end | |
| hoge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A | |
| end | |
| module Hoge | |
| def hoge | |
| A # found class A | |
| begin | |
| ['a'].each do |i| | |
| A # not found class A | |
| puts "OK" | |
| end | |
| rescue NameError => e | |
| puts "not found class A" | |
| p e | |
| end | |
| end | |
| end | |
| include Hoge | |
| hoge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment