Skip to content

Instantly share code, notes, and snippets.

@leejarvis

leejarvis/x.rb Secret

Created February 25, 2016 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leejarvis/d3a8977f523f95eba8f6 to your computer and use it in GitHub Desktop.
Save leejarvis/d3a8977f523f95eba8f6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def get_files(url, file, destination)
case File.extname(file)
when ".tar.gz", ".zip"
unpack_archive(url, file, description)
when ".git"
git "destination" do
repository "#{url}/#{file}"
reference "master"
user node["apache"]["user"]
action :sync
end
else
raise ArgumentError, "dunno how to handle #{file}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment