Class: RakeDependencies::Extractors::UncompressedExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/rake_dependencies/extractors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path, extract_path, options = {}) ⇒ UncompressedExtractor

Returns a new instance of UncompressedExtractor.



203
204
205
206
207
# File 'lib/rake_dependencies/extractors.rb', line 203

def initialize(file_path, extract_path, options = {})
  @file_path = file_path
  @extract_path = extract_path
  @options = options
end

Instance Attribute Details

#extract_pathObject (readonly)

Returns the value of attribute extract_path.



201
202
203
# File 'lib/rake_dependencies/extractors.rb', line 201

def extract_path
  @extract_path
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



201
202
203
# File 'lib/rake_dependencies/extractors.rb', line 201

def file_path
  @file_path
end

#optionsObject (readonly)

Returns the value of attribute options.



201
202
203
# File 'lib/rake_dependencies/extractors.rb', line 201

def options
  @options
end

Instance Method Details

#extractObject



209
210
211
212
213
214
215
216
217
# File 'lib/rake_dependencies/extractors.rb', line 209

def extract
  target_name = rename_to || file_name
  source_path = file_path
  target_path = relative_to_extract_directory(target_name)

  create_extract_directory
  move(source_path, target_path)
  fix_permissions(target_path)
end