celerity 0.8.9 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
- :minor: 8
4
- :patch: 9
3
+ :minor: 9
4
+ :patch: 0
5
5
  :build:
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{celerity}
8
- s.version = "0.8.9"
8
+ s.version = "0.9.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jari Bakken", "T. Alexander Lystad", "Knut Johannes Dahle"]
12
- s.date = %q{2011-03-28}
12
+ s.date = %q{2011-08-18}
13
13
  s.description = %q{Celerity is a JRuby wrapper around HtmlUnit – a headless Java browser with JavaScript support. It provides a simple API for programmatic navigation through web applications. Celerity provides a superset of Watir's API.}
14
14
  s.email = %q{jari.bakken@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -57,12 +57,12 @@ Gem::Specification.new do |s|
57
57
  "lib/celerity/htmlunit/commons-lang-2.6.jar",
58
58
  "lib/celerity/htmlunit/commons-logging-1.1.1.jar",
59
59
  "lib/celerity/htmlunit/cssparser-0.9.5.jar",
60
- "lib/celerity/htmlunit/htmlunit-2.9-SNAPSHOT.jar",
61
- "lib/celerity/htmlunit/htmlunit-core-js-2.9-SNAPSHOT.jar",
62
- "lib/celerity/htmlunit/httpclient-4.1.1.jar",
63
- "lib/celerity/htmlunit/httpcore-4.1.jar",
64
- "lib/celerity/htmlunit/httpmime-4.1.1.jar",
65
- "lib/celerity/htmlunit/nekohtml-1.9.15-20101026.093020-2.jar",
60
+ "lib/celerity/htmlunit/htmlunit-2.9.jar",
61
+ "lib/celerity/htmlunit/htmlunit-core-js-2.9.jar",
62
+ "lib/celerity/htmlunit/httpclient-4.1.2.jar",
63
+ "lib/celerity/htmlunit/httpcore-4.1.2.jar",
64
+ "lib/celerity/htmlunit/httpmime-4.1.2.jar",
65
+ "lib/celerity/htmlunit/nekohtml-1.9.15.jar",
66
66
  "lib/celerity/htmlunit/sac-1.3.jar",
67
67
  "lib/celerity/htmlunit/serializer-2.7.1.jar",
68
68
  "lib/celerity/htmlunit/xalan-2.7.1.jar",
@@ -96,8 +96,9 @@ module Celerity
96
96
  def goto(uri, headers = nil)
97
97
  uri = "http://#{uri}" unless uri =~ %r{://}
98
98
 
99
- request = HtmlUnit::WebRequestSettings.new(::Java::JavaNet::URL.new(uri))
100
- request.set_additional_headers(headers) if headers
99
+ request = HtmlUnit::WebRequest.new(::Java::JavaNet::URL.new(uri))
100
+
101
+ request.setAdditionalHeaders(headers) if headers
101
102
  request.setCharset(@charset)
102
103
 
103
104
  rescue_status_code_exception do
@@ -129,6 +130,7 @@ module Celerity
129
130
 
130
131
  def close
131
132
  @page = nil
133
+ @object = nil
132
134
  @webclient.closeAllWindows
133
135
  @viewer.close
134
136
  end
@@ -32,6 +32,14 @@ module Celerity
32
32
  end
33
33
  alias_method :size, :length
34
34
 
35
+ #
36
+ # Returns true if the collection is empty.
37
+ #
38
+
39
+ def empty?
40
+ length == 0
41
+ end
42
+
35
43
  #
36
44
  # @yieldparam [Celerity::Element] element Iterate through the elements in this collection.
37
45
  #
@@ -38,7 +38,7 @@ module Celerity
38
38
  def file_size
39
39
  assert_exists
40
40
  web_response = @object.getWebResponse(true)
41
- web_response.getContentAsBytes.length
41
+ web_response.getContentAsString.bytesize
42
42
  end
43
43
 
44
44
  #
@@ -1,3 +1,3 @@
1
1
  module Celerity
2
- VERSION = "0.8.9"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -4,7 +4,7 @@ task :snapshot, :file do |t, args|
4
4
  sh "cp #{args.file} ./"
5
5
  basename = File.basename(args.file)
6
6
  else
7
- url = "http://build.canoo.com/htmlunit/artifacts/htmlunit-2.9-SNAPSHOT-with-dependencies.zip"
7
+ url = "http://build.canoo.com/htmlunit/artifacts//htmlunit-2.9-with-dependencies.zip"
8
8
  sh "curl -O #{url}"
9
9
  basename = File.basename(url)
10
10
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: celerity
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.8.9
5
+ version: 0.9.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jari Bakken
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2011-03-28 00:00:00 -07:00
15
+ date: 2011-08-18 00:00:00 +02:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -109,12 +109,12 @@ files:
109
109
  - lib/celerity/htmlunit/commons-lang-2.6.jar
110
110
  - lib/celerity/htmlunit/commons-logging-1.1.1.jar
111
111
  - lib/celerity/htmlunit/cssparser-0.9.5.jar
112
- - lib/celerity/htmlunit/htmlunit-2.9-SNAPSHOT.jar
113
- - lib/celerity/htmlunit/htmlunit-core-js-2.9-SNAPSHOT.jar
114
- - lib/celerity/htmlunit/httpclient-4.1.1.jar
115
- - lib/celerity/htmlunit/httpcore-4.1.jar
116
- - lib/celerity/htmlunit/httpmime-4.1.1.jar
117
- - lib/celerity/htmlunit/nekohtml-1.9.15-20101026.093020-2.jar
112
+ - lib/celerity/htmlunit/htmlunit-2.9.jar
113
+ - lib/celerity/htmlunit/htmlunit-core-js-2.9.jar
114
+ - lib/celerity/htmlunit/httpclient-4.1.2.jar
115
+ - lib/celerity/htmlunit/httpcore-4.1.2.jar
116
+ - lib/celerity/htmlunit/httpmime-4.1.2.jar
117
+ - lib/celerity/htmlunit/nekohtml-1.9.15.jar
118
118
  - lib/celerity/htmlunit/sac-1.3.jar
119
119
  - lib/celerity/htmlunit/serializer-2.7.1.jar
120
120
  - lib/celerity/htmlunit/xalan-2.7.1.jar