mechanize 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mechanize might be problematic. Click here for more details.

Files changed (2) hide show
  1. data/lib/mechanize.rb +17 -1
  2. metadata +8 -6
data/lib/mechanize.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # set cookies (I might be wrong), does not automatically redirect and has
7
7
  # problems with some html documents.
8
8
 
9
- Version = "0.2.3"
9
+ Version = "0.3.0"
10
10
 
11
11
  # required due to the missing get_fields method in Ruby 1.8.2
12
12
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "mechanize", "net-overrides")
@@ -141,6 +141,22 @@ class GlobalForm
141
141
  parse
142
142
  end
143
143
 
144
+ # In the case of malformed HTML, fields of multiple forms might occure in this forms'
145
+ # field array. If the fields have the same name, posterior fields overwrite former fields.
146
+ # To avoid this, this method rejects all posterior duplicate fields.
147
+
148
+ def uniq_fields!
149
+ names_in = {}
150
+ fields.reject! {|f|
151
+ if names_in.include?(f.name)
152
+ true
153
+ else
154
+ names_in[f.name] = true
155
+ false
156
+ end
157
+ }
158
+ end
159
+
144
160
  def build_query
145
161
  query = {}
146
162
 
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.4
2
+ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: mechanize
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.3
7
- date: 2005-06-20
6
+ version: 0.3.0
7
+ date: 2005-07-30 00:00:00 +02:00
8
8
  summary: Automated web-browsing.
9
9
  require_paths:
10
10
  - lib
@@ -24,17 +24,18 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
24
24
  version: 0.0.0
25
25
  version:
26
26
  platform: ruby
27
+ signing_key:
28
+ cert_chain:
27
29
  authors:
28
30
  - Michael Neumann
29
31
  files:
30
32
  - test
31
- - examples
32
33
  - lib
33
- - mechanize.gemspec
34
+ - examples
34
35
  - Rakefile
35
36
  - README
37
+ - mechanize.gemspec
36
38
  - test/test_parsing.rb
37
- - examples/rubyforge.rb
38
39
  - lib/mechanize
39
40
  - lib/mechanize.rb
40
41
  - lib/mechanize/net-overrides
@@ -43,6 +44,7 @@ files:
43
44
  - lib/mechanize/net-overrides/net/protocol.rb
44
45
  - lib/mechanize/net-overrides/net/http.rb
45
46
  - lib/mechanize/net-overrides/net/https.rb
47
+ - examples/rubyforge.rb
46
48
  test_files: []
47
49
  rdoc_options: []
48
50
  extra_rdoc_files: []