Sha256: 4e219835c096f8674c79717200729362380bb4aacfd687c0b631e17329b376cb

Contents?: true

Size: 959 Bytes

Versions: 8

Compression:

Stored size: 959 Bytes

Contents

require 'librarian/particularity'
require 'librarian/source/local'

module Librarian
  module Source
    class Path

      include Particularity
      include Local

      class << self
        LOCK_NAME = 'PATH'
        def lock_name
          LOCK_NAME
        end
        def from_lock_options(options)
          new(options[:remote], options.reject{|k, v| k == :remote})
        end
      end

      attr_reader :path

      def initialize(path, options)
        @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 cache!(dependencies)
      end

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

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
librarian-0.0.9 lib/librarian/source/path.rb
librarian-0.0.8 lib/librarian/source/path.rb
librarian-0.0.7 lib/librarian/source/path.rb
librarian-0.0.6 lib/librarian/source/path.rb
librarian-0.0.5 lib/librarian/source/path.rb
librarian-0.0.4 lib/librarian/source/path.rb
librarian-0.0.3 lib/librarian/source/path.rb
librarian-0.0.2 lib/librarian/source/path.rb