Class: DakeScheme::Local

Inherits:
Scheme
  • Object
show all
Defined in:
lib/dake/scheme.rb

Constant Summary collapse

PATTERN =
['local:']

Instance Attribute Summary

Attributes inherited from Scheme

#path, #src, #step

Instance Method Summary collapse

Methods inherited from Scheme

#checksum

Constructor Details

#initialize(scheme_part, path_part, step) ⇒ Local

Returns a new instance of Local.



36
37
38
39
40
41
42
43
44
45
# File 'lib/dake/scheme.rb', line 36

def initialize(scheme_part, path_part, step)
  if path_part.start_with? '/'
   @path = path_part
   @src = Pathname.new(path_part).relative_path_from(step.context['BASE'])
  else
    @path = File.expand_path(path_part, step.context['BASE'])
    @src = path_part
  end
  @step = step
end

Instance Method Details

#exist?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/dake/scheme.rb', line 51

def exist?
  File.exist?(@path)
end

#mtimeObject



47
48
49
# File 'lib/dake/scheme.rb', line 47

def mtime
  File.mtime(@path)
end