ncua 0.8.4 → 0.9.0

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
  SHA1:
3
- metadata.gz: b66ae5fd48afbb1b8a73db423811db73488d6da0
4
- data.tar.gz: 16fe66cfb72e1d320609b4d9a1899cddd7fc514a
3
+ metadata.gz: 398980c10ce254d16210333409e04c87bb466da2
4
+ data.tar.gz: a1bd3146b069403d2e26bcbc06d21b7b980727a4
5
5
  SHA512:
6
- metadata.gz: a502b0426b462fd632f1c38229e75c3df6b4352845b149d9b857c423ca9c6e40f94cf237bdeee13c773470a6d3d8e59266b8931b2434696d376cf6379eabe7d6
7
- data.tar.gz: 2894eb4ab0e2a7c261d501ce6204bb1aaa2ba40d692e030831c1a968e7337bd774fb105479fae3a8e94535cf6b4cffc6172d08de8c2911b2cc11676e4e22b0e9
6
+ metadata.gz: 7dc57569862938332daca4e6e6357aa69e42aeb4e6291c0735c33b38ee6fb3ff0ccffb35624c15a888769a17100d6c0c607cac8293dbfc10f78c9b41557f1510
7
+ data.tar.gz: b824aece7492cccc508b30233a4003be96482d33bfbe41d6eebad135966c6d9cf71391e04f92ad1e1325771d896b6f7da5a9f92a63443e396861aea0523808b3
data/README.md CHANGED
@@ -110,8 +110,12 @@ You can also scrape this directly from the NCUA module by calling `NCUA.find_cre
110
110
 
111
111
  If you pass `nil` into this method, it will raise an `ArgumentError`. The NCUA will actually return a 200 without a charter number, but the data on the page is blank.
112
112
 
113
+ If you pass a non-numeric argument, such as `"foo"` into this method, it will also raise an `ArgumentError`.
114
+
113
115
  If for some reason the NCUA returns a 500 error when directly scraping for credit union details, the gem will raise `NCUA::CreditUnion::ServerError`. This can happen if your charter number is invalid.
114
116
 
117
+ In fact, we only really expect response codes in the 200 range. If the NCUA returns another response, the gem will raise `NCUA::CreditUnion::ServerError` with the response code in the description.
118
+
115
119
  ## Contributing
116
120
 
117
121
  Bug reports and pull requests are welcome on GitHub at https://github.com/ContinuityControl/ncua.
@@ -11,6 +11,10 @@ module NCUA
11
11
  raise ArgumentError, "charter number cannot be nil or empty string"
12
12
  end
13
13
 
14
+ if !(charter_number =~ /\A\d+\z/)
15
+ raise ArgumentError, "charter number must contain only digits"
16
+ end
17
+
14
18
  response = execute_query(charter_number)
15
19
 
16
20
  case response.code
@@ -1,3 +1,3 @@
1
1
  module NCUA
2
- VERSION = "0.8.4"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncua
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Reznick