congress_forms 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/bin/congress_forms +12 -8
- data/lib/congress_forms/actions.rb +11 -0
- data/lib/congress_forms/form.rb +1 -1
- data/lib/congress_forms/version.rb +1 -1
- data/lib/congress_forms/web_form.rb +2 -0
- data/lib/congress_forms.rb +0 -1
- data/lib/cwc/client.rb +2 -2
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 535d4f04be205c842bc82fb2cdf7aa91b875f2b8e4929ea37ee9fe4740231201
|
4
|
+
data.tar.gz: c661dc86d5250d53cb0ad7bf78ee83cc287c6bb5cf72edd651ee3c43d1f052d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 398168518ade5fc838a83b64333468ddd77ce1daf76e715b46c8c3d1c97091a65dde04407c04c62c6df8fe70d58a4d30e7ca6fa3df706f46a8c6c095e1306139
|
7
|
+
data.tar.gz: d440b5178f2162683503dcde1c9f1e9c8588308dd06fe9bca9512823d4888a9b518eeb7551bf589917e838636f30fee2e913dbad0e74fbbea8ae8fe82aa7f53f
|
data/bin/congress_forms
CHANGED
@@ -88,13 +88,17 @@ form.required_params.each do |param|
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
|
92
|
-
form.
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
else
|
98
|
-
raise e
|
91
|
+
if options[:debug]
|
92
|
+
isubmit = form.actions.find_index(&:submit?) || 0
|
93
|
+
|
94
|
+
debug = CongressForms::Actions::Yield.new do
|
95
|
+
puts "fill paused before submit. press return to continue."
|
96
|
+
$stdin.gets
|
99
97
|
end
|
98
|
+
|
99
|
+
form.actions.insert(isubmit, debug)
|
100
100
|
end
|
101
|
+
|
102
|
+
puts
|
103
|
+
|
104
|
+
form.fill(params, validate_only: !!!options[:submit])
|
@@ -164,5 +164,16 @@ module CongressForms
|
|
164
164
|
browser.driver.evaluate_script(value)
|
165
165
|
end
|
166
166
|
end
|
167
|
+
|
168
|
+
class Yield < Base
|
169
|
+
def initialize(*args, &block)
|
170
|
+
@block = block
|
171
|
+
super
|
172
|
+
end
|
173
|
+
|
174
|
+
def perform(browser, params={})
|
175
|
+
@block.call
|
176
|
+
end
|
177
|
+
end
|
167
178
|
end
|
168
179
|
end
|
data/lib/congress_forms/form.rb
CHANGED
data/lib/congress_forms.rb
CHANGED
@@ -64,7 +64,6 @@ module CongressForms
|
|
64
64
|
autoload :WebForm, "congress_forms/web_form"
|
65
65
|
autoload :CwcForm, "congress_forms/cwc_form"
|
66
66
|
autoload :Actions, "congress_forms/actions"
|
67
|
-
autoload :UnsupportedAction, "congress_forms/actions"
|
68
67
|
|
69
68
|
autoload :Repo, "congress_forms/repo"
|
70
69
|
|
data/lib/cwc/client.rb
CHANGED
@@ -161,9 +161,9 @@ module Cwc
|
|
161
161
|
|
162
162
|
def offices
|
163
163
|
if options[:host] =~ %r{^https://cwc.house.gov}
|
164
|
-
|
164
|
+
Cwc::OfficeCodes.map{ |code| Office.new(code) }
|
165
165
|
else
|
166
|
-
response = get action("/
|
166
|
+
response = get action("/offices")
|
167
167
|
JSON.parse(response.body).map{ |code| Office.new(code) }
|
168
168
|
end
|
169
169
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: congress_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Woo
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '2.0'
|
125
|
-
description:
|
125
|
+
description:
|
126
126
|
email:
|
127
127
|
- peterw@eff.org
|
128
128
|
executables:
|
@@ -163,7 +163,7 @@ homepage: https://github.com/efforg/congress_forms
|
|
163
163
|
licenses:
|
164
164
|
- GPL-3.0
|
165
165
|
metadata: {}
|
166
|
-
post_install_message:
|
166
|
+
post_install_message:
|
167
167
|
rdoc_options: []
|
168
168
|
require_paths:
|
169
169
|
- lib
|
@@ -179,9 +179,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
181
|
requirements: []
|
182
|
-
|
183
|
-
|
184
|
-
signing_key:
|
182
|
+
rubygems_version: 3.1.6
|
183
|
+
signing_key:
|
185
184
|
specification_version: 4
|
186
185
|
summary: "..."
|
187
186
|
test_files: []
|