credit-card-sms-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39ba2660a8a5b6a4bc71144bf4031939ce420a39
4
- data.tar.gz: ed5b877f984985f037d9a83ebd63463f699bade1
3
+ metadata.gz: 9166f01686ad80ba2e447e31bbcf98c4f7f5d8a6
4
+ data.tar.gz: 869d799e4662b0888f178a43006609291f71e530
5
5
  SHA512:
6
- metadata.gz: e3ac1592a8d30faa13d0412c88616bfbf9810e4a2b3b4cba196aaf6f1e5dfdb6db329dbd780f6947738086df08af23b62bf748a3162bd32005973d609d75bc61
7
- data.tar.gz: 4afa4feb58009d5e4207321f3ccb4ca25f72793911ad88072bf5cffeed3690c982a6a4e97756216e9bd58b1b72fb80465d46c5174fb22404027294bb83b4dacf
6
+ metadata.gz: e0a8b9b03f682ba4b8d4c775d8552aa3e1f02cc634ca8f03ad550d5afd6b26fa0f9ab2d7d3edc3e35f44b046f16c3759d62aa006fb29a6b2707542366dc4c18f
7
+ data.tar.gz: 0f2a913311d103a1c7be094079acf04d65317c9dfe91cb3aa150bba8eba161512afe61a77dcbac59fbb07caf4edc20970b88ebd6fb2f4dcf9dbd620acc04394d
data/.gitignore CHANGED
@@ -34,3 +34,13 @@ tmp
34
34
 
35
35
  vendor/
36
36
  pkg/
37
+ /.bundle/
38
+ /.yardoc
39
+ /Gemfile.lock
40
+ /_yardoc/
41
+ /coverage/
42
+ /doc/
43
+ /pkg/
44
+ /spec/reports/
45
+ /tmp/
46
+
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in tms_client.gemspec
3
+ # Specify your gem's dependencies in credit-card-sms-parser.gemspec
4
4
  gemspec
5
5
 
6
6
  gem 'bump'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- credit-card-sms-parser (0.1.0)
4
+ credit-card-sms-parser (0.2.0)
5
5
  rltk
6
6
 
7
7
  GEM
@@ -28,7 +28,7 @@ GEM
28
28
  httpclient (2.6.0.1)
29
29
  i18n (0.7.0)
30
30
  json (1.8.2)
31
- minitest (5.5.1)
31
+ minitest (5.6.0)
32
32
  multipart-post (2.0.0)
33
33
  nesty (1.0.2)
34
34
  rack (1.6.0)
@@ -53,6 +53,7 @@ PLATFORMS
53
53
  DEPENDENCIES
54
54
  activesupport
55
55
  bump
56
+ bundler (~> 1.8)
56
57
  credit-card-sms-parser!
57
58
  geminabox
58
59
  minitest
data/README.md CHANGED
@@ -11,16 +11,16 @@ $ pry
11
11
  => true
12
12
  [2] pry(main)> include CreditCardSmsParser
13
13
  => Object
14
- [3] pry(main)> parse_sms('18001111', '하나(6*8*)***님 04/06 15:26 씨유판교 일시불/3,500원/누적-4,645
14
+ [3] pry(main)> parse_sms('하나(6*8*)***님 04/06 15:26 씨유판교 일시불/3,500원/누적-4,645원')
15
15
  => {:CARD=>"하나(6*8*)",
16
16
  :DATE=>"04/06",
17
17
  :TIME=>"15:26",
18
18
  :SHOP=>"씨유판교",
19
- :MONEY=>4645,
20
- :card_name=>"하나카드"}
19
+ :MONEY=>4645}
21
20
  ```
22
21
 
23
22
  ## 현재까지 지원하는(걸로 추정되는) 카드사
24
23
  * 현대카드
25
24
  * 하나SK카드
26
25
  * 국민카드
26
+ * 농협
data/bin/console ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+
5
+ # You can add fixtures and/or initialization code here to make experimenting
6
+ # with your gem easier. You can also use a different console, if you like.
7
+
8
+ # (If you use this, don't forget to add pry to your Gemfile!)
9
+ # require "pry"
10
+ # Pry.start
11
+
12
+ require 'irb'
13
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -1,22 +1,28 @@
1
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
- Gem::Specification.new do |gem|
6
- gem.name = 'credit-card-sms-parser'
7
- gem.version = '0.1.0'
8
- gem.licenses = %w(MIT)
9
- gem.authors = %w(Hanson Benjamin)
10
- gem.email = %w(jehokim@live.com)
11
- gem.description = 'It parses out the SMS notifications for each credit (or debit) transaction, allowing you to collect the following information: transaction amount, name of credit card company, payee (store), total amount. For the time being, support is limited to Korean credit card companies only.'
12
- gem.summary = 'Parsing credit card SMS messages'
13
- gem.homepage = 'https://github.com/kakao/credit-card-sms-parser'
14
- gem.metadata['allowed_push_host'] = 'https://rubygems.org'
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'credit-card-sms-parser'
7
+ spec.version = '0.2.0'
8
+ spec.authors = %w(Hanson Benjamin)
9
+ spec.email = %w(jehokim@live.com)
10
+ if spec.respond_to?(:metadata)
11
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
12
+ end
15
13
 
16
- gem.files = `git ls-files`.split($/)
17
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
- gem.require_paths = ['lib']
14
+ spec.summary = 'Parsing credit card SMS messages'
15
+ spec.description = 'It parses out the SMS notifications for each credit (or debit) transaction, allowing you to collect the following information: transaction amount, name of credit card company, payee (store), total amount. For the time being, support is limited to Korean credit card companies only.'
16
+ spec.homepage = 'https://github.com/kakao/credit-card-sms-parser'
17
+ spec.licenses = %w(MIT)
20
18
 
21
- gem.add_runtime_dependency 'rltk'
19
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.bindir = 'exe'
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
+ spec.require_paths = ['lib']
24
+
25
+ spec.add_runtime_dependency 'rltk'
26
+ spec.add_development_dependency 'bundler', '~> 1.8'
27
+ spec.add_development_dependency 'rake', '~> 10.0'
22
28
  end
data/icon.png ADDED
Binary file
@@ -27,7 +27,8 @@ class KoreanCreditCardLexer < RLTK::Lexer
27
27
  rule(/\d\d:\d\d/) {|t| [:TIME, t]}
28
28
  rule(/일시불/) { :TYPE }
29
29
  rule(/주식회사\p{Hangul}+/) {|t| [:SHOP, t[4..-1]]}
30
- rule(/\p{Hangul}+/) {|t| [:SHOP, t.strip]}
30
+ rule(/^\p{Hangul}+( +\p{Hangul}+)*$/) {|t| [:SHOP, t.strip]}
31
+ rule(/[A-Za-z\p{Hangul}]+/) {|t| [:SHOP, t.strip]}
31
32
  rule(/\//) {|t| [:SLASH, t]}
32
33
  rule(/[\p{L}\p{P}]+/) {|t| [:WORD, t]}
33
34
  rule(/[\d\*]+/) { :NUMBER }
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credit-card-sms-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hanson
8
8
  - Benjamin
9
9
  autorequire:
10
- bindir: bin
10
+ bindir: exe
11
11
  cert_chain: []
12
- date: 2015-04-14 00:00:00.000000000 Z
12
+ date: 2015-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rltk
@@ -25,6 +25,34 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.8'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.8'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '10.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '10.0'
28
56
  description: 'It parses out the SMS notifications for each credit (or debit) transaction,
29
57
  allowing you to collect the following information: transaction amount, name of credit
30
58
  card company, payee (store), total amount. For the time being, support is limited
@@ -40,10 +68,11 @@ files:
40
68
  - Gemfile.lock
41
69
  - README.md
42
70
  - Rakefile
71
+ - bin/console
72
+ - bin/setup
43
73
  - credit-card-sms-parser.gemspec
44
- - credit-card-sms-parser.iml
74
+ - icon.png
45
75
  - lib/credit_card_sms_parser.rb
46
- - test/test_credit_card_sms_parser.rb
47
76
  homepage: https://github.com/kakao/credit-card-sms-parser
48
77
  licenses:
49
78
  - MIT
@@ -69,5 +98,4 @@ rubygems_version: 2.4.6
69
98
  signing_key:
70
99
  specification_version: 4
71
100
  summary: Parsing credit card SMS messages
72
- test_files:
73
- - test/test_credit_card_sms_parser.rb
101
+ test_files: []
@@ -1,95 +0,0 @@
1
- require 'minitest/autorun'
2
- require 'credit_card_sms_parser'
3
- require 'active_support/core_ext/enumerable'
4
-
5
- class TestCreditCardSmsParser < Minitest::Test
6
- include CreditCardSmsParser
7
- def setup
8
- # @hyundae_card = CreditCardSmsParser::HyundaeCard.new
9
- # @hana_card = CreditCardSmsParser::HanaCard.new
10
- end
11
-
12
- def test_hyundae_card
13
- s = <<-eos
14
- [Web발신]
15
- [현대카드]-승인
16
- 김재*님
17
- 1,500원(일시불)
18
- 마노핀익스프레스신림
19
- 누적:354,220원
20
- eos
21
-
22
- assert_equal('마노핀익스프레스신림', parse_sms(s)[:SHOP])
23
- end
24
-
25
- def test_hana_card
26
- s = <<-eos
27
- [Web발신]
28
- 하나(6*8*)김*호님 04/06 15:26 씨유판교 일시불/3,500원/누적-4,645원
29
- eos
30
-
31
- assert_equal('씨유판교', parse_sms(s)[:SHOP])
32
- end
33
-
34
- def test_kb_card
35
- s = <<-eos
36
- [Web발신]
37
- KB국민카드 2*5*
38
- 정*욱님
39
- 03/25 09:30
40
- 2,200원
41
- 미니스톱판교점
42
- 누적 97,440원
43
- eos
44
-
45
- assert_equal('미니스톱판교점', parse_sms(s)[:SHOP])
46
- end
47
-
48
- def test_kb_card
49
- s = <<-eos
50
- [Web발신]
51
- 삼성가족카드승인9785
52
- 03/24 18:45
53
- 10,000원
54
- 일시불
55
- 소문난우동
56
- eos
57
-
58
- assert_equal('소문난우동', parse_sms(s)[:SHOP])
59
-
60
- s = <<-eos
61
- [Web발신]
62
- [KB]04/08 21:27
63
- 078501**554
64
- 주식회사개성
65
- 체크카드출금
66
- 13,000
67
- eos
68
-
69
- assert_equal('개성', parse_sms(s)[:SHOP])
70
- end
71
-
72
- def test_keb_hana_card
73
- s = <<-eos
74
- [Web발신]
75
- KEB하나 박솔*님 4*6*
76
- 일시불 30,000원
77
- (주)이니 03/23 09:58
78
- 누적 2,368,397원
79
- eos
80
-
81
- assert_equal('이니', parse_sms(s)[:SHOP])
82
- end
83
-
84
- def test_city_bc_card
85
- s = <<-eos
86
- [체크.승인]
87
- 22,000원
88
- 씨티BC(1*9*)김*정님
89
- 01/23 12:34
90
- 매일식당
91
- eos
92
-
93
- assert_equal('매일식당', parse_sms(s)[:SHOP])
94
- end
95
- end