class Gemfilings::Commands::Gem

Attributes

gem_names[RW]
gemfile[RW]
toggle_path[RW]

Public Class Methods

call(options = {}, gem_names) click to toggle source
# File lib/gemfilings/commands/gem.rb, line 21
def self.call(options = {}, gem_names)
  new(options, gem_names).call
end
new(options = {}, gem_names) click to toggle source
# File lib/gemfilings/commands/gem.rb, line 7
def initialize(options = {}, gem_names)
  self.toggle_path = options[:toggle_path]
  self.gemfile     = options[:gemfile]
  self.gem_names   = Array(gem_names)
end

Public Instance Methods

call() click to toggle source
# File lib/gemfilings/commands/gem.rb, line 13
def call
  if toggle_path
    gemfile.toggle_local_path(gem_names)
  end

  `bundle install`
end

Protected Instance Methods

gemfile=(other) click to toggle source
# File lib/gemfilings/commands/gem.rb, line 31
def gemfile=(other)
  @gemfile = Gemfile.new(File.expand_path(other || 'Gemfile'))
end