Skip to content

Instantly share code, notes, and snippets.

@javascripter
Created December 21, 2008 06:48
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 javascripter/38595 to your computer and use it in GitHub Desktop.
Save javascripter/38595 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require "rubygems"
require "mechanize"
URL = "http://stage.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-central-macosx/"
FILE_NAME = "latest_firefox.dmg"
agent = WWW::Mechanize.new
agent.get(URL).links.reverse.find {|link| %r(^¥d+/$) =~ link.text }.click.links.last.click.save_as(FILE_NAME)
puts "attach"
`hdiutil attach #{ FILE_NAME }`
puts "installing..."
`cp -r /Volumes/Minefield/Minefield.app /Applications/Minefield.app`
puts "eject"
`hdiutil detach /Volumes/Minefield`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment