tate 1.4.0 → 1.7.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/.github/workflows/publish.yml +24 -0
- data/.github/workflows/test.yml +53 -0
- data/.tool-versions +1 -0
- data/Gemfile +3 -1
- data/LICENSE.txt +1 -1
- data/README.md +23 -6
- data/Rakefile +3 -1
- data/bin/console +1 -0
- data/bin/tate +12 -12
- data/lib/tate/version.rb +3 -1
- data/lib/tate.rb +8 -7
- data/tate.gemspec +22 -21
- metadata +37 -29
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 315899edcf8166179ea26996ede5fadaa052db6b039667c48427aabd2d6c6f90
|
4
|
+
data.tar.gz: be1cf852a4a2c0e16fec95b6b18fcf313f548f447bf6bae5fea771efd44db59c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7074a99304c2b3bd8c4254cf4c43ab310c8af32e59064f1ebd1f72b784e38e4fb21c2738f816768312fb00cecc59a5d95d560be2c38a79686e588c296974a86
|
7
|
+
data.tar.gz: 3ea872c374514fa6e07a96e836147b32f5d988ee2da097fe3ba848d4a1423a7e7adadd3c96a5795b4fe7f105ec0c211b2ba912e48b48f023cccdc4bd3a9bd4a3
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Publish
|
2
|
+
|
3
|
+
on:
|
4
|
+
release:
|
5
|
+
types: [published]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
name: Publish Packages
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
|
15
|
+
- name: Set up Ruby
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
bundler-cache: true
|
19
|
+
|
20
|
+
- name: Publish to RubyGems
|
21
|
+
uses: dawidd6/action-publish-gem@v1
|
22
|
+
with:
|
23
|
+
api_key: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
24
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
|
6
|
+
push:
|
7
|
+
branches: [ develop, master ]
|
8
|
+
|
9
|
+
env:
|
10
|
+
GIT_COMMIT_SHA: ${{ github.sha }}
|
11
|
+
GIT_BRANCH: ${{ github.ref }}
|
12
|
+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
|
16
|
+
lint:
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
name: lint ${{ matrix.ruby }}
|
19
|
+
strategy:
|
20
|
+
fail-fast: false
|
21
|
+
matrix:
|
22
|
+
ruby: [ '2.6.9', '2.7.5', '3.0.3', '3.1.1' ]
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
- uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby }}
|
29
|
+
bundler-cache: true
|
30
|
+
|
31
|
+
- name: StandardRB
|
32
|
+
continue-on-error: ${{ matrix.experimental }}
|
33
|
+
run: bundle exec standardrb --parallel --format progress
|
34
|
+
|
35
|
+
test:
|
36
|
+
needs: [ lint ]
|
37
|
+
runs-on: ubuntu-latest
|
38
|
+
name: test ${{ matrix.ruby }}
|
39
|
+
strategy:
|
40
|
+
fail-fast: false
|
41
|
+
matrix:
|
42
|
+
ruby: [ '2.6.9', '2.7.5', '3.0.3', '3.1.1' ]
|
43
|
+
|
44
|
+
steps:
|
45
|
+
- uses: actions/checkout@v2
|
46
|
+
- uses: ruby/setup-ruby@v1
|
47
|
+
with:
|
48
|
+
ruby-version: ${{ matrix.ruby }}
|
49
|
+
bundler-cache: true
|
50
|
+
|
51
|
+
- name: Test
|
52
|
+
continue-on-error: ${{ matrix.experimental }}
|
53
|
+
run: bundle exec rake
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.1.1
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Tate ✍️
|
2
2
|
|
3
|
-
[](https://github.com/krmbzds/tate/actions/workflows/test.yml)
|
4
|
+
[](https://coveralls.io/github/krmbzds/tate)
|
5
5
|
[](https://codeclimate.com/github/krmbzds/tate/maintainability)
|
6
|
-
[](https://rubygems.org/gems/tate)
|
7
7
|
[](https://rubygems.org/gems/tate)
|
8
8
|
|
9
9
|
**Tate** converts accented characters and transliterates non-latin scripts to their closest ASCII equivalent.
|
@@ -123,9 +123,24 @@ Russian, Irish, Arabic, and Yoruba.
|
|
123
123
|
|
124
124
|
Yes.
|
125
125
|
|
126
|
+
## Support
|
127
|
+
|
128
|
+
This gem is tested against the following Ruby versions:
|
129
|
+
|
130
|
+
- ✅ `3.1.1` (stable)
|
131
|
+
- ✅ `3.0.3` (stable)
|
132
|
+
- ✅ `2.7.5` (stable)
|
133
|
+
- ⏳ `2.6.9` (security maintenance)
|
134
|
+
|
135
|
+
## Development
|
136
|
+
|
137
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
138
|
+
|
139
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org][RubyGems].
|
140
|
+
|
126
141
|
## Contributing
|
127
142
|
|
128
|
-
1. Fork
|
143
|
+
1. [Fork the repository][Fork]
|
129
144
|
2. Create your feature branch (`git checkout -b add-irish-support`)
|
130
145
|
3. Commit your changes (`git commit -am 'Add Irish language support'`)
|
131
146
|
4. Push to the branch (`git push origin add-irish-support`)
|
@@ -147,10 +162,12 @@ Nobody has time to type transliterate in the terminal.
|
|
147
162
|
|
148
163
|
## License
|
149
164
|
|
150
|
-
Copyright ©
|
165
|
+
Copyright © 2016-2022 [Kerem Bozdas][Personal Webpage]
|
151
166
|
|
152
167
|
This project is available under the terms of the [MIT License][License].
|
153
168
|
|
154
169
|
[Donation]: https://liberapay.com/krmbzds/donate
|
155
|
-
[
|
170
|
+
[Fork]: https://github.com/krmbzds/tate/fork
|
156
171
|
[License]: http://kerem.mit-license.org
|
172
|
+
[Personal Webpage]: http://kerembozdas.com
|
173
|
+
[RubyGems]: https://rubygems.org
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/bin/tate
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
|
-
lib = File.expand_path(File.dirname(__FILE__) +
|
4
|
+
lib = File.expand_path(File.dirname(__FILE__) + "/../lib")
|
5
5
|
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
7
|
+
require "tate"
|
8
|
+
require "optionparser"
|
9
9
|
|
10
10
|
options = {}
|
11
11
|
|
12
12
|
option_parser = OptionParser.new do |opts|
|
13
|
-
opts.banner =
|
14
|
-
opts.on("-l
|
13
|
+
opts.banner = "Usage: tate [-l LANGUAGE]"
|
14
|
+
opts.on("-l LANGUAGE", "--language LANGUAGE", String, "Set language for custom filters") do |language|
|
15
15
|
options[:language] = language
|
16
16
|
end
|
17
|
-
opts.on(
|
18
|
-
options[:help] =
|
17
|
+
opts.on("-h", "--help", "Show this message") do
|
18
|
+
options[:help] = opts.help
|
19
19
|
end
|
20
|
-
opts.on(
|
20
|
+
opts.on("-v", "--version", "Show version") do
|
21
21
|
options[:version] = Tate::VERSION
|
22
22
|
end
|
23
23
|
end
|
@@ -25,11 +25,11 @@ end
|
|
25
25
|
option_parser.parse!
|
26
26
|
|
27
27
|
if options[:language]
|
28
|
-
STDOUT.puts(Tate
|
28
|
+
STDOUT.puts(Tate.transliterate(STDIN.read, options[:language]))
|
29
29
|
elsif options[:version]
|
30
30
|
STDOUT.puts(options[:version])
|
31
31
|
elsif options.empty?
|
32
|
-
STDOUT.puts(Tate
|
32
|
+
STDOUT.puts(Tate.transliterate(STDIN.read))
|
33
33
|
else
|
34
|
-
STDOUT.puts(
|
34
|
+
STDOUT.puts(options[:help])
|
35
35
|
end
|
data/lib/tate/version.rb
CHANGED
data/lib/tate.rb
CHANGED
@@ -1,17 +1,18 @@
|
|
1
|
-
|
2
|
-
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
3
|
+
lib = File.expand_path(File.dirname(__FILE__) + "/../lib")
|
4
|
+
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
5
5
|
|
6
|
-
require
|
7
|
-
require
|
6
|
+
require "tate/version"
|
7
|
+
require "i18n"
|
8
|
+
require "yaml"
|
8
9
|
|
9
|
-
I18n.load_path << Dir[File.expand_path("lib/config/locales/*.yml")]
|
10
|
+
I18n.load_path << Dir[File.expand_path("#{lib}/config/locales/*.yml")]
|
10
11
|
I18n.enforce_available_locales = false
|
11
12
|
I18n.default_locale = :en
|
12
13
|
|
13
14
|
module Tate
|
14
|
-
def self.transliterate(string, language = nil,
|
15
|
+
def self.transliterate(string, language = nil, _replacement = "?")
|
15
16
|
I18n.transliterate(string, locale: language)
|
16
17
|
end
|
17
18
|
end
|
data/tate.gemspec
CHANGED
@@ -1,28 +1,29 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
5
|
+
require "tate/version"
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.licenses
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
8
|
+
spec.name = "tate"
|
9
|
+
spec.version = Tate::VERSION
|
10
|
+
spec.licenses = "MIT"
|
11
|
+
spec.authors = ["Kerem Bozdas"]
|
12
|
+
spec.email = ["krmbzds.github@gmail.com"]
|
12
13
|
|
13
|
-
spec.summary
|
14
|
-
spec.description
|
15
|
-
spec.homepage
|
14
|
+
spec.summary = "Convert accented characters and transliterate non-latin alphabets to ASCII."
|
15
|
+
spec.description = "Convert accented characters and transliterate non-latin alphabets to ASCII."
|
16
|
+
spec.homepage = "https://github.com/krmbzds/tate"
|
16
17
|
|
17
|
-
spec.files
|
18
|
-
spec.
|
19
|
-
spec.
|
20
|
-
spec.
|
21
|
-
spec.require_paths = ['lib']
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
spec.bindir = "bin"
|
20
|
+
spec.executables = ["tate"]
|
21
|
+
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_runtime_dependency
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
23
|
+
spec.add_runtime_dependency "i18n", "~> 1.10"
|
24
|
+
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_development_dependency "rake"
|
26
|
+
spec.add_development_dependency "rspec"
|
27
|
+
spec.add_development_dependency "standard"
|
28
|
+
spec.add_development_dependency "coveralls_reborn"
|
28
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kerem Bozdas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -16,76 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.10'
|
20
20
|
type: :runtime
|
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: '1.
|
26
|
+
version: '1.10'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2.0'
|
34
31
|
- - ">="
|
35
32
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
33
|
+
version: '0'
|
37
34
|
type: :development
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
|
-
- - "~>"
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '2.0'
|
44
38
|
- - ">="
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
40
|
+
version: '0'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: rake
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
|
-
- - "
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
47
|
+
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
|
-
- - "
|
52
|
+
- - ">="
|
59
53
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
54
|
+
version: '0'
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: rspec
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
64
58
|
requirements:
|
65
|
-
- - "
|
59
|
+
- - ">="
|
66
60
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
61
|
+
version: '0'
|
68
62
|
type: :development
|
69
63
|
prerelease: false
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
|
-
- - "
|
66
|
+
- - ">="
|
73
67
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
68
|
+
version: '0'
|
75
69
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
70
|
+
name: standard
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
78
72
|
requirements:
|
79
|
-
- - "
|
73
|
+
- - ">="
|
80
74
|
- !ruby/object:Gem::Version
|
81
|
-
version: 0
|
75
|
+
version: '0'
|
82
76
|
type: :development
|
83
77
|
prerelease: false
|
84
78
|
version_requirements: !ruby/object:Gem::Requirement
|
85
79
|
requirements:
|
86
|
-
- - "
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls_reborn
|
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
|
+
- - ">="
|
87
95
|
- !ruby/object:Gem::Version
|
88
|
-
version: 0
|
96
|
+
version: '0'
|
89
97
|
description: Convert accented characters and transliterate non-latin alphabets to
|
90
98
|
ASCII.
|
91
99
|
email:
|
@@ -95,11 +103,11 @@ executables:
|
|
95
103
|
extensions: []
|
96
104
|
extra_rdoc_files: []
|
97
105
|
files:
|
106
|
+
- ".github/workflows/publish.yml"
|
107
|
+
- ".github/workflows/test.yml"
|
98
108
|
- ".gitignore"
|
99
109
|
- ".rspec"
|
100
|
-
- ".
|
101
|
-
- ".ruby-version"
|
102
|
-
- ".travis.yml"
|
110
|
+
- ".tool-versions"
|
103
111
|
- Gemfile
|
104
112
|
- LICENSE.txt
|
105
113
|
- README.md
|
@@ -141,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
149
|
- !ruby/object:Gem::Version
|
142
150
|
version: '0'
|
143
151
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.3.7
|
145
153
|
signing_key:
|
146
154
|
specification_version: 4
|
147
155
|
summary: Convert accented characters and transliterate non-latin alphabets to ASCII.
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
tate
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby-2.6.5
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
---
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.6.5
|
5
|
-
- 2.5.7
|
6
|
-
- 2.4.9
|
7
|
-
before_install:
|
8
|
-
- 'gem update --system'
|
9
|
-
- 'gem --version'
|
10
|
-
- 'gem install bundler'
|
11
|
-
before_script:
|
12
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
13
|
-
- chmod +x ./cc-test-reporter
|
14
|
-
- "./cc-test-reporter before-build"
|
15
|
-
script:
|
16
|
-
- bundle exec rspec
|
17
|
-
after_script:
|
18
|
-
- "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"
|
19
|
-
env:
|
20
|
-
global:
|
21
|
-
- CC_TEST_REPORTER_ID=8ec95d64844683a9ce73f086a637d7bb2c7ae00a0042c4efa75ee34637a0fd58
|