Class: Librarian::Source::Path

Inherits:
Object
  • Object
show all
Includes:
BasicApi, Local
Defined in:
lib/librarian/source/path.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Local

#found_path, #manifest_search_paths, #manifests

Methods included from Librarian::Support::AbstractMethod

included

Methods included from BasicApi

included

Constructor Details

#initialize(environment, path, options) ⇒ Path

Returns a new instance of Path.



16
17
18
19
# File 'lib/librarian/source/path.rb', line 16

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

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



13
14
15
# File 'lib/librarian/source/path.rb', line 13

def environment
  @environment
end

#pathObject

Returns the value of attribute path.



13
14
15
# File 'lib/librarian/source/path.rb', line 13

def path
  @path
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



25
26
27
28
29
# File 'lib/librarian/source/path.rb', line 25

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

#cache!Object



52
53
# File 'lib/librarian/source/path.rb', line 52

def cache!
end

#filesystem_pathObject



55
56
57
# File 'lib/librarian/source/path.rb', line 55

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

#hashObject



33
34
35
# File 'lib/librarian/source/path.rb', line 33

def hash
  self.to_s.hash
end

#pinned?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/librarian/source/path.rb', line 45

def pinned?
  false
end

#to_lock_optionsObject



41
42
43
# File 'lib/librarian/source/path.rb', line 41

def to_lock_options
  {:remote => path}
end

#to_sObject



21
22
23
# File 'lib/librarian/source/path.rb', line 21

def to_s
  path.to_s
end

#to_spec_argsObject



37
38
39
# File 'lib/librarian/source/path.rb', line 37

def to_spec_args
  [path.to_s, {}]
end

#unpin!Object



49
50
# File 'lib/librarian/source/path.rb', line 49

def unpin!
end