credit-card-sms-parser 0.3.1 → 0.3.2

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: f496913835ae060eee743825b871d1737e4f99b1
4
- data.tar.gz: 57575ed5d42397e73c976162b4649461e497c02d
3
+ metadata.gz: 6f69894c240f9b44eeec232bbd138dc33bceaf45
4
+ data.tar.gz: 9969ed698d9b47095c1a6c91b7b156bf77531e43
5
5
  SHA512:
6
- metadata.gz: 13cc381c4780d91ac6597abc02fe47c4970d7a6b60ec5c50d60ec2871a7d9847491ba70769396a55473da29f4cd0c50a40b78a1d67cdab4f30bddcce2d143128
7
- data.tar.gz: 2ec27aea07fce935971a93c7e918aa233eed24c093eb13ac6ec1ca7a91fc19ecf18483326731667e31d89768299a50d8436034f6c5a859e43211502809b17266
6
+ metadata.gz: cfdb9df82c000e4737cef345c433a4488e1c7080df6de060b53b6ae41a5b2250d5fc39b7dc59165f3f9984d0f8ee243d3467378ceae68831ecb2a0ada4675cde
7
+ data.tar.gz: 588bc42731ce1b78539bdb143edc5bddcb35e2f5962fb3563dc1273935a92430f9caac53f8d9d7631a849a2f7098375714dd924492911b8acd463c2f1a630200
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,5 @@
1
+
2
+ ## Submitting Pull Requests
3
+
4
+ Before changes can be accepted a Contributor Licensing Agreement for [Individual](https://docs.google.com/forms/d/1d2R9aVafHTasTYirq-qZx_lx20Obss0ufUS-OtLpu20/viewform) | [Company](https://docs.google.com/forms/d/1hj5s1bkbmO1OP-UKnSNS6dsDkL1jFDL2XZ5d4IIFdb4/viewform) must be completed. You will be prompted to accept the CLA when you submit your first pull request. If you are Korean, send e-mail to <oss@daumkakao.com> for agree to the privacy. Then we will send you a CLA copy.
5
+
data/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2015, Daum Kakao Corp.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ * Neither the name Facebook nor the names of its contributors may be used to
15
+ endorse or promote products derived from this software without specific
16
+ prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -24,6 +24,8 @@ $ pry
24
24
  :money_total=>4645,
25
25
  :EOS=>nil}
26
26
  ```
27
+ 어느 정도 수준으로 동작하는지 확인만 해보고 싶은 용도라면 아래 웹사이트에서 간편하게 확인해볼 수 있다:
28
+ http://valider.realprobe.com/#/sms
27
29
 
28
30
  ## 현재까지 지원하는(걸로 추정되는) 카드사
29
31
  * 현대카드
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'credit-card-sms-parser'
7
- spec.version = '0.3.1'
7
+ spec.version = '0.3.2'
8
8
  spec.authors = %w(Hanson Benjamin)
9
9
  spec.email = %w(jehokim@live.com)
10
10
  if spec.respond_to?(:metadata)
@@ -18,7 +18,7 @@ class KoreanCreditCardLexer < RLTK::Lexer
18
18
  rule(/[\p{Hangul}\*]{2,4}님/) { |t| [:user_name, t]}
19
19
  rule(/누적[\s:\-]?[\d,\-]+원/) { |t| [:money_total, t.to_num] }
20
20
  rule(/누적-[\d,\-]+원/) { |t| [:money_total, t.to_num] }
21
- rule(/[\d,\-]+원/) { |t| [:money, t.to_num] }
21
+ rule(/[\d,\-]+원?/) { |t| [:money, t.to_num] }
22
22
  rule(/\(주\)\p{Hangul}+/) {|t| [:shop_name, t[3..-1]]}
23
23
  rule(/\p{Hangul}+\([\d\*]{4}\)/) {|t| [:card, t]}
24
24
  rule(/\S+은행/) {|t| [:bank, t]}
@@ -34,7 +34,7 @@ class KoreanCreditCardLexer < RLTK::Lexer
34
34
  t.chomp!(' 일시불')
35
35
  [:shop_name, t.strip]
36
36
  }
37
- rule(/[A-Za-z\p{Hangul}]+/) {|t| [:shop_name, t.strip]}
37
+ rule(/[0-9A-Za-z\p{Hangul}]+/) {|t| [:shop_name, t.strip]}
38
38
  rule(/[\p{L}]+/) {|t| [:word, t]}
39
39
  rule(/[\p{P}]+/) {|t| [:punctuation, t]}
40
40
  rule(/[\d\*]+/) { :number }
@@ -48,6 +48,7 @@ module CreditCardSmsParser
48
48
  '16449999' => '국민카드',
49
49
  '15881788' => '국민체크카드',
50
50
  '15884000' => '농협BC카드',
51
+ '15661000' => '씨티카드',
51
52
  }
52
53
 
53
54
  def parse_sms(sms_message, phone_number = nil)
@@ -61,6 +62,8 @@ module CreditCardSmsParser
61
62
  h.merge(card_company_name: CARD_MAP[phone_number])
62
63
  end
63
64
 
64
- h
65
+ h.reject {|key, _|
66
+ key == :header || key == :type || key == :punctuation || key == :space
67
+ }
65
68
  end
66
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credit-card-sms-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hanson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-04-30 00:00:00.000000000 Z
12
+ date: 2015-05-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rltk
@@ -64,8 +64,10 @@ extensions: []
64
64
  extra_rdoc_files: []
65
65
  files:
66
66
  - ".gitignore"
67
+ - CONTRIBUTING.md
67
68
  - Gemfile
68
69
  - Gemfile.lock
70
+ - LICENSE
69
71
  - README.md
70
72
  - Rakefile
71
73
  - bin/console