pigeon_band 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +1 -0
- data/README.md +13 -2
- data/lib/pigeon_band/version.rb +1 -1
- 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: c068f38af42b53131bb136a6ad108e06de31f2d2
|
4
|
+
data.tar.gz: cb14f929059911297cd641889c7ee823fea2515a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e6d54d61de19af266e2a451ca497ff4d9dc173e741afa96165beaf29993f4bc71b12659b60a9f58298237952550f9fc32048c0d1eaa935bf746be97e5a7a84c
|
7
|
+
data.tar.gz: d40911654fd7f86e5ba15d390e0bfac2d44820be38152c8dd6050ddff0bf45ae402bc5f5d8caa0c78b8264e34ab1c7b4463c38749e6974bd644e0a6c1e48eb39
|
data/Makefile
CHANGED
data/README.md
CHANGED
@@ -30,12 +30,23 @@ Or install it yourself as:
|
|
30
30
|
## Usage
|
31
31
|
|
32
32
|
After loading the pigeon_band gem, there is a new object PigeonBand with one method #format.
|
33
|
-
Given a band as a string, it returns a hash consisting of
|
33
|
+
Given a band as a string, it returns a hash consisting of five fields. Thus, given the
|
34
34
|
above bands a input, a call to PigeonBand#format would return the following hashes:
|
35
35
|
|
36
|
+
* band
|
37
|
+
* The normalized band as it should be displayed
|
38
|
+
* coll
|
39
|
+
* The band formatted for easy collation (filled e.g. with leading spaces)
|
40
|
+
* year
|
41
|
+
* The (four-digit) year as extracted from the band
|
42
|
+
* code
|
43
|
+
* The (ISO3166-1) country code as extracted from the band
|
44
|
+
* error
|
45
|
+
* The error message if the band is invalid, otherwise nil
|
46
|
+
|
36
47
|
```ruby
|
37
48
|
PigeonBand.format("DV-06914-12-479")
|
38
|
-
{ band: "DV-06914-12-479" coll: "DV-06914-12-0479" year: 2012 code: "DE" }
|
49
|
+
{ band: "DV-06914-12-479" coll: "DV-06914-12-0479" year: 2012 code: "DE" error: nil }
|
39
50
|
```
|
40
51
|
## Development
|
41
52
|
|
data/lib/pigeon_band/version.rb
CHANGED