Class: RakeDependencies::Extractors::ZipExtractor

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 = {}) ⇒ ZipExtractor

Returns a new instance of ZipExtractor.



13
14
15
16
17
# File 'lib/rake_dependencies/extractors.rb', line 13

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.



11
12
13
# File 'lib/rake_dependencies/extractors.rb', line 11

def extract_path
  @extract_path
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



11
12
13
# File 'lib/rake_dependencies/extractors.rb', line 11

def file_path
  @file_path
end

#optionsObject (readonly)

Returns the value of attribute options.



11
12
13
# File 'lib/rake_dependencies/extractors.rb', line 11

def options
  @options
end

Instance Method Details

#extractObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rake_dependencies/extractors.rb', line 19

def extract
  create_extract_directory
  extract_files

  return unless requires_rename?

  rename(
    relative_to_extract_directory(rename_from),
    relative_to_extract_directory(rename_to)
  )
end