Created
February 26, 2018 08:02
-
-
Save sugamasao/9220562315cd53ed7c835a8cf400d122 to your computer and use it in GitHub Desktop.
標準ライブラリをrequireしたい
This file contains 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
# こんな感じでできそうだけど、内容があってるかは確認してない | |
Dir.glob(File.join(RbConfig.expand("$(libdir)"), 'ruby', "#{ RUBY_VERSION.split('.')[0, 2].join('.') }.0", "*.rb")).each do |path| | |
name = File.basename(path, ".rb") | |
next if %w(profile debug).include? name # こいつらをrequireするとプログラムが色々動いてしまうので除外 | |
require name | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment