ufid_parser 0.1.0 → 0.2.0
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/README.md +6 -3
- data/lib/ufid_parser.rb +5 -1
- data/lib/ufid_parser/version.rb +1 -1
- data/ufid_parser-0.1.0.gem +0 -0
- data/ufid_parser.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6386ead71c097fef9820994440d56e13f3350011
|
|
4
|
+
data.tar.gz: 12b0dd48c49176b82c9178cd557de1f7ee0308fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d555393eb9834a399abac63ec062b29359a01e36298d25927bfa1ecc2c43d7ed3c15d64ff1e7f2f8a45e0a6ef516005d7514fd0db2a97a9d1ec56e7376f4b00e
|
|
7
|
+
data.tar.gz: 7ca46fb2ef226a232368bee01fbae7540c01ddda8a05a508a153b15ebb737de9c88f6d15b807427463a73c1e1fb31f2c1e4bcda43306a9772520cf7e0571d66d
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# UFIDParser
|
|
2
2
|
|
|
3
|
-
The UFIDParser takes in a string read from the barcode on a UFID and
|
|
3
|
+
The UFIDParser takes in a string read from the barcode on a UFID and gives you access to the UFID number stored on the barcode.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -20,7 +20,10 @@ Or install it yourself as:
|
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
```ruby
|
|
24
|
+
ufid_obj = UfidParser::UFID.new(str)
|
|
25
|
+
puts ufid_obj.ufid_number
|
|
26
|
+
```
|
|
24
27
|
|
|
25
28
|
## Development
|
|
26
29
|
|
|
@@ -30,7 +33,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
30
33
|
|
|
31
34
|
## Contributing
|
|
32
35
|
|
|
33
|
-
1. Fork it ( https://github.com/
|
|
36
|
+
1. Fork it ( https://github.com/andrewjkerr/ufid_parser/fork )
|
|
34
37
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
35
38
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
36
39
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/ufid_parser.rb
CHANGED
|
@@ -11,8 +11,12 @@ module UfidParser
|
|
|
11
11
|
private
|
|
12
12
|
|
|
13
13
|
def parse_ufid_number(str)
|
|
14
|
+
splitter = [] << str[1]
|
|
15
|
+
splitter << str[-3]
|
|
16
|
+
splitter_str = "0#{splitter.reverse.join('')}00"
|
|
17
|
+
|
|
14
18
|
# Barcode has two occurrances of UFID number separated by this string
|
|
15
|
-
ufid_number_arr = str.split(
|
|
19
|
+
ufid_number_arr = str.split(splitter_str)
|
|
16
20
|
|
|
17
21
|
# Cut out the junk
|
|
18
22
|
ufid_number_arr[0] = ufid_number_arr.first[4..-1]
|
data/lib/ufid_parser/version.rb
CHANGED
|
Binary file
|
data/ufid_parser.gemspec
CHANGED
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.email = ["me+github@andrewjkerr.com"]
|
|
11
11
|
|
|
12
12
|
spec.summary = %q{Parses UFID numbers given a string from a UFID magnetic strip.}
|
|
13
|
-
spec.description = %q{Parses UFID numbers given a string from a UFID magnetic strip}
|
|
13
|
+
spec.description = %q{Parses UFID numbers given a string from a UFID magnetic strip.}
|
|
14
14
|
spec.homepage = "https://github.com/andrewjkerr/ufid_parser"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ufid_parser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Kerr
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-10-
|
|
11
|
+
date: 2015-10-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -38,7 +38,7 @@ dependencies:
|
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '10.0'
|
|
41
|
-
description: Parses UFID numbers given a string from a UFID magnetic strip
|
|
41
|
+
description: Parses UFID numbers given a string from a UFID magnetic strip.
|
|
42
42
|
email:
|
|
43
43
|
- me+github@andrewjkerr.com
|
|
44
44
|
executables: []
|
|
@@ -56,6 +56,7 @@ files:
|
|
|
56
56
|
- bin/setup
|
|
57
57
|
- lib/ufid_parser.rb
|
|
58
58
|
- lib/ufid_parser/version.rb
|
|
59
|
+
- ufid_parser-0.1.0.gem
|
|
59
60
|
- ufid_parser.gemspec
|
|
60
61
|
homepage: https://github.com/andrewjkerr/ufid_parser
|
|
61
62
|
licenses:
|