Sha256: ad9e1651c803b92dca99e5bf0b37d6ed77cd2d8242181597fee107f68ed8c2c2

Contents?: true

Size: 1.39 KB

Versions: 20

Compression:

Stored size: 1.39 KB

Contents

require 'librarian/source/local'

module Librarian
  module Source
    class Path

      include Local

      class << self

        LOCK_NAME = 'PATH'

        def lock_name
          LOCK_NAME
        end

        def from_lock_options(environment, options)
          new(environment, options[:remote], options.reject{|k, v| k == :remote})
        end

        def from_spec_args(environment, path, options)
          recognized_options = []
          unrecognized_options = options.keys - recognized_options
          unrecognized_options.empty? or raise Error, "unrecognized options: #{unrecognized_options.join(", ")}"

          new(environment, path, options)
        end

      end

      attr_accessor :environment
      private :environment=
      attr_reader :path

      def initialize(environment, path, options)
        self.environment = environment
        @path = path
      end

      def to_s
        path.to_s
      end

      def ==(other)
        other &&
        self.class  == other.class &&
        self.path   == other.path
      end

      def to_spec_args
        [path.to_s, {}]
      end

      def to_lock_options
        {:remote => path}
      end

      def pinned?
        false
      end

      def unpin!
      end

      def cache!
      end

      def filesystem_path
        @filesystem_path ||= Pathname.new(path).expand_path(environment.project_path)
      end

    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
librarian-puppet-maestrodev-0.9.7.5 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-maestrodev-0.9.7.4 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-maestrodev-0.9.7.3 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-maestrodev-0.9.7.2 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-maestrodev-0.9.7.1 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-maestrodev-0.9.7 vendor/librarian/lib/librarian/source/path.rb
librarian-0.0.25 lib/librarian/source/path.rb
librarian-puppet-0.9.7 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-0.9.6 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-0.9.5 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-0.9.4 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-0.9.3 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-0.9.2 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-0.9.2.pre vendor/librarian/lib/librarian/source/path.rb
librarian-0.0.24 lib/librarian/source/path.rb
librarian-puppet-0.9.1 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-0.9.0 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-0.0.1.pre2 vendor/librarian/lib/librarian/source/path.rb
librarian-puppet-0.0.1.pre vendor/librarian/lib/librarian/source/path.rb
librarian-0.0.23 lib/librarian/source/path.rb