Class: Bundler::Interactive::OutdatedGem

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/interactive/outdated_gem.rb

Constant Summary collapse

VERSION_NAMES =
%w[MAJOR MINOR PATCH].freeze

Instance Method Summary collapse

Constructor Details

#initialize(current_spec, active_spec, dependency) ⇒ OutdatedGem

Returns a new instance of OutdatedGem.



8
9
10
11
12
# File 'lib/bundler/interactive/outdated_gem.rb', line 8

def initialize(current_spec, active_spec, dependency)
  @current_spec = current_spec
  @active_spec = active_spec
  @dependency = dependency
end

Instance Method Details

#active_versionObject



22
23
24
# File 'lib/bundler/interactive/outdated_gem.rb', line 22

def active_version
  active_spec.version
end

#current_versionObject



18
19
20
# File 'lib/bundler/interactive/outdated_gem.rb', line 18

def current_version
  current_spec.version
end

#labelObject



26
27
28
29
30
31
# File 'lib/bundler/interactive/outdated_gem.rb', line 26

def label
  "#{version_label.ljust(10)} " \
    "newest #{active_version.to_s.ljust(10)} " \
    "installed #{current_version.to_s.ljust(10)} " \
    "#{dependency_text.ljust(20)}"
end

#name(padding = 0) ⇒ Object



14
15
16
# File 'lib/bundler/interactive/outdated_gem.rb', line 14

def name(padding = 0)
  current_spec.name.ljust(padding)
end