Class: RocketFuel::Install::Download
- Inherits:
-
Object
- Object
- RocketFuel::Install::Download
- Defined in:
- lib/rocket_fuel/install/download.rb
Constant Summary collapse
- URL =
'https://codeload.github.com/LaunchAcademy/rocket-fuel-chef/tar.gz/master'
Instance Method Summary collapse
Instance Method Details
#extract ⇒ Object
20 21 22 23 |
# File 'lib/rocket_fuel/install/download.rb', line 20 def extract FileUtils.mkdir_p(recipe_path) `tar xvfz #{archive_path} -C #{File.join(recipe_path, '..') }` end |
#retrieve ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/rocket_fuel/install/download.rb', line 11 def retrieve http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true resp = http.get(uri.request_uri) open(archive_path, "wb") do |file| file.write(resp.body) end end |