mechanize 0.2.0 → 0.2.1
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.
Potentially problematic release.
This version of mechanize might be problematic. Click here for more details.
- data/Rakefile +14 -0
- data/lib/mechanize.rb +4 -4
- metadata +3 -2
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
task :tag do
|
2
|
+
if File.read('lib/mechanize.rb') =~ /Version\s+=\s+"(\d+\.\d+\.\d+)"/
|
3
|
+
version = $1
|
4
|
+
else
|
5
|
+
raise "no version"
|
6
|
+
end
|
7
|
+
baseurl = "svn+ssh://ntecs.de/data/projects/svn/public/Mechanize"
|
8
|
+
|
9
|
+
sh "svn cp -m 'tagged #{ version }' #{ baseurl }/trunk #{ baseurl }/tags/mechanize-#{ version }"
|
10
|
+
end
|
11
|
+
|
12
|
+
task :package do
|
13
|
+
sh 'gem build mechanize.gemspec'
|
14
|
+
end
|
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.
|
9
|
+
Version = "0.2.1"
|
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")
|
@@ -33,7 +33,7 @@ class Field
|
|
33
33
|
fields = []
|
34
34
|
root_node.each_recursive {|node|
|
35
35
|
if node.name.downcase == 'input' and
|
36
|
-
['text', 'password', 'hidden', 'checkbox'].include?(node.attributes['type'].downcase)
|
36
|
+
['text', 'password', 'hidden', 'checkbox', 'radio'].include?(node.attributes['type'].downcase)
|
37
37
|
fields << Field.new(node.attributes['name'], node.attributes['value'])
|
38
38
|
end
|
39
39
|
}
|
@@ -109,7 +109,7 @@ end
|
|
109
109
|
|
110
110
|
class GlobalForm
|
111
111
|
attr_reader :form_node, :elements_node
|
112
|
-
|
112
|
+
attr_accessor :method, :action, :name
|
113
113
|
|
114
114
|
attr_reader :fields, :buttons, :file_uploads
|
115
115
|
|
@@ -131,7 +131,7 @@ class GlobalForm
|
|
131
131
|
case node.name.downcase
|
132
132
|
when 'input'
|
133
133
|
case (node.attributes['type'] || '').downcase
|
134
|
-
when 'text', 'password', 'hidden', 'checkbox'
|
134
|
+
when 'text', 'password', 'hidden', 'checkbox', 'radio'
|
135
135
|
@fields << Field.new(node.attributes['name'], node.attributes['value'])
|
136
136
|
when 'file'
|
137
137
|
@file_uploads << FileUpload.new(node.attributes['name'], node.attributes['value'])
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.6
|
|
3
3
|
specification_version: 1
|
4
4
|
name: mechanize
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2005-04-
|
6
|
+
version: 0.2.1
|
7
|
+
date: 2005-04-06
|
8
8
|
summary: Automated web-browsing.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- examples
|
32
32
|
- lib
|
33
33
|
- mechanize.gemspec
|
34
|
+
- Rakefile
|
34
35
|
- README
|
35
36
|
- test/test_parsing.rb
|
36
37
|
- examples/rubyforge.rb
|