Class: Phill::File

Inherits:
Object
  • Object
show all
Includes:
Archive::Tar
Defined in:
lib/phill/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ File

Returns a new instance of File.



10
11
12
# File 'lib/phill/file.rb', line 10

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/phill/file.rb', line 8

def path
  @path
end

Instance Method Details

#compressed_fileObject



19
20
21
# File 'lib/phill/file.rb', line 19

def compressed_file
  @compressed_file ||= File.open(compressed_path, 'rb')
end

#compressed_nameObject



23
24
25
# File 'lib/phill/file.rb', line 23

def compressed_name
  @compressed_name ||= compressed_path.gsub(/.*\//, '')
end

#processObject



14
15
16
17
# File 'lib/phill/file.rb', line 14

def process
  compress
  File.open(path, 'w').close
end