class Bundler::FeatureFlag - bundler-1.15.4 Documentation

# class Bundler::FeatureFlag

### Public Class Methods

new(bundler_version) click to toggle source

    # File lib/bundler/feature_flag.rb, line 20
    def initialize(bundler_version)
      @bundler_version = Gem::Version.create(bundler_version)
    end

### Private Class Methods

settings_flag(flag, &default) click to toggle source

    # File lib/bundler/feature_flag.rb, line 3
    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
      define_method("#{flag}?") do
        value = Bundler.settings[flag]
        value = instance_eval(&default) if value.nil? && !default.nil?
        value
      end
    end

### Private Instance Methods

major_version() click to toggle source

    # File lib/bundler/feature_flag.rb, line 24
    def major_version
      @bundler_version.segments.first
    end