federal_register 0.7.4 → 0.7.6

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: f8bb140a355d09285ddb6f31ec8ccf355410099575c89c4fddf4a92c9d8ba060
4
- data.tar.gz: 49e5336d04ec3f93cca25e446417c151f34827e8258c3f1c62441df51ea81b57
3
+ metadata.gz: 63643d75cc0539e9244e7bcb4715569cdaabaa946467a527b14c3b1babc3f40c
4
+ data.tar.gz: 1a0a8b76e5e2deb3dc215cf2109e117989cc983d3caf7189575b25a7ab01e480
5
5
  SHA512:
6
- metadata.gz: 83fe3e7909c0e79f2a8e2cc692917dfb1613aaf4758eefca6236d0b8b78249a745acb9cdedabe0fe164247e58b29a8ac711b0758ece87090554fa8eed8d5c174
7
- data.tar.gz: 9ef1941fd7313e8e97e42306a7dde35759f07b08971a013ed8a9d7dac467adf9f25da3a629a332de2303f0502d28665c60f39a02c4ea4017ba3d9f90b0d48e26
6
+ metadata.gz: 611b9c78a73332729c6fff76b56cc5d29e7ef5ecb1bae8357aaa8c7c9e1bef153c461235ec30b190c42a9ad83539572e198933ea59a611fd926173934b08799e
7
+ data.tar.gz: d0e720e9af49fcb7655b201b09fea1550f2b4f9fd2f0eeffbad4cbb8bee1601e36bb017009c8edb2147a69bbb645777f4d358485e829f11ac244713916b84b56
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.4
1
+ 0.7.6
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "federal_register"
8
- s.version = "0.7.4"
8
+ s.version = "0.7.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Carpenter", "Bob Burbach"]
12
- s.date = "2019-11-22"
12
+ s.date = "2019-12-03"
13
13
  s.description = "Ruby API Client for FederalRegister.gov that handles searching documents and getting information about agencies"
14
14
  s.email = "andrew@criticaljuncture.org"
15
15
  s.extra_rdoc_files = [
@@ -1,6 +1,8 @@
1
1
  class FederalRegister::Base < FederalRegister::Client
2
2
  attr_reader :attributes
3
3
 
4
+ INTEGER_CLASS = 1.class
5
+
4
6
  def self.add_attribute(*attributes)
5
7
  options = {}
6
8
 
@@ -22,7 +24,7 @@ class FederalRegister::Base < FederalRegister::Client
22
24
  val = DateTime.parse(val.to_s)
23
25
  end
24
26
  when :integer
25
- if ! val.is_a?(Fixnum)
27
+ if ! val.is_a?(INTEGER_CLASS)
26
28
  val = val.to_i
27
29
  end
28
30
  end
@@ -81,19 +81,19 @@ class FederalRegister::Document < FederalRegister::Base
81
81
  # note: no space after comma
82
82
  def self.find_all(*args)
83
83
  options, document_numbers_or_citations = extract_options(args)
84
+ document_numbers_or_citations.flatten!
84
85
 
85
86
  fetch_options = {:result_class => self}
86
87
  fetch_options.merge!(:query => {:fields => options[:fields]}) if options[:fields]
87
88
 
88
- document_numbers_or_citations = document_numbers_or_citations.flatten
89
-
90
89
  #TODO: fix this gross hack to ensure that find_all with a single document number
91
90
  # is returned in the same way multiple document numbers are
92
91
  if document_numbers_or_citations.size == 1
93
92
  document_numbers_or_citations << " "
94
93
  end
95
94
 
96
- result_set = FederalRegister::ResultSet.fetch("/documents/#{URI.encode(document_numbers_or_citations.compact.join(',').strip)}.json", fetch_options)
95
+ params = URI.encode(document_numbers_or_citations.compact.join(',').strip)
96
+ result_set = FederalRegister::ResultSet.fetch("/documents/#{params}.json", fetch_options)
97
97
  end
98
98
 
99
99
  def agencies
@@ -45,6 +45,7 @@ class FederalRegister::PublicInspectionDocument < FederalRegister::Base
45
45
 
46
46
  def self.find_all(*args)
47
47
  options, document_numbers = extract_options(args)
48
+ document_numbers.flatten!
48
49
 
49
50
  fetch_options = {:result_class => self}
50
51
  fetch_options.merge!(:query => {:fields => options[:fields]}) if options[:fields]
@@ -54,8 +55,9 @@ class FederalRegister::PublicInspectionDocument < FederalRegister::Base
54
55
  if document_numbers.size == 1
55
56
  document_numbers << " "
56
57
  end
57
-
58
- result_set = FederalRegister::ResultSet.fetch("/public-inspection-documents/#{document_numbers.compact.join(',').strip}.json", fetch_options)
58
+
59
+ params = URI.encode(document_numbers.compact.join(',').strip)
60
+ result_set = FederalRegister::ResultSet.fetch("/public-inspection-documents/#{params}.json", fetch_options)
59
61
  end
60
62
 
61
63
  def agencies
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: federal_register
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Carpenter
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-11-22 00:00:00.000000000 Z
12
+ date: 2019-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty