6

Idiosyncratic Ruby: Nothing to Disable

 3 years ago
source link: https://idiosyncratic-ruby.com/71-nothing-to-disable.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Nothing to Disable

Ruby's mode of operation can be altered with some --enable-* / --disable-* command-line switches.

By default, all of the following features are activated, except for the frozen strings and the JIT:

Feature CLI Option to Change Description RubyGems --disable-gems RubyGems is the package manager of Ruby, which is required to load 3rd party Ruby libraries¹. RUBYOPT --disable-rubyopt The RUBYOPT ENV variable lets you define default CLI options for Ruby. This switch tells Ruby to ignore RUBYOPT. DidYouMean --disable-did-you-mean² Improves error messages by suggesting auto-corrected method or module names Frozen strings --enable-frozen-string-literal³ Freezes all string literals everywhere. Just-in-time compiler --enable-jit Shortcut to enable is just --jit. New compiler architecture, introduced with Ruby 2.6. See @k0kubun's blog for more details. All of the above --disable-all / --enable-all -

¹ --disable-gems will also prevent did_you_mean from loading, because it is a standard gem
² Variants: --disable-did_you_mean, --disable-did-you_, --disable-did, --disable-d
³ Variants: --enable-frozen_string_literal, --enable-frozen_str, --enable-frozen, …

Also See

More Idiosyncratic Ruby


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK