Skip to content

Commit

Permalink
Reorganize firefox commands: They are now firefox and `firefox --se…
Browse files Browse the repository at this point in the history
…tup VERSION`
  • Loading branch information
codener committed Dec 23, 2015
1 parent 82a43e3 commit 3662f68
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
30 changes: 30 additions & 0 deletions lib/geordi/commands/firefox.rb
@@ -0,0 +1,30 @@
desc 'firefox COMMAND', 'Run a command with firefox for selenium set up'
long_desc <<-LONGDESC
Example: `geordi firefox b cucumber` or `geordi firefox --setup 24.0`
Useful when you need Firefox for Selenium, but can't use the `geordi cucumber`
command.
*Install* a special Firefox by calling with `--setup <version>`.
LONGDESC

option :setup, :type => :string, :banner => 'setup=FIREFOX_VERSION',
:desc => 'If set, will install a special Firefox with the given version'

def firefox(*command)
if options.setup
require 'geordi/firefox_for_selenium'
Geordi::FirefoxForSelenium.install(options.setup)

else
note 'Setting up Firefox for Selenium ...'

require 'geordi/cucumber'
Cucumber.new.setup_vnc
FirefoxForSelenium.setup_firefox

puts
note_cmd command.join(' ')
system *command # Util.system! would reset the Firefox PATH
end
end
6 changes: 0 additions & 6 deletions lib/geordi/commands/setup_firefox_for_selenium.rb

This file was deleted.

18 changes: 0 additions & 18 deletions lib/geordi/commands/with_firefox_for_selenium.rb

This file was deleted.

6 changes: 3 additions & 3 deletions lib/geordi/firefox_for_selenium.rb
Expand Up @@ -227,10 +227,10 @@ def kkthxbb
puts
puts strip_heredoc(<<-INSTRUCTION)
Your patched copy of Firefox will be used when you run Cucumber using
the cucumber script that comes with the geordi gem. If you prefer to run
Cucumber on your own, you must call it like this:
the cucumber script that comes with the geordi gem. If you cannot use
`geordi cucumber`, but still need the test browser set up, you can use:
PATH=#{path}:$PATH cucumber
geordi firefox <any command>
Enjoy!
INSTRUCTION
Expand Down

0 comments on commit 3662f68

Please sign in to comment.