Class: FPM::Fry::Source::Dir::Cache
- Inherits:
-
Struct
- Object
- Struct
- FPM::Fry::Source::Dir::Cache
- Extended by:
- Forwardable
- Defined in:
- lib/fpm/fry/source/dir.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#package ⇒ Object
Returns the value of attribute package.
Instance Method Summary collapse
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir
21 22 23 |
# File 'lib/fpm/fry/source/dir.rb', line 21 def dir @dir end |
#package ⇒ Object
Returns the value of attribute package
21 22 23 |
# File 'lib/fpm/fry/source/dir.rb', line 21 def package @package end |
Instance Method Details
#cachekey ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/fpm/fry/source/dir.rb', line 35 def cachekey dig = Digest::SHA2.new tar_io.each(1024) do |block| dig << block end return dig.hexdigest end |
#copy_to(dst) ⇒ Object
30 31 32 33 |
# File 'lib/fpm/fry/source/dir.rb', line 30 def copy_to(dst) children = ::Dir.new(dir).select{|x| x[0...1] != "." }.map{|x| File.join(dir,x) } FileUtils.cp_r(children, dst) end |