class Bundler::CLI::Config - bundler: Ruby Standard Library Documentation

# class Bundler::CLI::Config

### Private Class Methods

scope_options() click to toggle source

    # File bundler/cli/config.rb, line 7
    def self.scope_options
      method_option :global, type: :boolean, banner: "Only change the global config"
      method_option :local, type: :boolean, banner: "Only change the local config"
    end

### Public Instance Methods

base(name = nil, *value) click to toggle source

    # File bundler/cli/config.rb, line 16
    def base(name = nil, *value)
      new_args =
        if ARGV.size == 1
          ["config", "list"]
        elsif ARGV.include?("--delete")
          ARGV.map {|arg| arg == "--delete" ? "unset" : arg }
        elsif ARGV.include?("--global") || ARGV.include?("--local") || ARGV.size == 3
          ["config", "set", *ARGV[1..-1]]
        else
          ["config", "get", ARGV[1]]
        end

      message = "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
      removed_message = "Using the `config` command without a subcommand [list, get, set, unset] is has been removed. Use `bundle #{new_args.join(" ")}` instead."
      SharedHelpers.major_deprecation 3, message, removed_message: removed_message

      Base.new(options, name, value, self).run
    end

get(name) click to toggle source

    # File bundler/cli/config.rb, line 41
    def get(name)
      Base.new(options, name, nil, self).run
    end

list() click to toggle source

    # File bundler/cli/config.rb, line 36
    def list
      Base.new(options, nil, nil, self).run
    end

set(name, value, *value_) click to toggle source

    # File bundler/cli/config.rb, line 47
    def set(name, value, *value_)
      Base.new(options, name, value_.unshift(value), self).run
    end

unset(name) click to toggle source

    # File bundler/cli/config.rb, line 53
    def unset(name)
      options[:delete] = true
      Base.new(options, name, nil, self).run
    end