magnet 1.2.0 → 1.3.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/lib/magnet/parser.rb +1 -1
- data/lib/magnet/version.rb +1 -1
- data/test/magnet/parser_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 06cd197b08c088af98022b59c01defacb98d6ebb
|
|
4
|
+
data.tar.gz: 2cede75781b0f8294cfd392019653a6e0f74bead
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 077fe3412f76cb26975809d547b09b7af80543553ec7c715f267b2929884f3cf0ba8255290b4bf14c9c6f652ce9b77e02195f81e98222ef32b66a3dc8651ff59
|
|
7
|
+
data.tar.gz: e6b72e3b91464bda0969317c37daca4a15e773b8744d77fa5d8bb8c660af4a04d0e4ef6b06ca9e7fd0de2bc71544c1c1526e6464252a8b6b6d8d1b8407dde976
|
data/lib/magnet/parser.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Magnet
|
|
2
2
|
class Parser
|
|
3
3
|
TRACKS = {
|
|
4
|
-
1 => /\A%(?<format>[A-Z])(?<pan>[0-9 ]{1,19})\^(?<name>[A-Za-
|
|
4
|
+
1 => /\A%(?<format>[A-Z])(?<pan>[0-9 ]{1,19})\^(?<name>[A-Za-z0-9.\/ *]{2,26})\^(?<expiration>\d{4}|\^)(?<service_code>\d{3}|\^)(?<discretionary_data>[^\?]*)\?\Z/,
|
|
5
5
|
2 => /\A;(?<format>[A-Z])(?<pan>[0-9 ]{1,19})=(?<expiration>\d{4}|=)(?<service_code>\d{3}|=)(?<discretionary_data>[^\?]*)\?\Z/
|
|
6
6
|
}.freeze
|
|
7
7
|
|
data/lib/magnet/version.rb
CHANGED
data/test/magnet/parser_test.rb
CHANGED
|
@@ -87,5 +87,11 @@ describe Magnet::Parser do
|
|
|
87
87
|
assert_equal "3715 700000 00000", attributes[:pan]
|
|
88
88
|
assert_equal "HAMMOND/G ", attributes[:name]
|
|
89
89
|
end
|
|
90
|
+
|
|
91
|
+
it "should parse track data with numbers in the name" do
|
|
92
|
+
attributes = @parser.parse("%B4717270000000000^LLC/TESTING SCENTS5^0000000000000000000000000000000?")
|
|
93
|
+
|
|
94
|
+
assert_equal "LLC/TESTING SCENTS5", attributes[:name]
|
|
95
|
+
end
|
|
90
96
|
end
|
|
91
97
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: magnet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Kadolph
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-10-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|