Sha256: dfa3e236d2b9a8dba7895e1bd4b17c13d829c0cd456ba18a7a5b5d11d2e2d7e3

Contents?: true

Size: 547 Bytes

Versions: 3

Compression:

Stored size: 547 Bytes

Contents

module DRG
  module Tasks
    class Pinner
      attr_reader :gemfile

      def initialize(gemfile = Gemfile.new)
        @gemfile = gemfile
      end

      def perform
        log %Q(Pinning Gemfile "#{gemfile}")
        ::Bundler.locked_gems.specs.each do |spec|
          gem = gemfile.find_by_name(spec.name)
          next unless gem
          gemfile.update(gem, spec.version)
        end
        gemfile.write
        log %Q(Done)
      end

      private

      def log(msg = nil)
        puts %Q(  * #{msg})
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
drg-0.3.0 lib/drg/tasks/pinner.rb
drg-0.2.1 lib/drg/tasks/pinner.rb
drg-0.2.0 lib/drg/tasks/pinner.rb