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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3717dd5953a1c90ed674b2c92413241a4f53fbf
4
- data.tar.gz: 229a5f369ae86f31a8b8950fedf5f5e847494377
3
+ metadata.gz: 06cd197b08c088af98022b59c01defacb98d6ebb
4
+ data.tar.gz: 2cede75781b0f8294cfd392019653a6e0f74bead
5
5
  SHA512:
6
- metadata.gz: f8fbb57a6b7a19cf0c4902a1646dd1a6b49c4c5e3331f11edd8287dbbfce5cd80796570f91b8175d388a7eb09f83891641ec937dabbec25d1314d2c91ffe1c57
7
- data.tar.gz: ce15422bc6904821202f11be135601bc4997c1c50fc4379d52e7d625189b62fb7ab1bee60fdb5f5231b4fd9cc5c1c2691c1bf5524b9c9996aadfbd369912831c
6
+ metadata.gz: 077fe3412f76cb26975809d547b09b7af80543553ec7c715f267b2929884f3cf0ba8255290b4bf14c9c6f652ce9b77e02195f81e98222ef32b66a3dc8651ff59
7
+ data.tar.gz: e6b72e3b91464bda0969317c37daca4a15e773b8744d77fa5d8bb8c660af4a04d0e4ef6b06ca9e7fd0de2bc71544c1c1526e6464252a8b6b6d8d1b8407dde976
@@ -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-z.\/ *]{2,26})\^(?<expiration>\d{4}|\^)(?<service_code>\d{3}|\^)(?<discretionary_data>[^\?]*)\?\Z/,
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
 
@@ -1,3 +1,3 @@
1
1
  module Magnet
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -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.2.0
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-09-27 00:00:00.000000000 Z
11
+ date: 2013-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest