Sha256: 7506e474f8bd122af1b3822a30d1502e9477a48b0465e3cc83907da77c55168f

Contents?: true

Size: 939 Bytes

Versions: 2

Compression:

Stored size: 939 Bytes

Contents

require "lockfile_preserver/version"
require "lockfile_preserver/pipeline"
require "lockfile_preserver/bundled_with"
require "lockfile_preserver/ruby_version"
require "lockfile_preserver/platforms"

module LockfilePreserver
  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

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

    pipeline.call(original, updated)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lockfile_preserver-1.0.4 lib/lockfile_preserver.rb
lockfile_preserver-1.0.3 lib/lockfile_preserver.rb