Sha256: 9f54d1eb645beb0d5a26e70403acfbc3cb8c570b7b4bc282a0dd5e626eac5bef

Contents?: true

Size: 532 Bytes

Versions: 2

Compression:

Stored size: 532 Bytes

Contents

require 'bundler'

module Blakey
  module Repository
    class Ruby::RubyVersionFetcher

      def initialize(gemfile_lock_parser:, source:)
        @gemfile_lock_parser = gemfile_lock_parser
        @source              = source
      end

      def version
        gemfile_lock_parser.ruby_version || fetch_version_from_ruby_version_file
      end

      private

      attr_reader :gemfile_lock_parser, :source

      def fetch_version_from_ruby_version_file
        source.read_file('.ruby-version')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blakey-0.3.0 lib/blakey/repository/ruby/ruby_version_fetcher.rb
blakey-0.1.0 lib/blakey/repository/ruby/ruby_version_fetcher.rb