akephalos2 2.1.1.2 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -44,6 +44,21 @@ Akephalos creates a `.akephalos` folder where it stores HTMLUnit binaries. You s
44
44
  git ignore .akephalos
45
45
  ```
46
46
 
47
+ ### Windows
48
+
49
+ You will need to manually download HTMLUnit, extract it and save it to `.akephalos/:version`.
50
+
51
+ http://sourceforge.net/projects/htmlunit/files/htmlunit/
52
+
53
+ For example:
54
+
55
+ * Download [htmlunit-2.9-bin.zip](http://sourceforge.net/projects/htmlunit/files/latest/download?source=files)
56
+ * Extract it
57
+ * You will get a folder named `htmlunit-2.9`. Rename it to just `2.9`
58
+ * Create the folder `.akephalos` in your project folder
59
+ * Move the `2.9` folder inside `.akephalos`
60
+
61
+ You are done, run your tests.
47
62
 
48
63
  # Questions, bugs, etc:
49
64
 
data/bin/akephalos CHANGED
@@ -26,8 +26,7 @@ parser = OptionParser.new do |opts|
26
26
  end
27
27
  end
28
28
  puts "Using #{options[:akephalos_jvm_max_memory]} MB for the JVM"
29
-
30
- ENV['htmlunit_version'] ||= "2.9"
29
+
31
30
  HtmlUnit.download_htmlunit(ENV["htmlunit_version"])
32
31
 
33
32
  opts.on_tail("-h", "--help", "Show this message") { puts opts; exit }
data/lib/akephalos.rb CHANGED
@@ -8,9 +8,10 @@ require 'pathname'
8
8
 
9
9
  module Akephalos
10
10
  BIN_DIR = Pathname(__FILE__).expand_path.dirname.parent + 'bin'
11
- ENV['htmlunit_version'] ||= "2.9"
11
+ ENV['htmlunit_version'] ||= "2.9"
12
12
  end
13
13
 
14
+ require 'akephalos/htmlunit_downloader'
14
15
  require 'akephalos/client'
15
16
  require 'capybara'
16
17
  require 'akephalos/capybara'
@@ -1,5 +1,6 @@
1
1
  module HtmlUnit
2
2
  def self.download_htmlunit(version)
3
+ version ||= "2.9"
3
4
  if not version_exist?(version)
4
5
  puts "Installing HTMLUnit #{version} at .akephalos/#{version}/"
5
6
  Dir.mkdir(".akephalos") unless File.exists?(".akephalos")
@@ -17,9 +18,7 @@ module HtmlUnit
17
18
  end
18
19
 
19
20
  def self.unzip(version)
20
- `unzip htmlunit-#{version}.zip`
21
- `mv -f htmlunit-2.10-SNAPSHOT htmlunit-2.10 > /dev/null 2>&1`
22
- `cp -r htmlunit-#{version}/lib/ .akephalos/#{version}/`
21
+ `unzip -o -j -d .akephalos/#{version} htmlunit-#{version}.zip`
23
22
  end
24
23
 
25
24
  def self.download(version)
@@ -14,13 +14,13 @@ module Akephalos
14
14
  # client = Akephalos::RemoteClient.new
15
15
  # client.visit "http://www.oinopa.com"
16
16
  # client.page.source # => "<!DOCTYPE html PUBLIC..."
17
- class RemoteClient
18
-
17
+ class RemoteClient
18
+
19
19
  # @return [DRbObject] a new instance of Akephalos::Client from the DRb
20
20
  # server
21
21
  def self.new(options = {})
22
- manager.new_client(options)
23
- end
22
+ manager.new_client(options)
23
+ end
24
24
 
25
25
  # Starts a remove JRuby DRb server unless already running and returns an
26
26
  # instance of Akephalos::ClientManager.
@@ -41,12 +41,12 @@ module Akephalos
41
41
  manager.configuration = Akephalos.configuration.extend(DRbUndumped)
42
42
 
43
43
  @manager = manager
44
- end
44
+ end
45
45
 
46
46
  # Start a remote server process and return when it is available for use.
47
47
  def self.start!
48
- port = find_available_port
49
-
48
+ port = find_available_port
49
+
50
50
  remote_client = IO.popen("ruby #{Akephalos::BIN_DIR + 'akephalos'} #{port}")
51
51
 
52
52
  # Set up a monitor thread to detect if the forked server exits
@@ -62,7 +62,13 @@ module Akephalos
62
62
 
63
63
  # Ensure that the remote server shuts down gracefully when we are
64
64
  # finished.
65
- at_exit { Process.kill(:INT, remote_client.pid) }
65
+ at_exit {
66
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
67
+ system("taskkill /PID #{remote_client.pid} /F /T")
68
+ else
69
+ Process.kill(:INT, remote_client.pid)
70
+ end
71
+ }
66
72
 
67
73
  port
68
74
  end
@@ -1,3 +1,3 @@
1
1
  module Akephalos #:nodoc
2
- VERSION = "2.1.1.2"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: akephalos2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1.2
4
+ version: 2.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-12-07 00:00:00.000000000 Z
13
+ date: 2011-12-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capybara
17
- requirement: &70189584699440 !ruby/object:Gem::Requirement
17
+ requirement: &70282950353040 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70189584699440
25
+ version_requirements: *70282950353040
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rake
28
- requirement: &70189584698600 !ruby/object:Gem::Requirement
28
+ requirement: &70282950368980 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70189584698600
36
+ version_requirements: *70282950368980
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: jruby-jars
39
- requirement: &70189584697440 !ruby/object:Gem::Requirement
39
+ requirement: &70282950368360 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70189584697440
47
+ version_requirements: *70282950368360
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: sinatra
50
- requirement: &70189580569860 !ruby/object:Gem::Requirement
50
+ requirement: &70282950367560 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *70189580569860
58
+ version_requirements: *70282950367560
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rspec
61
- requirement: &70189580569320 !ruby/object:Gem::Requirement
61
+ requirement: &70282950367120 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *70189580569320
69
+ version_requirements: *70282950367120
70
70
  description: Headless Browser for Integration Testing with Capybara
71
71
  email:
72
72
  - bj.schaefer@gmail.com