Permalink
Browse files

Refactor

  • Loading branch information...
1 parent 38a29a3 commit d1a6472def2585f9edd49ef2db32d12107f1c408 @Nerian committed Dec 15, 2011
View
@@ -26,8 +26,7 @@ parser = OptionParser.new do |opts|
end
end
puts "Using #{options[:akephalos_jvm_max_memory]} MB for the JVM"
-
- ENV['htmlunit_version'] ||= "2.9"
+
HtmlUnit.download_htmlunit(ENV["htmlunit_version"])
opts.on_tail("-h", "--help", "Show this message") { puts opts; exit }
View
@@ -8,9 +8,9 @@
module Akephalos
BIN_DIR = Pathname(__FILE__).expand_path.dirname.parent + 'bin'
- ENV['htmlunit_version'] ||= "2.9"
end
+require 'akephalos/htmlunit_downloader'
require 'akephalos/client'
require 'capybara'
require 'akephalos/capybara'
@@ -1,7 +1,9 @@
require "pathname"
require "java"
-Dir["#{Dir.pwd}/.akephalos/#{ENV['htmlunit_version']}/*.jar"].each {|file| require file }
+HtmlUnit.download_htmlunit(ENV["htmlunit_version"])
+
+Dir["#{Dir.pwd}/.akephalos/#{ENV['htmlunit_version']}/*.jar"].each {|file| require file;}
java.lang.System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog")
java.lang.System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "fatal")
@@ -1,5 +1,6 @@
module HtmlUnit
def self.download_htmlunit(version)
+ version ||= "2.9"
if not version_exist?(version)
puts "Installing HTMLUnit #{version} at .akephalos/#{version}/"
Dir.mkdir(".akephalos") unless File.exists?(".akephalos")
@@ -1,4 +1,4 @@
-require_relative "../../lib/akephalos/htmlunit_downloader"
+require 'spec_helper'
unless ENV['TRAVIS']
describe "Download HTMLUnit" do

0 comments on commit d1a6472

Please sign in to comment.