federal_register 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/.rubocop.yml +286 -0
  2. data/Gemfile +3 -4
  3. data/Gemfile.lock +82 -22
  4. data/README.md +6 -6
  5. data/Rakefile +5 -5
  6. data/VERSION +1 -1
  7. data/federal_register.gemspec +49 -19
  8. data/lib/federal_register.rb +41 -0
  9. data/lib/federal_register/agency.rb +45 -9
  10. data/lib/federal_register/article.rb +2 -106
  11. data/lib/federal_register/base.rb +52 -3
  12. data/lib/federal_register/client.rb +3 -3
  13. data/lib/federal_register/document.rb +113 -0
  14. data/lib/federal_register/document_image.rb +17 -0
  15. data/lib/federal_register/facet.rb +21 -0
  16. data/lib/federal_register/facet/agency.rb +5 -0
  17. data/lib/federal_register/facet/document.rb +2 -0
  18. data/lib/federal_register/facet/document/agency.rb +5 -0
  19. data/lib/federal_register/facet/document/daily.rb +5 -0
  20. data/lib/federal_register/facet/document/frequency.rb +12 -0
  21. data/lib/federal_register/facet/document/monthly.rb +5 -0
  22. data/lib/federal_register/facet/document/quarterly.rb +5 -0
  23. data/lib/federal_register/facet/document/section.rb +5 -0
  24. data/lib/federal_register/facet/document/topic.rb +5 -0
  25. data/lib/federal_register/facet/document/type.rb +5 -0
  26. data/lib/federal_register/facet/document/weekly.rb +5 -0
  27. data/lib/federal_register/facet/document/yearly.rb +5 -0
  28. data/lib/federal_register/facet/presidential_document_type.rb +6 -0
  29. data/lib/federal_register/facet/public_inspection_document.rb +2 -0
  30. data/lib/federal_register/facet/public_inspection_document/agencies.rb +5 -0
  31. data/lib/federal_register/facet/public_inspection_document/agency.rb +5 -0
  32. data/lib/federal_register/facet/public_inspection_document/type.rb +5 -0
  33. data/lib/federal_register/facet/public_inspection_issue.rb +36 -0
  34. data/lib/federal_register/facet/public_inspection_issue/daily.rb +11 -0
  35. data/lib/federal_register/facet/public_inspection_issue/daily_filing.rb +6 -0
  36. data/lib/federal_register/facet/public_inspection_issue/type.rb +11 -0
  37. data/lib/federal_register/facet/public_inspection_issue/type_filing.rb +22 -0
  38. data/lib/federal_register/facet/topic.rb +5 -0
  39. data/lib/federal_register/facet_result_set.rb +25 -0
  40. data/lib/federal_register/highlighted_document.rb +42 -0
  41. data/lib/federal_register/public_inspection_document.rb +21 -7
  42. data/lib/federal_register/public_inspection_issue_result_set.rb +10 -0
  43. data/lib/federal_register/result_set.rb +5 -5
  44. data/lib/federal_register/section.rb +26 -0
  45. data/lib/federal_register/suggested_search.rb +26 -0
  46. data/lib/federal_register/topic.rb +13 -0
  47. data/spec/{article_spec.rb → document_spec.rb} +20 -28
  48. data/spec/public_inspection_document_spec.rb +5 -6
  49. data/spec/result_set_spec.rb +4 -4
  50. metadata +99 -39
@@ -0,0 +1,286 @@
1
+ Lint/AssignmentInCondition:
2
+ Enabled: false
3
+
4
+ Lint/BlockAlignment:
5
+ Enabled: false
6
+
7
+ Lint/Debugger:
8
+ Enabled: false
9
+
10
+ Lint/DefEndAlignment:
11
+ Enabled: false
12
+
13
+ Lint/DeprecatedClassMethods:
14
+ Enabled: false
15
+
16
+ Lint/EndAlignment:
17
+ Enabled: false
18
+
19
+ Lint/Eval:
20
+ Enabled: false
21
+
22
+ Lint/HandleExceptions:
23
+ Enabled: false
24
+
25
+ Lint/RescueException:
26
+ Enabled: false
27
+
28
+ Lint/ShadowingOuterLocalVariable:
29
+ Enabled: false
30
+
31
+ Lint/SpaceBeforeFirstArg:
32
+ Enabled: false
33
+
34
+ Lint/StringConversionInInterpolation:
35
+ Enabled: false
36
+
37
+ Lint/UnreachableCode:
38
+ Enabled: false
39
+
40
+ Lint/UnusedBlockArgument:
41
+ Enabled: false
42
+
43
+ Lint/UnusedMethodArgument:
44
+ Enabled: false
45
+
46
+ Lint/UselessAccessModifier:
47
+ Enabled: false
48
+
49
+ Lint/UselessAssignment:
50
+ Enabled: false
51
+
52
+ Metrics/AbcSize:
53
+ Max: 69
54
+
55
+ Metrics/ClassLength:
56
+ Max: 310
57
+
58
+ Metrics/CyclomaticComplexity:
59
+ Max: 17
60
+
61
+ Metrics/LineLength:
62
+ Max: 336
63
+
64
+ Metrics/MethodLength:
65
+ Max: 46
66
+
67
+ Metrics/PerceivedComplexity:
68
+ Max: 21
69
+
70
+ Style/AccessorMethodName:
71
+ Enabled: false
72
+
73
+ Style/Alias:
74
+ Enabled: false
75
+
76
+ Style/AlignHash:
77
+ Enabled: false
78
+
79
+ Style/AlignParameters:
80
+ Enabled: false
81
+
82
+ Style/AndOr:
83
+ Enabled: false
84
+
85
+ Style/BlockEndNewline:
86
+ Enabled: false
87
+
88
+ Style/Blocks:
89
+ Enabled: false
90
+
91
+ Style/BracesAroundHashParameters:
92
+ Enabled: false
93
+
94
+ Style/ClassAndModuleChildren:
95
+ Enabled: false
96
+
97
+ Style/ColonMethodCall:
98
+ Enabled: false
99
+
100
+ Style/CommentIndentation:
101
+ Enabled: false
102
+
103
+ Style/DeprecatedHashMethods:
104
+ Enabled: false
105
+
106
+ Style/Documentation:
107
+ Enabled: false
108
+
109
+ Style/DotPosition:
110
+ Enabled: false
111
+
112
+ Style/EachWithObject:
113
+ Enabled: false
114
+
115
+ Style/EmptyLineBetweenDefs:
116
+ Enabled: false
117
+
118
+ Style/EmptyLines:
119
+ Enabled: false
120
+
121
+ Style/EmptyLinesAroundAccessModifier:
122
+ Enabled: false
123
+
124
+ Style/EmptyLinesAroundClassBody:
125
+ Enabled: false
126
+
127
+ Style/EmptyLinesAroundMethodBody:
128
+ Enabled: false
129
+
130
+ Style/EmptyLinesAroundModuleBody:
131
+ Enabled: false
132
+
133
+ Style/GuardClause:
134
+ Enabled: false
135
+
136
+ Style/HashSyntax:
137
+ Enabled: false
138
+
139
+ Style/IfUnlessModifier:
140
+ Enabled: false
141
+
142
+ Style/IndentArray:
143
+ Enabled: false
144
+
145
+ Style/IndentHash:
146
+ Enabled: false
147
+
148
+ Style/IndentationConsistency:
149
+ Enabled: false
150
+
151
+ Style/IndentationWidth:
152
+ Enabled: false
153
+
154
+ Style/Lambda:
155
+ Enabled: false
156
+
157
+ Style/LeadingCommentSpace:
158
+ Enabled: false
159
+
160
+ Style/MethodCallParentheses:
161
+ Enabled: false
162
+
163
+ Style/MultilineBlockChain:
164
+ Enabled: false
165
+
166
+ Style/MultilineBlockLayout:
167
+ Enabled: false
168
+
169
+ Style/MultilineOperationIndentation:
170
+ Enabled: false
171
+
172
+ Style/NegatedIf:
173
+ Enabled: false
174
+
175
+ Style/NestedTernaryOperator:
176
+ Enabled: false
177
+
178
+ Style/Next:
179
+ Enabled: false
180
+
181
+ Style/NumericLiterals:
182
+ MinDigits: 15
183
+
184
+ Style/PerlBackrefs:
185
+ Enabled: false
186
+
187
+ Style/PredicateName:
188
+ Enabled: false
189
+
190
+ Style/Proc:
191
+ Enabled: false
192
+
193
+ Style/RaiseArgs:
194
+ Enabled: false
195
+
196
+ Style/RedundantBegin:
197
+ Enabled: false
198
+
199
+ Style/RedundantReturn:
200
+ Enabled: false
201
+
202
+ Style/RedundantSelf:
203
+ Enabled: false
204
+
205
+ Style/SelfAssignment:
206
+ Enabled: false
207
+
208
+ Style/SignalException:
209
+ Enabled: false
210
+
211
+ Style/SingleLineBlockParams:
212
+ Enabled: false
213
+
214
+ Style/SingleSpaceBeforeFirstArg:
215
+ Enabled: false
216
+
217
+ Style/SpaceAfterComma:
218
+ Enabled: false
219
+
220
+ Style/SpaceAfterNot:
221
+ Enabled: false
222
+
223
+ Style/SpaceAroundEqualsInParameterDefault:
224
+ Enabled: false
225
+
226
+ Style/SpaceAroundOperators:
227
+ Enabled: false
228
+
229
+ Style/SpaceBeforeBlockBraces:
230
+ Enabled: false
231
+
232
+ Style/SpaceBeforeComma:
233
+ Enabled: false
234
+
235
+ Style/SpaceBeforeComment:
236
+ Enabled: false
237
+
238
+ Style/SpaceInsideBlockBraces:
239
+ Enabled: false
240
+
241
+ Style/SpaceInsideBrackets:
242
+ Enabled: false
243
+
244
+ Style/SpaceInsideHashLiteralBraces:
245
+ Enabled: false
246
+
247
+ Style/SpaceInsideParens:
248
+ Enabled: false
249
+
250
+ Style/SpaceInsideRangeLiteral:
251
+ Enabled: false
252
+
253
+ Style/StringLiterals:
254
+ Enabled: false
255
+
256
+ Style/StringLiteralsInInterpolation:
257
+ Enabled: false
258
+
259
+ Style/SymbolProc:
260
+ Enabled: false
261
+
262
+ Style/TrailingBlankLines:
263
+ Enabled: false
264
+
265
+ Style/TrailingComma:
266
+ Enabled: false
267
+
268
+ Style/TrailingWhitespace:
269
+ Enabled: true
270
+
271
+ Style/TrivialAccessors:
272
+ Enabled: false
273
+
274
+ Style/WhileUntilModifier:
275
+ Enabled: false
276
+
277
+ Style/WordArray:
278
+ Description: 'Use %w or %W for arrays of words.'
279
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
280
+ Enabled: true
281
+ MinSize: 23
282
+
283
+ Style/BarePercentLiterals:
284
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
285
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
286
+ Enabled: false
data/Gemfile CHANGED
@@ -6,11 +6,10 @@ gem "httparty", ">= 0.7.0"
6
6
  # Include everything needed to run rake, tests, features, etc.
7
7
  group :development do
8
8
  gem "shoulda", ">= 0"
9
- gem "bundler", "~> 1.0.0"
10
- gem "jeweler", "~> 1.6.0"
11
- gem "rcov", ">= 0"
12
- gem "rspec", "~> 2.6"
9
+ gem "bundler"
10
+ gem "jeweler"
13
11
  gem "rspec", "~> 2.6"
14
12
  gem "activesupport", "~> 3"
15
13
  gem "fakeweb", "~> 1.3.0"
14
+ gem "rubocop"
16
15
  end
@@ -1,38 +1,98 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.0.7)
5
- crack (0.1.8)
6
- diff-lcs (1.1.2)
4
+ activesupport (3.2.21)
5
+ i18n (~> 0.6, >= 0.6.4)
6
+ multi_json (~> 1.0)
7
+ addressable (2.3.6)
8
+ ast (2.0.0)
9
+ astrolabe (1.3.0)
10
+ parser (>= 2.2.0.pre.3, < 3.0)
11
+ builder (3.2.2)
12
+ descendants_tracker (0.0.4)
13
+ thread_safe (~> 0.3, >= 0.3.1)
14
+ diff-lcs (1.2.5)
7
15
  fakeweb (1.3.0)
8
- git (1.2.5)
9
- httparty (0.7.7)
10
- crack (= 0.1.8)
11
- jeweler (1.6.0)
12
- bundler (~> 1.0.0)
16
+ faraday (0.9.1)
17
+ multipart-post (>= 1.2, < 3)
18
+ git (1.2.9)
19
+ github_api (0.12.2)
20
+ addressable (~> 2.3)
21
+ descendants_tracker (~> 0.0.4)
22
+ faraday (~> 0.8, < 0.10)
23
+ hashie (>= 3.3)
24
+ multi_json (>= 1.7.5, < 2.0)
25
+ nokogiri (~> 1.6.3)
26
+ oauth2
27
+ hashie (3.3.2)
28
+ highline (1.6.21)
29
+ httparty (0.13.3)
30
+ json (~> 1.8)
31
+ multi_xml (>= 0.5.2)
32
+ i18n (0.7.0)
33
+ jeweler (2.0.1)
34
+ builder
35
+ bundler (>= 1.0)
13
36
  git (>= 1.2.5)
37
+ github_api
38
+ highline (>= 1.6.15)
39
+ nokogiri (>= 1.5.10)
14
40
  rake
15
- rake (0.8.7)
16
- rcov (0.9.9)
17
- rspec (2.6.0)
18
- rspec-core (~> 2.6.0)
19
- rspec-expectations (~> 2.6.0)
20
- rspec-mocks (~> 2.6.0)
21
- rspec-core (2.6.4)
22
- rspec-expectations (2.6.0)
23
- diff-lcs (~> 1.1.2)
24
- rspec-mocks (2.6.0)
25
- shoulda (2.11.3)
41
+ rdoc
42
+ json (1.8.2)
43
+ jwt (1.2.0)
44
+ mini_portile (0.6.2)
45
+ multi_json (1.10.1)
46
+ multi_xml (0.5.5)
47
+ multipart-post (2.0.0)
48
+ nokogiri (1.6.5)
49
+ mini_portile (~> 0.6.0)
50
+ oauth2 (1.0.0)
51
+ faraday (>= 0.8, < 0.10)
52
+ jwt (~> 1.0)
53
+ multi_json (~> 1.3)
54
+ multi_xml (~> 0.5)
55
+ rack (~> 1.2)
56
+ parser (2.2.0.2)
57
+ ast (>= 1.1, < 3.0)
58
+ powerpack (0.0.9)
59
+ rack (1.6.0)
60
+ rainbow (2.0.0)
61
+ rake (10.4.2)
62
+ rdoc (4.2.0)
63
+ json (~> 1.4)
64
+ rspec (2.99.0)
65
+ rspec-core (~> 2.99.0)
66
+ rspec-expectations (~> 2.99.0)
67
+ rspec-mocks (~> 2.99.0)
68
+ rspec-core (2.99.2)
69
+ rspec-expectations (2.99.2)
70
+ diff-lcs (>= 1.1.3, < 2.0)
71
+ rspec-mocks (2.99.3)
72
+ rubocop (0.28.0)
73
+ astrolabe (~> 1.3)
74
+ parser (>= 2.2.0.pre.7, < 3.0)
75
+ powerpack (~> 0.0.6)
76
+ rainbow (>= 1.99.1, < 3.0)
77
+ ruby-progressbar (~> 1.4)
78
+ ruby-progressbar (1.7.1)
79
+ shoulda (3.5.0)
80
+ shoulda-context (~> 1.0, >= 1.0.1)
81
+ shoulda-matchers (>= 1.4.1, < 3.0)
82
+ shoulda-context (1.2.1)
83
+ shoulda-matchers (2.7.0)
84
+ activesupport (>= 3.0.0)
85
+ thread_safe (0.3.4)
26
86
 
27
87
  PLATFORMS
28
88
  ruby
29
89
 
30
90
  DEPENDENCIES
31
91
  activesupport (~> 3)
32
- bundler (~> 1.0.0)
92
+ bundler
33
93
  fakeweb (~> 1.3.0)
34
94
  httparty (>= 0.7.0)
35
- jeweler (~> 1.6.0)
36
- rcov
95
+ jeweler
37
96
  rspec (~> 2.6)
97
+ rubocop
38
98
  shoulda
data/README.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # federal_register
2
2
 
3
- Ruby API Client for FederalRegister.gov that handles searching articles and getting basic information about agencies.
3
+ Ruby API Client for FederalRegister.gov that handles searching documents and getting basic information about agencies.
4
4
 
5
5
  For more information about the FederalRegister.gov API, see http://www.federalregister.gov/learn/developers
6
6
 
7
7
  ## Usage
8
8
 
9
9
  ```ruby
10
- FederalRegister::Article.find('2011-17721').title
11
- result_set = FederalRegister::Article.search(:conditions => {:term => "Accessibility"})
10
+ FederalRegister::Document.find('2011-17721').title
11
+ result_set = FederalRegister::Document.search(:conditions => {:term => "Accessibility"})
12
12
  # or result_set = FederalRegister.find_all('2011-17721','2011-17722')
13
13
  result_set.count
14
- result_set.results.each do |article|
15
- puts "#{article.title} by #{article.agencies.map(&:name)}"
14
+ result_set.results.each do |document|
15
+ puts "#{document.title} by #{document.agencies.map(&:name)}"
16
16
  end
17
17
 
18
18
  FederalRegister::Agency.all.each do |agency|
@@ -21,7 +21,7 @@ end
21
21
  ```
22
22
 
23
23
  ## Contributing to federal_register
24
-
24
+
25
25
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
26
26
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
27
27
  * Fork the project