Class: RakeDependencies::Extractors::UncompressedExtractor
- Inherits:
-
Object
- Object
- RakeDependencies::Extractors::UncompressedExtractor
- Defined in:
- lib/rake_dependencies/extractors.rb
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(file_path, extract_path, options = {}) ⇒ UncompressedExtractor
constructor
A new instance of UncompressedExtractor.
Constructor Details
#initialize(file_path, extract_path, options = {}) ⇒ UncompressedExtractor
Returns a new instance of UncompressedExtractor.
74 75 76 77 78 |
# File 'lib/rake_dependencies/extractors.rb', line 74 def initialize(file_path, extract_path, = {}) @file_path = file_path @extract_path = extract_path @options = end |
Instance Method Details
#extract ⇒ Object
80 81 82 83 84 85 86 87 88 |
# File 'lib/rake_dependencies/extractors.rb', line 80 def extract target_name = @options[:rename_to] || File.basename(@file_path) source = @file_path destination = File.join(@extract_path, target_name) FileUtils.mkdir_p(@extract_path) FileUtils.cp(source, destination) FileUtils.chmod(0755, destination) end |