congress_forms 0.1.15 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 805b230f97a3b9f4a4d3a5e7108d623e649adbbb548361bad2a2799b15177b64
4
- data.tar.gz: 7aaeef3fbec56c34838eaa231c081bf2d6c8a0b5ade47d2cb013d010a64d1f44
3
+ metadata.gz: 535d4f04be205c842bc82fb2cdf7aa91b875f2b8e4929ea37ee9fe4740231201
4
+ data.tar.gz: c661dc86d5250d53cb0ad7bf78ee83cc287c6bb5cf72edd651ee3c43d1f052d1
5
5
  SHA512:
6
- metadata.gz: 3551f400d01950ee36ff963b514b38921fcb3e1f76848202890be30d639a3f7994c782f8d9ce259e0e1fbf53e0a4203717d81de41dc99908144175d97038a77d
7
- data.tar.gz: bcce5315c8c5440907d416d44f8e65e344fadf8522406bd937326578d56d94a3bf52ff02216792efea1217537c875c62b230ead197ed133565acd7ebd0846b8a
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
- begin
92
- form.fill(params, submit: options[:submit])
93
- rescue Exception => e
94
- if options[:debug]
95
- require "pry"
96
- binding.pry
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
@@ -17,7 +17,7 @@ module CongressForms
17
17
  nil
18
18
  end
19
19
 
20
- if cwc_client&.office_supported?(form_id)
20
+ if (cwc_client&.office_supported?(form_id) rescue nil)
21
21
  CwcForm.new(form_id)
22
22
  else
23
23
  content, timestamp = repo.find("members/#{form_id}.yaml")
@@ -1,3 +1,3 @@
1
1
  module CongressForms
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.17"
3
3
  end
@@ -91,6 +91,8 @@ module CongressForms
91
91
  def log(message)
92
92
  if defined?(Rails)
93
93
  Rails.logger.debug(message)
94
+ elsif ENV["HEADLESS"] == "0"
95
+ warn message
94
96
  end
95
97
 
96
98
  if defined?(Raven)
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.15
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: 2019-07-10 00:00:00.000000000 Z
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
- rubyforge_project:
183
- rubygems_version: 2.7.7
184
- signing_key:
182
+ rubygems_version: 3.1.6
183
+ signing_key:
185
184
  specification_version: 4
186
185
  summary: "..."
187
186
  test_files: []