Class: Selenium::Starter
- Inherits:
-
Object
- Object
- Selenium::Starter
- Defined in:
- lib/selenium/starter.rb
Constant Summary collapse
- SELENIUM_SERVER_VERSION =
"2.37.0"
- USAGE =
<<-TEXT Usage: selenium help - this help selenium install - installs selenium selenium - runs the selenium server TEXT
Instance Attribute Summary collapse
-
#wrapper ⇒ Object
readonly
Returns the value of attribute wrapper.
Instance Method Summary collapse
-
#initialize ⇒ Starter
constructor
A new instance of Starter.
- #install_dir ⇒ Object
- #run(params) ⇒ Object
Constructor Details
#initialize ⇒ Starter
Returns a new instance of Starter.
17 18 19 |
# File 'lib/selenium/starter.rb', line 17 def initialize @wrapper = JarWrapper::Runner.new end |
Instance Attribute Details
#wrapper ⇒ Object (readonly)
Returns the value of attribute wrapper.
15 16 17 |
# File 'lib/selenium/starter.rb', line 15 def wrapper @wrapper end |
Instance Method Details
#install_dir ⇒ Object
46 47 48 |
# File 'lib/selenium/starter.rb', line 46 def install_dir ENV['HOME'] + "/.selenium/assets" end |
#run(params) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/selenium/starter.rb', line 21 def run params selenium_version = SELENIUM_SERVER_VERSION param = params.length == 0 ? "" : params.first case param when /(-v)|(--version)/ then puts "Version: #{Selenium::VERSION}" when 'install' then source = "http://selenium.googlecode.com/files/selenium-server-#{selenium_version}.zip" target = install_dir + "/selenium-server-#{selenium_version}.zip" wrapper.install source, target puts "" when 'help' then puts USAGE and return else jar_file = install_dir + "/selenium-#{selenium_version}/selenium-server-standalone-#{selenium_version}.jar" wrapper.jar_file = jar_file wrapper.java_opts = [] wrapper.run params.nil? ? [] : params end end |