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.



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

def initialize(environment, path, options)
  self.environment = environment
  @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 (readonly)

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

#==(other) ⇒ Object



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

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

#cache!Object



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

def cache!
end

#filesystem_pathObject



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

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

#pinned?Boolean

Returns:

  • (Boolean)


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

def pinned?
  false
end

#to_lock_optionsObject



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

def to_lock_options
  {:remote => path}
end

#to_sObject



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

def to_s
  path.to_s
end

#to_spec_argsObject



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

def to_spec_args
  [path.to_s, {}]
end

#unpin!Object



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

def unpin!
end