Class: Bundler::FeatureFlag
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/bundler/feature_flag.rb |
Class Method Summary
- .new(bundler_version) ⇒ FeatureFlag constructor
- .settings_flag(flag, &default) private
- .settings_method(name, key, &default) private
- .settings_option(key, &default) private
Instance Method Summary
- #major_version private
Constructor Details
.new(bundler_version) ⇒ FeatureFlag
# File 'lib/bundler/feature_flag.rb', line 46
def initialize(bundler_version) @bundler_version = Gem::Version.create(bundler_version) end
Class Method Details
.settings_flag(flag, &default) (private)
[ GitHub ]# File 'lib/bundler/feature_flag.rb', line 5
def self.settings_flag(flag, &default) unless Bundler::Settings::BOOL_KEYS.include?(flag.to_s) raise "Cannot use `#{flag}` as a settings feature flag since it isn't a bool key" end settings_method("#{flag}?", flag, &default) end
.settings_method(name, key, &default) (private)
[ GitHub ].settings_option(key, &default) (private)
[ GitHub ]# File 'lib/bundler/feature_flag.rb', line 14
def self.settings_option(key, &default) settings_method(key, key, &default) end
Instance Method Details
#major_version (private)
[ GitHub ]# File 'lib/bundler/feature_flag.rb', line 50
def major_version @bundler_version.segments.first end