Class: Bundler::CLI::Add

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/cli/add.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, gems) ⇒ Add

Returns a new instance of Add.



7
8
9
10
11
12
# File 'lib/bundler/cli/add.rb', line 7

def initialize(options, gems)
  @gems = gems
  @options = options
  @options[:group] = options[:group].split(",").map(&:strip) unless options[:group].nil?
  @version = options[:version].split(",").map(&:strip) unless options[:version].nil?
end

Instance Attribute Details

#gemsObject (readonly)

Returns the value of attribute gems.



5
6
7
# File 'lib/bundler/cli/add.rb', line 5

def gems
  @gems
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/bundler/cli/add.rb', line 5

def options
  @options
end

#versionObject (readonly)

Returns the value of attribute version.



5
6
7
# File 'lib/bundler/cli/add.rb', line 5

def version
  @version
end

Instance Method Details

#runObject



14
15
16
17
18
# File 'lib/bundler/cli/add.rb', line 14

def run
  validate_options!
  inject_dependencies
  perform_bundle_install unless options["skip-install"]
end