Module: LockfilePreserver

Defined in:
lib/lockfile_preserver.rb,
lib/lockfile_preserver/version.rb,
lib/lockfile_preserver/pipeline.rb,
lib/lockfile_preserver/platforms.rb,
lib/lockfile_preserver/bundled_with.rb,
lib/lockfile_preserver/ruby_version.rb

Defined Under Namespace

Classes: BundledWith, Pipeline, Platforms, RubyVersion

Constant Summary collapse

VERSION =
"1.0.4".freeze

Class Method Summary collapse

Class Method Details

.keep(original, updated, section = :bundled_with) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/lockfile_preserver.rb', line 8

def self.keep(original, updated, section = :bundled_with)
  if section == :bundled_with
    LockfilePreserver::BundledWith.new(original, updated).keep
  elsif section == :ruby_version
    LockfilePreserver::RubyVersion.new(original, updated).keep
  elsif section == :platforms
    LockfilePreserver::Platforms.new(original, updated).keep
  elsif
    abort %(We currently only support preserve "BUNDLED WITH" & "RUBY VERSION" section of lockfile.)
  end
end

.keep_all(original, updated) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/lockfile_preserver.rb', line 20

def self.keep_all(original, updated)
  pipeline = Pipeline.new [
    LockfilePreserver::BundledWith,
    LockfilePreserver::RubyVersion,
    LockfilePreserver::Platforms,
  ]

  pipeline.call(original, updated)
end