Class: RakeDependencies::Extractors::TarGzExtractor

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

Returns a new instance of TarGzExtractor.



106
107
108
109
110
# File 'lib/rake_dependencies/extractors.rb', line 106

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.



104
105
106
# File 'lib/rake_dependencies/extractors.rb', line 104

def extract_path
  @extract_path
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



104
105
106
# File 'lib/rake_dependencies/extractors.rb', line 104

def file_path
  @file_path
end

#optionsObject (readonly)

Returns the value of attribute options.



104
105
106
# File 'lib/rake_dependencies/extractors.rb', line 104

def options
  @options
end

Instance Method Details

#extractObject



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/rake_dependencies/extractors.rb', line 112

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