congress_forms 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/congress_forms/version.rb +1 -1
- data/lib/congress_forms/web_form.rb +15 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 874826c61da50fac5258d6824dca5b1a473060d1
|
4
|
+
data.tar.gz: 364d2d5fe226a42f2e4d9defa5029141502e80b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5523d19a1921d14c59d63afaa31cdd4ca4b5f2a831ea11a549fd30aa76f5e2728fc6bc4fc1a406cb27001ca0f0e927345788ae6b4cc5a4117d72cf6a11c29eea
|
7
|
+
data.tar.gz: 7968b52057002d803df56ce7fdb0e3abd707d3bbd368e5138d24a4b02b3d5c7df206e91ac3adbc79719ef1207b6fd7648319a050799a03e92d42be414bb486f1
|
data/README.md
CHANGED
@@ -104,7 +104,7 @@ A `git pull` is performed every now and then in this direcory, to keep the form
|
|
104
104
|
CongressForms.auto_update_contact_congress = false
|
105
105
|
```
|
106
106
|
|
107
|
-
House messages are submitted through the [Communicating with Congress](https://www.house.gov/doing-business-with-the-house/communicating-with-congress-cwc) API. To send messages to the House
|
107
|
+
House messages are submitted through the [Communicating with Congress](https://www.house.gov/doing-business-with-the-house/communicating-with-congress-cwc) API. To send messages to the House, you will need to complete the vendor application process, then configure the API client with
|
108
108
|
|
109
109
|
```ruby
|
110
110
|
Cwc::Client.configure(
|
@@ -63,6 +63,8 @@ module CongressForms
|
|
63
63
|
log("#{bioguide} fill")
|
64
64
|
|
65
65
|
actions.each do |action|
|
66
|
+
log(action.inspect)
|
67
|
+
|
66
68
|
break if action.submit? && validate_only
|
67
69
|
|
68
70
|
action.perform(browser, values)
|
@@ -75,10 +77,7 @@ module CongressForms
|
|
75
77
|
error = Error.new(e.message)
|
76
78
|
error.set_backtrace(e.backtrace)
|
77
79
|
|
78
|
-
|
79
|
-
error.screenshot = "#{screenshot}/#{SecureRandom.hex(16)}.png"
|
80
|
-
browser.save_screenshot(error.screenshot, full: true)
|
81
|
-
end
|
80
|
+
attach_screenshot(browser, error)
|
82
81
|
|
83
82
|
raise error
|
84
83
|
end
|
@@ -98,5 +97,17 @@ module CongressForms
|
|
98
97
|
Raven.context.extra[:fill_log] << message << "\n"
|
99
98
|
end
|
100
99
|
end
|
100
|
+
|
101
|
+
def attach_screenshot(browser, error)
|
102
|
+
if dir = ENV["CONGRESS_FORMS_SCREENSHOT_LOCATION"]
|
103
|
+
random = SecureRandom.hex(16)
|
104
|
+
stamp = Time.now.strftime("%Y-%m-%d_%H:%M:%S")
|
105
|
+
|
106
|
+
path = "#{dir}/#{bioguide}/#{stamp}_#{random}.png"
|
107
|
+
FileUtils.mkdir_p(File.dirname(path))
|
108
|
+
|
109
|
+
browser.save_screenshot(error.screenshot, full: true)
|
110
|
+
end
|
111
|
+
end
|
101
112
|
end
|
102
113
|
end
|