syamei 0.1.2 → 0.2.1
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/.circleci/config.yml +101 -0
- data/.github/dependabot.yml +17 -0
- data/.gitignore +5 -2
- data/.rubocop.yml +100 -0
- data/.ruby-version +1 -1
- data/.travis.yml +2 -2
- data/CHANGELOG.md +50 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +71 -0
- data/README.md +37 -2
- data/Rakefile +3 -3
- data/lib/syamei/version.rb +1 -1
- data/lib/syamei.rb +17 -12
- data/syamei.gemspec +25 -21
- metadata +71 -11
- data/.idea/.gitignore +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cb0c1f7556998753233cc84468cdaced7f4eb253200dfae1b22ca37f98497fa
|
4
|
+
data.tar.gz: d3aaf2346d2e35e907af7ecd5b31daef6ccb18b81e900bd2de5e699a33993304
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fee6da86122c53c1673381fd834ad778e54142720f72d28963edb4c5f634d25baeb2daf753ede58551a4a81ecce08181706fefb405a375f8a38951501b8dbedd
|
7
|
+
data.tar.gz: 59a78c8019c99bb28c8f89b01fbb0aebb183a35e695d4c290b525ecb866e7cd3f668ef720bdfa5e10725af0fa56cd9e14f49e521d694804da6a2081767916700
|
@@ -0,0 +1,101 @@
|
|
1
|
+
version: 2
|
2
|
+
jobs:
|
3
|
+
build:
|
4
|
+
parallelism: 3
|
5
|
+
docker:
|
6
|
+
- image: circleci/ruby:2.7
|
7
|
+
environment:
|
8
|
+
BUNDLE_JOBS: 3
|
9
|
+
BUNDLE_RETRY: 3
|
10
|
+
BUNDLE_PATH: vendor/bundle
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- checkout
|
14
|
+
|
15
|
+
- run:
|
16
|
+
name: install Bundler
|
17
|
+
command: |
|
18
|
+
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
|
19
|
+
source $BASH_ENV
|
20
|
+
gem install bundler
|
21
|
+
|
22
|
+
- run:
|
23
|
+
name: Which bundler?
|
24
|
+
command: bundle -v
|
25
|
+
|
26
|
+
- restore_cache:
|
27
|
+
keys:
|
28
|
+
- gem-sample-{{ checksum "Gemfile.lock" }}
|
29
|
+
- gem-sample-
|
30
|
+
|
31
|
+
- run:
|
32
|
+
name: Bundle Install
|
33
|
+
command: bundle check --path vendor/bundle || bundle install --deployment
|
34
|
+
|
35
|
+
- save_cache:
|
36
|
+
key: gem-sample-{{ checksum "Gemfile.lock" }}
|
37
|
+
paths:
|
38
|
+
- vendor/bundle
|
39
|
+
|
40
|
+
- run:
|
41
|
+
name: run rubocop
|
42
|
+
command: |
|
43
|
+
bundle exec rubocop
|
44
|
+
- run:
|
45
|
+
name: Run rspec in parallel
|
46
|
+
command: |
|
47
|
+
bundle exec rspec --profile 10 \
|
48
|
+
--format RspecJunitFormatter \
|
49
|
+
--out test_results/rspec.xml \
|
50
|
+
--format progress \
|
51
|
+
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
52
|
+
- store_test_results:
|
53
|
+
path: test_results
|
54
|
+
- store_artifacts:
|
55
|
+
path: test_results
|
56
|
+
destination: test-results
|
57
|
+
- store_artifacts:
|
58
|
+
path: coverage
|
59
|
+
destination: coverage-results
|
60
|
+
deploy:
|
61
|
+
docker:
|
62
|
+
- image: circleci/ruby:2.6.7
|
63
|
+
|
64
|
+
steps:
|
65
|
+
- checkout
|
66
|
+
|
67
|
+
- run:
|
68
|
+
name: install Bundler
|
69
|
+
command: |
|
70
|
+
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
|
71
|
+
source $BASH_ENV
|
72
|
+
gem install bundler
|
73
|
+
- run:
|
74
|
+
name: Which bundler?
|
75
|
+
command: bundle -v
|
76
|
+
|
77
|
+
- restore_cache:
|
78
|
+
keys:
|
79
|
+
- gem-deploy-{{ checksum "Gemfile.lock" }}
|
80
|
+
- gem-deploy-
|
81
|
+
|
82
|
+
- run:
|
83
|
+
name: Bundle Install
|
84
|
+
command: bundle check --path vendor/bundle || bundle install
|
85
|
+
|
86
|
+
- save_cache:
|
87
|
+
key: gem-deploy-{{ checksum "Gemfile.lock" }}
|
88
|
+
paths:
|
89
|
+
- vendor/bundle
|
90
|
+
|
91
|
+
workflows:
|
92
|
+
version: 2
|
93
|
+
build-and-deploy:
|
94
|
+
jobs:
|
95
|
+
- build
|
96
|
+
- deploy:
|
97
|
+
requires:
|
98
|
+
- build
|
99
|
+
filters:
|
100
|
+
branches:
|
101
|
+
only: master
|
@@ -0,0 +1,17 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: daily
|
7
|
+
time: "20:00"
|
8
|
+
open-pull-requests-limit: 10
|
9
|
+
ignore:
|
10
|
+
- dependency-name: rubocop
|
11
|
+
versions:
|
12
|
+
- 1.10.0
|
13
|
+
- 1.11.0
|
14
|
+
- 1.12.0
|
15
|
+
- 1.12.1
|
16
|
+
- 1.9.0
|
17
|
+
- 1.9.1
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- "tmp/**/*"
|
4
|
+
- "config/initializers/*"
|
5
|
+
- "vendor/**/*"
|
6
|
+
- "bin/*"
|
7
|
+
DisplayCopNames: true
|
8
|
+
TargetRubyVersion: 2.7.3
|
9
|
+
|
10
|
+
Style/AsciiComments:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Style/Documentation:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Style/NumericLiterals:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Bundler/OrderedGems:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Metrics/BlockLength:
|
23
|
+
Exclude:
|
24
|
+
- 'syamei.gemspec'
|
25
|
+
- 'spec/**/*'
|
26
|
+
|
27
|
+
Style/FrozenStringLiteralComment:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
Layout/SpaceAroundMethodCallOperator:
|
34
|
+
Enabled: true
|
35
|
+
|
36
|
+
Lint/DeprecatedOpenSSLConstant:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
Lint/RaiseException:
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
Lint/StructNewOverride:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
Layout/LineLength:
|
46
|
+
Max: 120
|
47
|
+
|
48
|
+
Lint/DuplicateElsifCondition:
|
49
|
+
Enabled: true
|
50
|
+
|
51
|
+
Lint/MixedRegexpCaptureTypes:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
Style/AccessorGrouping:
|
55
|
+
Enabled: true
|
56
|
+
|
57
|
+
Style/ArrayCoercion:
|
58
|
+
Enabled: true
|
59
|
+
|
60
|
+
Style/BisectedAttrAccessor:
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
Style/CaseLikeIf:
|
64
|
+
Enabled: true
|
65
|
+
|
66
|
+
Style/ExponentialNotation:
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Style/HashAsLastArrayItem:
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
Style/HashEachMethods:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
Style/HashLikeCase:
|
76
|
+
Enabled: true
|
77
|
+
|
78
|
+
Style/HashTransformKeys:
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
Style/HashTransformValues:
|
82
|
+
Enabled: true
|
83
|
+
|
84
|
+
Style/RedundantAssignment:
|
85
|
+
Enabled: true
|
86
|
+
|
87
|
+
Style/RedundantFetchBlock:
|
88
|
+
Enabled: true
|
89
|
+
|
90
|
+
Style/RedundantFileExtensionInRequire:
|
91
|
+
Enabled: true
|
92
|
+
|
93
|
+
Style/RedundantRegexpCharacterClass:
|
94
|
+
Enabled: true
|
95
|
+
|
96
|
+
Style/RedundantRegexpEscape:
|
97
|
+
Enabled: true
|
98
|
+
|
99
|
+
Style/SlicingWithRange:
|
100
|
+
Enabled: true
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
## 0.2.1 (2021-12-29)
|
2
|
+
|
3
|
+
* Bump rake from 13.0.3 to 13.0.6 ([0d072e0](https://github.com/yposi/syamei/commit/0d072e0))
|
4
|
+
* circleci image's version up ([eb94d5c](https://github.com/yposi/syamei/commit/eb94d5c))
|
5
|
+
|
6
|
+
## 0.2.0 (2021-05-06)
|
7
|
+
|
8
|
+
* ruby version up 2.6 to 2.7 ([de3ae55](https://github.com/yposi/syamei/commit/de3ae55))
|
9
|
+
* version up 0.2.0 ([dcedaea](https://github.com/yposi/syamei/commit/dcedaea))
|
10
|
+
|
11
|
+
## <small>0.1.4 (2021-05-06)</small>
|
12
|
+
|
13
|
+
* add rspec ([7f2598a](https://github.com/yposi/syamei/commit/7f2598a))
|
14
|
+
* Bump rake from 13.0.1 to 13.0.3 ([0d72f84](https://github.com/yposi/syamei/commit/0d72f84))
|
15
|
+
* Bump rspec from 3.9.0 to 3.10.0 ([9e4c714](https://github.com/yposi/syamei/commit/9e4c714))
|
16
|
+
* Bump rubocop-rspec from 1.42.0 to 1.44.1 ([695b6c0](https://github.com/yposi/syamei/commit/695b6c0))
|
17
|
+
* Bump simplecov from 0.18.5 to 0.21.2 ([375f478](https://github.com/yposi/syamei/commit/375f478))
|
18
|
+
* delete .idea ([cf8a071](https://github.com/yposi/syamei/commit/cf8a071))
|
19
|
+
* delete rspec version specification ([b9c903c](https://github.com/yposi/syamei/commit/b9c903c))
|
20
|
+
* delete rubocop version specification ([31b91f9](https://github.com/yposi/syamei/commit/31b91f9))
|
21
|
+
* fix Gemfile.lock ([dccbb14](https://github.com/yposi/syamei/commit/dccbb14))
|
22
|
+
* fix rubocop ([f48db49](https://github.com/yposi/syamei/commit/f48db49))
|
23
|
+
* ruby version up ([b2e592e](https://github.com/yposi/syamei/commit/b2e592e))
|
24
|
+
* Update bundler requirement from ~> 1.17 to ~> 2.2 ([fa98eb7](https://github.com/yposi/syamei/commit/fa98eb7))
|
25
|
+
* Upgrade to GitHub-native Dependabot ([6ddc6ea](https://github.com/yposi/syamei/commit/6ddc6ea))
|
26
|
+
* version up 0.1.4 ([84a6db5](https://github.com/yposi/syamei/commit/84a6db5))
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
## <small>0.1.3 (2020-07-30)</small>
|
31
|
+
|
32
|
+
* add methods ([c2ed443](https://github.com/yposi/syamei/commit/c2ed443))
|
33
|
+
* add methods ([a235ea5](https://github.com/yposi/syamei/commit/a235ea5))
|
34
|
+
* circleci導入 ([f751c3c](https://github.com/yposi/syamei/commit/f751c3c))
|
35
|
+
* fix gemspec ([03d1abd](https://github.com/yposi/syamei/commit/03d1abd))
|
36
|
+
* fix README ([bc8a0fe](https://github.com/yposi/syamei/commit/bc8a0fe))
|
37
|
+
* fix rubocop.yml ([da5864a](https://github.com/yposi/syamei/commit/da5864a))
|
38
|
+
* rake version up ([4b75ce9](https://github.com/yposi/syamei/commit/4b75ce9))
|
39
|
+
* READMEを更新 ([b9ded2a](https://github.com/yposi/syamei/commit/b9ded2a))
|
40
|
+
* remove TODO ([2d798b2](https://github.com/yposi/syamei/commit/2d798b2))
|
41
|
+
* run bundle gem ([f3fba71](https://github.com/yposi/syamei/commit/f3fba71))
|
42
|
+
* Update README.md ([978c371](https://github.com/yposi/syamei/commit/978c371))
|
43
|
+
* version up ([ad252e7](https://github.com/yposi/syamei/commit/ad252e7))
|
44
|
+
* version up 0.1.3 ([c215746](https://github.com/yposi/syamei/commit/c215746))
|
45
|
+
* データの持ち方を変更 ([18444b3](https://github.com/yposi/syamei/commit/18444b3))
|
46
|
+
* 省略文字の実装漏れ修正 ([a343202](https://github.com/yposi/syamei/commit/a343202))
|
47
|
+
* 自動化リリース断念 ([8951f7a](https://github.com/yposi/syamei/commit/8951f7a))
|
48
|
+
|
49
|
+
|
50
|
+
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
3
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in syamei.gemspec
|
6
6
|
gemspec
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
syamei (0.2.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.2)
|
10
|
+
diff-lcs (1.4.4)
|
11
|
+
docile (1.3.5)
|
12
|
+
parallel (1.20.1)
|
13
|
+
parser (3.0.1.1)
|
14
|
+
ast (~> 2.4.1)
|
15
|
+
rainbow (3.0.0)
|
16
|
+
rake (13.0.6)
|
17
|
+
regexp_parser (2.1.1)
|
18
|
+
rexml (3.2.5)
|
19
|
+
rspec (3.10.0)
|
20
|
+
rspec-core (~> 3.10.0)
|
21
|
+
rspec-expectations (~> 3.10.0)
|
22
|
+
rspec-mocks (~> 3.10.0)
|
23
|
+
rspec-core (3.10.1)
|
24
|
+
rspec-support (~> 3.10.0)
|
25
|
+
rspec-expectations (3.10.1)
|
26
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
+
rspec-support (~> 3.10.0)
|
28
|
+
rspec-mocks (3.10.2)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.10.0)
|
31
|
+
rspec-support (3.10.2)
|
32
|
+
rspec_junit_formatter (0.4.1)
|
33
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
34
|
+
rubocop (0.93.1)
|
35
|
+
parallel (~> 1.10)
|
36
|
+
parser (>= 2.7.1.5)
|
37
|
+
rainbow (>= 2.2.2, < 4.0)
|
38
|
+
regexp_parser (>= 1.8)
|
39
|
+
rexml
|
40
|
+
rubocop-ast (>= 0.6.0)
|
41
|
+
ruby-progressbar (~> 1.7)
|
42
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
43
|
+
rubocop-ast (1.5.0)
|
44
|
+
parser (>= 3.0.1.1)
|
45
|
+
rubocop-rspec (1.44.1)
|
46
|
+
rubocop (~> 0.87)
|
47
|
+
rubocop-ast (>= 0.7.1)
|
48
|
+
ruby-progressbar (1.11.0)
|
49
|
+
simplecov (0.21.2)
|
50
|
+
docile (~> 1.1)
|
51
|
+
simplecov-html (~> 0.11)
|
52
|
+
simplecov_json_formatter (~> 0.1)
|
53
|
+
simplecov-html (0.12.3)
|
54
|
+
simplecov_json_formatter (0.1.3)
|
55
|
+
unicode-display_width (1.7.0)
|
56
|
+
|
57
|
+
PLATFORMS
|
58
|
+
ruby
|
59
|
+
|
60
|
+
DEPENDENCIES
|
61
|
+
bundler (~> 2.2)
|
62
|
+
rake (>= 12.3.3)
|
63
|
+
rspec
|
64
|
+
rspec_junit_formatter
|
65
|
+
rubocop
|
66
|
+
rubocop-rspec
|
67
|
+
simplecov
|
68
|
+
syamei!
|
69
|
+
|
70
|
+
BUNDLED WITH
|
71
|
+
2.2.17
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# Syamei
|
2
|
+
[](https://badge.fury.io/rb/syamei)
|
3
|
+
[](LICENSE)
|
2
4
|
|
3
5
|
syameiは、法人格の存在チェック、削除に使用するライブラリです。
|
4
6
|
会社名の名寄せなどで利用されることを目的としています。
|
@@ -23,7 +25,40 @@ Or install it yourself as:
|
|
23
25
|
|
24
26
|
社名のみを返す(法人格を削除)
|
25
27
|
```
|
26
|
-
Syamei.only('株式会社xxx')
|
28
|
+
Syamei.only('株式会社xxx') => "xxx" # 引数1つはすべて
|
29
|
+
Syamei.only('株式会社xxx', 0) => "xxx" # type=0はすべて
|
30
|
+
Syamei.only('株式会社xxx', 1) => "xxx" # type=1は法人格フル
|
31
|
+
Syamei.only('株式会社xxx', 2) => "株式会社xxx" # type=2は特殊文字
|
32
|
+
Syamei.only('株式会社xxx', 3) => "株式会社xxx" # type=3は省略文字
|
33
|
+
Syamei.only('株式会社xxx', 4) => "株式会社xxx" # type=4はカナ
|
34
|
+
|
35
|
+
Syamei.only('㈱xxx') => "xxx" # 引数1つはすべて
|
36
|
+
Syamei.only('㈱xxx', 0) => "xxx" # type=0はすべて
|
37
|
+
Syamei.only('㈱xxx', 1) => "㈱xxx" # type=1は法人格フル
|
38
|
+
Syamei.only('㈱xxx', 2) => "xxx" # type=2は特殊文字
|
39
|
+
Syamei.only('㈱xxx', 3) => "㈱xxx" # type=3は省略文字
|
40
|
+
Syamei.only('㈱xxx', 4) => "㈱xxx" # type=4はカナ
|
41
|
+
|
42
|
+
Syamei.only('(株)xxx') => "xxx" # 引数1つはすべて
|
43
|
+
Syamei.only('(株)xxx', 0) => "xxx" # type=0はすべて
|
44
|
+
Syamei.only('(株)xxx', 1) => "(株)xxx" # type=1は法人格フル
|
45
|
+
Syamei.only('(株)xxx', 2) => "(株)xxx" # type=2は特殊文字
|
46
|
+
Syamei.only('(株)xxx', 3) => "xxx" # type=3は省略文字
|
47
|
+
Syamei.only('(株)xxx', 4) => "(株)xxx" # type=4はカナ
|
48
|
+
|
49
|
+
Syamei.only('カ)xxx') => "xxx" # 引数1つはすべて
|
50
|
+
Syamei.only('カ)xxx', 0) => "xxx" # type=0はすべて
|
51
|
+
Syamei.only('カ)xxx', 1) => "カ)xxx" # type=1は法人格フル
|
52
|
+
Syamei.only('カ)xxx', 2) => "カ)xxx" # type=2は特殊文字
|
53
|
+
Syamei.only('カ)xxx', 3) => "カ)xxx" # type=3は省略文字
|
54
|
+
Syamei.only('カ)xxx', 4) => "xxx" # type=4はカナ
|
55
|
+
|
56
|
+
Syamei.only('xxx(カ') => "xxx" # 引数1つはすべて
|
57
|
+
Syamei.only('xxx(カ', 0) => "xxx" # type=0はすべて
|
58
|
+
Syamei.only('xxx(カ', 1) => "xxx(カ" # type=1は法人格フル
|
59
|
+
Syamei.only('xxx(カ', 2) => "xxx(カ" # type=2は特殊文字
|
60
|
+
Syamei.only('xxx(カ', 3) => "xxx(カ" # type=3は省略文字
|
61
|
+
Syamei.only('xxx(カ', 4) => "xxx" # type=4はカナ
|
27
62
|
```
|
28
63
|
|
29
64
|
末尾の法人格を削除
|
@@ -54,4 +89,4 @@ Syamei.list
|
|
54
89
|
1. Create your feature branch (git checkout -b my-new-feature)
|
55
90
|
1. Commit your changes (git commit -am 'Add some feature')
|
56
91
|
1. Push to the branch (git push origin my-new-feature)
|
57
|
-
1. Create new Pull Request
|
92
|
+
1. Create new Pull Request
|
data/Rakefile
CHANGED
data/lib/syamei/version.rb
CHANGED
data/lib/syamei.rb
CHANGED
@@ -14,14 +14,15 @@ module Syamei
|
|
14
14
|
|
15
15
|
COMPLEX_TYPE = {
|
16
16
|
0 => {
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
all: [NOTATION, SPECIAL, ABBREVIATION, KANA_HEAD, KANA_TAIL].join('|'),
|
18
|
+
head: [NOTATION, SPECIAL, ABBREVIATION, KANA_HEAD].join('|'),
|
19
|
+
tail: [NOTATION, SPECIAL, ABBREVIATION, KANA_TAIL].join('|')
|
20
20
|
},
|
21
21
|
1 => NOTATION.join('|'),
|
22
22
|
2 => SPECIAL.join('|'),
|
23
|
-
3 =>
|
24
|
-
|
23
|
+
3 => ABBREVIATION.join('|'),
|
24
|
+
4 => {
|
25
|
+
all: [KANA_HEAD, KANA_TAIL].join('|'),
|
25
26
|
head: KANA_HEAD.join('|'),
|
26
27
|
tail: KANA_TAIL.join('|')
|
27
28
|
}
|
@@ -31,7 +32,8 @@ module Syamei
|
|
31
32
|
def self.with_beginning?(name, type = 0)
|
32
33
|
return false if name.nil? || name.empty?
|
33
34
|
|
34
|
-
return name.match?(/^(#{COMPLEX_TYPE[type][:head]}).*$/) if type.zero? || type ==
|
35
|
+
return name.match?(/^(#{COMPLEX_TYPE[type][:head]}).*$/) if type.zero? || type == 4
|
36
|
+
|
35
37
|
name.match?(/^(#{COMPLEX_TYPE[type]}).*$/)
|
36
38
|
end
|
37
39
|
|
@@ -39,7 +41,8 @@ module Syamei
|
|
39
41
|
def self.with_end?(name, type = 0)
|
40
42
|
return false if name.nil? || name.empty?
|
41
43
|
|
42
|
-
return name.match?(/.*(#{COMPLEX_TYPE[type][:tail]})$/) if type.zero? || type ==
|
44
|
+
return name.match?(/.*(#{COMPLEX_TYPE[type][:tail]})$/) if type.zero? || type == 4
|
45
|
+
|
43
46
|
name.match?(/.*(#{COMPLEX_TYPE[type]})$/)
|
44
47
|
end
|
45
48
|
|
@@ -54,7 +57,8 @@ module Syamei
|
|
54
57
|
def self.with_beginning(name, type = 0)
|
55
58
|
return nil if name.nil? || name.empty?
|
56
59
|
|
57
|
-
return name.gsub(/(#{COMPLEX_TYPE[type][:tail]})$/, '').strip if type.zero? || type ==
|
60
|
+
return name.gsub(/(#{COMPLEX_TYPE[type][:tail]})$/, '').strip if type.zero? || type == 4
|
61
|
+
|
58
62
|
name.gsub(/(#{COMPLEX_TYPE[type]})$/, '').strip
|
59
63
|
end
|
60
64
|
|
@@ -62,7 +66,8 @@ module Syamei
|
|
62
66
|
def self.with_end(name, type = 0)
|
63
67
|
return nil if name.nil? || name.empty?
|
64
68
|
|
65
|
-
return name.gsub(/^(#{COMPLEX_TYPE[type][:head]})/, '').strip if type.zero? || type ==
|
69
|
+
return name.gsub(/^(#{COMPLEX_TYPE[type][:head]})/, '').strip if type.zero? || type == 4
|
70
|
+
|
66
71
|
name.gsub(/^(#{COMPLEX_TYPE[type]})/, '').strip
|
67
72
|
end
|
68
73
|
|
@@ -71,14 +76,14 @@ module Syamei
|
|
71
76
|
return nil if name.nil? || name.empty?
|
72
77
|
|
73
78
|
name = with_beginning(name, type)
|
74
|
-
|
75
|
-
name
|
79
|
+
with_end(name, type)
|
76
80
|
end
|
77
81
|
|
78
82
|
def self.notation(name, type = 0)
|
79
83
|
return nil if name.nil? || name.empty?
|
80
84
|
|
81
|
-
return name[/(#{COMPLEX_TYPE[type][:all]})/, 1] if type.zero? || type ==
|
85
|
+
return name[/(#{COMPLEX_TYPE[type][:all]})/, 1] if type.zero? || type == 4
|
86
|
+
|
82
87
|
name[/(#{COMPLEX_TYPE[type]})/, 1]
|
83
88
|
end
|
84
89
|
|
data/syamei.gemspec
CHANGED
@@ -1,40 +1,44 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
3
|
+
require 'syamei/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
6
|
+
spec.name = 'syamei'
|
8
7
|
spec.version = Syamei::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
8
|
+
spec.authors = ['Shuhei Yamashita']
|
9
|
+
spec.email = ['y.shuhei0501@gmail.com']
|
11
10
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
11
|
+
spec.summary = 'Cut company name notation.'
|
12
|
+
spec.description = 'Cut company name notation.'
|
13
|
+
spec.homepage = 'https://github.com/yposi/syamei'
|
14
|
+
spec.license = 'MIT'
|
16
15
|
|
17
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
17
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
18
|
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata[
|
21
|
-
spec.metadata[
|
22
|
-
spec.metadata[
|
19
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
+
spec.metadata['source_code_uri'] = 'https://github.com/yposi/syamei'
|
21
|
+
spec.metadata['changelog_uri'] = 'https://github.com/yposi/syamei'
|
23
22
|
else
|
24
|
-
raise
|
25
|
-
|
23
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
24
|
+
'public gem pushes.'
|
26
25
|
end
|
27
26
|
|
28
27
|
# Specify which files should be added to the gem when it is released.
|
29
28
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
30
|
-
spec.files
|
29
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
31
30
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
32
31
|
end
|
33
|
-
spec.bindir =
|
32
|
+
spec.bindir = 'exe'
|
34
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
35
|
-
spec.require_paths = [
|
34
|
+
spec.require_paths = ['lib']
|
35
|
+
spec.required_ruby_version = '>= 2.7'
|
36
36
|
|
37
|
-
spec.add_development_dependency
|
38
|
-
spec.add_development_dependency
|
39
|
-
spec.add_development_dependency
|
37
|
+
spec.add_development_dependency 'bundler', '~> 2.2'
|
38
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
39
|
+
spec.add_development_dependency 'rspec'
|
40
|
+
spec.add_development_dependency 'rspec_junit_formatter'
|
41
|
+
spec.add_development_dependency 'rubocop'
|
42
|
+
spec.add_development_dependency 'rubocop-rspec'
|
43
|
+
spec.add_development_dependency 'simplecov'
|
40
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syamei
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shuhei Yamashita
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,16 +42,72 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec_junit_formatter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
55
111
|
description: Cut company name notation.
|
56
112
|
email:
|
57
113
|
- y.shuhei0501@gmail.com
|
@@ -59,14 +115,18 @@ executables: []
|
|
59
115
|
extensions: []
|
60
116
|
extra_rdoc_files: []
|
61
117
|
files:
|
118
|
+
- ".circleci/config.yml"
|
119
|
+
- ".github/dependabot.yml"
|
62
120
|
- ".gitignore"
|
63
|
-
- ".idea/.gitignore"
|
64
121
|
- ".rakeTasks"
|
65
122
|
- ".rspec"
|
123
|
+
- ".rubocop.yml"
|
66
124
|
- ".ruby-version"
|
67
125
|
- ".travis.yml"
|
126
|
+
- CHANGELOG.md
|
68
127
|
- CODE_OF_CONDUCT.md
|
69
128
|
- Gemfile
|
129
|
+
- Gemfile.lock
|
70
130
|
- LICENSE.txt
|
71
131
|
- README.md
|
72
132
|
- Rakefile
|
@@ -91,14 +151,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
151
|
requirements:
|
92
152
|
- - ">="
|
93
153
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
154
|
+
version: '2.7'
|
95
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
156
|
requirements:
|
97
157
|
- - ">="
|
98
158
|
- !ruby/object:Gem::Version
|
99
159
|
version: '0'
|
100
160
|
requirements: []
|
101
|
-
rubygems_version: 3.
|
161
|
+
rubygems_version: 3.1.6
|
102
162
|
signing_key:
|
103
163
|
specification_version: 4
|
104
164
|
summary: Cut company name notation.
|
data/.idea/.gitignore
DELETED