Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add Firefox addon #98

Merged
merged 5 commits into from Apr 8, 2013

Conversation

Projects
None yet
2 participants
Contributor

henrikhodne commented Apr 8, 2013

This allows a user to download and install a specific version of Firefox

@joshk joshk and 1 other commented on an outdated diff Apr 8, 2013

lib/travis/build/script/addons/firefox.rb
+module Travis
+ module Build
+ class Script
+ module Addons
+ class Firefox
+ def initialize(script, config)
+ @script = script
+ @firefox_version = config.to_s
+ end
+
+ def before_install
+ @script.fold('install_firefox') do |script|
+ script.cmd "echo -e \"\033[33;1mInstalling Firefox v#@firefox_version\033[0m\"; ", assert: false, echo: false
+ script.cmd "sudo mkdir -p /usr/local/firefox", assert: false
+ script.cmd "sudo chown travis /usr/local/firefox", assert: false
+ script.cmd "wget -O /tmp/firefox.tar.bz2 ftp://ftp.mozilla.org/pub/firefox/releases/#@firefox_version/linux-x86_64/en-US/firefox-#@firefox_version.tar.bz2", assert: false
@joshk

joshk Apr 8, 2013

Owner

shouldn't this be #{} ?

@henrikhodne

henrikhodne Apr 8, 2013

Contributor

The {}s aren't required for instance and global variables, but when you mention it I think it's a little bit clearer when you include them. Added them in 688ab55.

@joshk joshk commented on an outdated diff Apr 8, 2013

lib/travis/build/script/addons/firefox.rb
@@ -0,0 +1,28 @@
+module Travis
+ module Build
+ class Script
+ module Addons
+ class Firefox
+ def initialize(script, config)
+ @script = script
+ @firefox_version = config.to_s
+ end
+
+ def before_install
+ @script.fold('install_firefox') do |script|
+ script.cmd "echo -e \"\033[33;1mInstalling Firefox v#@firefox_version\033[0m\"; ", assert: false, echo: false
+ script.cmd "sudo mkdir -p /usr/local/firefox", assert: false
+ script.cmd "sudo chown travis /usr/local/firefox", assert: false
@joshk

joshk Apr 8, 2013

Owner

should we maybe version the firefox dir?

@henrikhodne henrikhodne Add {} around interpolated instance variables
This isn't required, but it makes the strings a little bit clearer.
688ab55

@joshk joshk and 1 other commented on an outdated diff Apr 8, 2013

lib/travis/build/script/addons/firefox.rb
@@ -0,0 +1,28 @@
+module Travis
+ module Build
+ class Script
+ module Addons
+ class Firefox
+ def initialize(script, config)
+ @script = script
+ @firefox_version = config.to_s
+ end
+
+ def before_install
+ @script.fold('install_firefox') do |script|
+ script.cmd "echo -e \"\033[33;1mInstalling Firefox v#{@firefox_version}\033[0m\"; ", assert: false, echo: false
+ script.cmd "sudo mkdir -p /usr/local/firefox", assert: false
@joshk

joshk Apr 8, 2013

Owner

can we version the firefox dir? eg. /usr/local/firefox-20.0

@henrikhodne

henrikhodne Apr 8, 2013

Contributor

Oops, forgot to push the code for that. Added in 7385c5c.

@joshk joshk added a commit that referenced this pull request Apr 8, 2013

@joshk joshk Merge pull request #98 from travis-ci/hh-addons-firefox
Add Firefox addon
4133346

@joshk joshk merged commit 4133346 into master Apr 8, 2013

@henrikhodne henrikhodne deleted the hh-addons-firefox branch Apr 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment