cyrillic 0.1.0 → 0.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
  SHA256:
3
- metadata.gz: 523c570ae92be1cce157d909eb943209ead788cffb94154828e84a85f78e567a
4
- data.tar.gz: bd52da2ee180388e23c3371f0e62635256178cedea3ccb4b80047958999a3048
3
+ metadata.gz: 6a5904094fb9d492197e816b4dd0270aa4245e64fe3388b5a8177bef6deb01fd
4
+ data.tar.gz: 2fd71ce5f7e37778beae85554c5bcfc6277b348278d931219efddbbae6175020
5
5
  SHA512:
6
- metadata.gz: 1306ea7d4eb464456a8d7ba8d656c269888bcab0fba59081553256f7a28857074189200bbd2ec9070d7eafa78cfadf7083d922951d8ea5d143687185918fee4d
7
- data.tar.gz: c198f9fbc241071784543a7f558223ff48876db9f5c2aa72aaa644573db4122f46d4d646122e780070975cae4ae3650d0bc7c16315b2e2a3ba6f21c75f1b452d
6
+ metadata.gz: ea05ab8fbb717eec3902faca17b7c2783fb8e5e2dd5feab4ef003f0d979d1e91dadc001cde2fdc06d86eb8beaaf503621b61df8b23137e47b798c61cf384eba0
7
+ data.tar.gz: dfd8f00970bb557ed16b6d7db598365f6110ebc8815f9ab088ef164a392bc075d94c285859eb80a021d71645c27c76495454dd1f0f9f2688205f3ebc17731852
data/.rubocop.yml ADDED
@@ -0,0 +1,50 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ SuggestExtensions: false
4
+ Exclude:
5
+ - 'bin/**/*'
6
+ - 'pkg/**/*'
7
+ - 'vendor/**/*'
8
+ - 'coverage/**/*'
9
+
10
+ Layout/LineLength:
11
+ AllowedPatterns:
12
+ - '^\s*assert_equal'
13
+ - '^\s*#'
14
+ - '^\s*"'
15
+ - 'spec\.description'
16
+ - 'k = %w\['
17
+ - 'v = %w\['
18
+
19
+ Style/StringLiterals:
20
+ Enabled: false
21
+
22
+ Style/Documentation:
23
+ Enabled: false
24
+
25
+ Style/AsciiComments:
26
+ Enabled: false
27
+
28
+ Gemspec/DevelopmentDependencies:
29
+ Enabled: false
30
+
31
+ Metrics/AbcSize:
32
+ Enabled: false
33
+
34
+ Metrics/MethodLength:
35
+ Enabled: false
36
+
37
+ Metrics/CyclomaticComplexity:
38
+ Enabled: false
39
+
40
+ Metrics/PerceivedComplexity:
41
+ Enabled: false
42
+
43
+ Metrics/BlockLength:
44
+ Enabled: false
45
+
46
+ Metrics/ModuleLength:
47
+ Enabled: false
48
+
49
+ Metrics/CollectionLiteralLength:
50
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,56 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.3.0] - 2026-09-17
11
+
12
+ ### Added
13
+ - CLI executable `exe/cyrillic` supporting direct arguments, files, piped STDIN, and scheme flag (`-s`).
14
+ - Integration tests for CLI arguments, flags, files, and STDIN input.
15
+ - GitHub Actions CI workflow for modern Ruby versions (`3.3`, `3.4`, `head`) on `main` branch.
16
+ - Automated GitHub Actions release workflow for building and publishing gem on git tag push.
17
+ - Dependabot configuration for automated Bundler and GitHub Actions dependency updates.
18
+ - Precompiled and cached regular expressions for character tables for improved performance.
19
+ - Case-insensitive scheme resolution (e.g. `:iso9`, `"ISO9"`, `:de`, `"UA_PASSPORT"`).
20
+ - Informative `ArgumentError` when an unknown transliteration scheme is specified.
21
+ - Standard gem metadata URIs (`source_code_uri`, `changelog_uri`, `bug_tracker_uri`, `rubygems_mfa_required`).
22
+ - Comprehensive YARD documentation with examples for `Cyrillic.transliterate` and `Cyrillic.t`.
23
+ - SimpleCov test coverage tracking achieving 100% line coverage.
24
+ - Unit tests for edge cases (nil, empty strings, scheme normalization, error handling).
25
+
26
+ ### Changed
27
+ - Namespaced scheme modules under `Cyrillic` (`Cyrillic::Iso9`, `Cyrillic::Mongolian`, `Cyrillic::Ukrainian`, `Cyrillic::UaPassport`, `Cyrillic::De`) with backwards-compatible top-level aliases.
28
+ - Set minimum required Ruby version to `>= 3.3.0` in gemspec.
29
+ - Update development dependencies (rubocop, rake, rdoc, irb, minitest, simplecov).
30
+ - Untrack `Gemfile.lock` and add to `.gitignore` following gem development best practices.
31
+ - Add `.gitattributes` for consistent LF line endings and diff drivers.
32
+ - Integrate RuboCop code style checks into default `rake` task.
33
+ - Update copyright year to 2018-2026 in `LICENSE.txt`.
34
+
35
+ ### Fixed
36
+ - Eliminate mutable string literal warnings under Ruby 3.4+ in Ukrainian Passport transliteration.
37
+ - Fix character mappings and duplicate key warnings in ISO 9 table (`ӵ` and `ҿ`).
38
+
39
+ ### Removed
40
+ - Legacy `.travis.yml` configuration.
41
+ - Empty 0-byte placeholder files from `lib/cyrillic/`.
42
+
43
+ ## [0.2.0] - 2025-11-09
44
+
45
+ ### Added
46
+ - ISO 9 transliteration support (`:iso9`).
47
+ - Mongolian transliteration support (`:mongolian`).
48
+ - Ukrainian transliteration support (`:ukrainian`).
49
+ - Ukrainian passport transliteration standard support (`:ua_passport`).
50
+ - German transliteration standard support (`:de`).
51
+
52
+ ## [0.1.0] - 2018-04-05
53
+
54
+ ### Added
55
+ - Initial release.
56
+ - Core Cyrillic transliteration to Roman (Latin) script.
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 rovetz
3
+ Copyright (c) 2018-2026 rovetz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,13 +1,26 @@
1
1
  # Cyrillic
2
2
 
3
- Romanization of Cyrillic. It transliterates Cyrillic text to the Roman (Latin) script.
3
+ [![Ruby](https://github.com/rovetz/cyrillic/actions/workflows/ruby.yml/badge.svg)](https://github.com/rovetz/cyrillic/actions/workflows/ruby.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/cyrillic.svg)](https://badge.fury.io/rb/cyrillic)
5
+ [![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ **Cyrillic** is a Ruby gem for romanization (transliteration) of Cyrillic script into the Roman (Latin) alphabet. It provides a simple and flexible interface with support for international and national standards.
8
+
9
+ ## Supported Schemes
10
+
11
+ * `:cyrillic` (Default generic Cyrillic transliteration)
12
+ * `:iso9` (ISO 9:1995 standard)
13
+ * `:ukrainian` (Ukrainian national standard)
14
+ * `:ua_passport` (Ukrainian international passport transliteration standard)
15
+ * `:mongolian` (Mongolian Cyrillic MNS 5217:2012)
16
+ * `:de` (German Duden/phonetic transliteration)
4
17
 
5
18
  ## Installation
6
19
 
7
20
  Add this line to your application's Gemfile:
8
21
 
9
22
  ```ruby
10
- gem 'cyrillic'
23
+ gem "cyrillic"
11
24
  ```
12
25
 
13
26
  And then execute:
@@ -22,23 +35,69 @@ Or install it yourself as:
22
35
 
23
36
  ```ruby
24
37
  require "cyrillic"
25
- ```
26
-
27
- Then
28
38
 
29
- ```ruby
39
+ # Default Cyrillic transliteration
30
40
  Cyrillic.transliterate("Кириллица")
31
- ```
32
- or
41
+ # => "KirilliTSa"
33
42
 
34
- ```ruby
43
+ # Short alias .t
35
44
  Cyrillic.t("Кириллица")
45
+ # => "KirilliTSa"
46
+
47
+ # ISO 9:1995 scheme
48
+ Cyrillic.t("Не важно, как медленно ты продвигаешься", :iso9)
49
+ # => "Ne važno, kak medlenno ty prodvigaešʹsâ"
50
+
51
+ # Ukrainian scheme
52
+ Cyrillic.t("Київ", :ukrainian)
53
+ # => "Kyiv"
54
+
55
+ # Ukrainian passport scheme
56
+ Cyrillic.t("Борщагівка", :ua_passport)
57
+ # => "Borshchahivka"
58
+
59
+ # Mongolian scheme
60
+ Cyrillic.t("Монгол хэл", :mongolian)
61
+ # => "Mongol khel"
62
+
63
+ # German transliteration scheme
64
+ Cyrillic.t("Чайковский", :de)
65
+ # => "Tschajkowskij"
36
66
  ```
37
67
 
68
+ ### Command Line Interface (CLI)
69
+
70
+ You can also use `cyrillic` directly from your terminal:
71
+
72
+ ```bash
73
+ # Direct argument
74
+ $ cyrillic "Кириллица"
75
+ KirilliTSa
76
+
77
+ # Piped input (STDIN)
78
+ $ echo "Кириллица" | cyrillic
79
+ KirilliTSa
80
+
81
+ # File input
82
+ $ cyrillic text.txt
83
+
84
+ # Specify transliteration scheme
85
+ $ cyrillic -s iso9 "Транслитерация"
86
+ Transliteraciâ
87
+
88
+ $ cyrillic -s ukrainian "Київ"
89
+ Kyiv
90
+
91
+ $ cyrillic -s ua_passport "Борщагівка"
92
+ Borshchahivka
93
+
94
+ $ cyrillic -s de "Весна"
95
+ Wesna
96
+ ```
38
97
 
39
98
  ## Development
40
99
 
41
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
100
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake` to run tests and code style checks (RuboCop). You can also run `bin/console` for an interactive prompt that will allow you to experiment.
42
101
 
43
102
  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](https://rubygems.org).
44
103
 
@@ -52,4 +111,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
52
111
 
53
112
  ## Code of Conduct
54
113
 
55
- Everyone interacting in the Cyrillic project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rovetz/cyrillic/blob/master/CODE_OF_CONDUCT.md).
114
+ Everyone interacting in the Cyrillic project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rovetz/cyrillic/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,5 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rake/testtask"
5
+ require "rubocop/rake_task"
3
6
 
4
7
  Rake::TestTask.new(:test) do |t|
5
8
  t.libs << "test"
@@ -7,4 +10,6 @@ Rake::TestTask.new(:test) do |t|
7
10
  t.test_files = FileList["test/**/*_test.rb"]
8
11
  end
9
12
 
10
- task :default => :test
13
+ RuboCop::RakeTask.new(:rubocop)
14
+
15
+ task default: %i[test rubocop]
data/cyrillic.gemspec CHANGED
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
1
2
 
2
- lib = File.expand_path("../lib", __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
4
6
  require "cyrillic/version"
5
7
 
6
8
  Gem::Specification.new do |spec|
@@ -10,18 +12,30 @@ Gem::Specification.new do |spec|
10
12
  spec.email = ["zakbox@gmail.com"]
11
13
 
12
14
  spec.summary = "Romanization (transliteration) of Cyrillic"
13
- spec.description = "Romanization (transliteration) of Cyrillic. Converts Cyrillic text to the Roman (Latin) script"
15
+ spec.description = "Converts Cyrillic text to the Roman (Latin) script"
14
16
  spec.homepage = "https://github.com/rovetz/cyrillic"
15
17
  spec.license = "MIT"
18
+ spec.required_ruby_version = ">= 3.3.0"
19
+
20
+ spec.metadata["source_code_uri"] = "https://github.com/rovetz/cyrillic"
21
+ spec.metadata["changelog_uri"] = "https://github.com/rovetz/cyrillic/blob/main/CHANGELOG.md"
22
+ spec.metadata["bug_tracker_uri"] = "https://github.com/rovetz/cyrillic/issues"
23
+ spec.metadata["rubygems_mfa_required"] = "true"
16
24
 
17
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
- f.match(%r{^(test|spec|features)/})
25
+ spec.files = Dir.chdir(__dir__) do
26
+ `git ls-files -z`.split("\x0").select { |f| File.file?(f) }.reject do |f|
27
+ (File.expand_path(f) == __FILE__) ||
28
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .github Gemfile])
29
+ end
19
30
  end
20
31
  spec.bindir = "exe"
21
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.executables = ["cyrillic"]
22
33
  spec.require_paths = ["lib"]
23
34
 
24
- spec.add_development_dependency "bundler", "~> 1.16"
25
- spec.add_development_dependency "rake", "~> 10.0"
26
- spec.add_development_dependency "minitest", "~> 5.0"
35
+ spec.add_development_dependency "irb"
36
+ spec.add_development_dependency "minitest", ">= 5.25"
37
+ spec.add_development_dependency "rake", ">= 13.2"
38
+ spec.add_development_dependency "rdoc"
39
+ spec.add_development_dependency "rubocop", ">= 1.64"
40
+ spec.add_development_dependency "simplecov", ">= 0.22"
27
41
  end
data/exe/cyrillic ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "optparse"
5
+ require "cyrillic"
6
+
7
+ scheme = nil
8
+
9
+ parser = OptionParser.new do |opts|
10
+ opts.banner = "Usage: cyrillic [options] [text | file...]"
11
+ opts.separator ""
12
+ opts.separator "Transliterate Cyrillic script to Roman (Latin) script."
13
+ opts.separator ""
14
+ opts.separator "Examples:"
15
+ opts.separator " cyrillic 'Кириллица'"
16
+ opts.separator " echo 'Кириллица' | cyrillic"
17
+ opts.separator " cyrillic text.txt"
18
+ opts.separator " cyrillic -s iso9 'Транслитерация'"
19
+ opts.separator " cyrillic -s ukrainian 'Київ'"
20
+ opts.separator " cyrillic -s ua_passport 'Борщагівка'"
21
+ opts.separator " cyrillic -s mongolian 'Монгол'"
22
+ opts.separator " cyrillic -s de 'Весна'"
23
+ opts.separator ""
24
+ opts.separator "Options:"
25
+
26
+ opts.on("-s", "--scheme SCHEME", %w[default cyrillic iso9 mongolian ukrainian ua_passport de],
27
+ "Transliteration scheme (default, cyrillic, iso9, mongolian, ukrainian, ua_passport, de)") do |s|
28
+ scheme = s == "default" ? nil : s.to_sym
29
+ end
30
+
31
+ opts.on("-v", "--version", "Show version") do
32
+ puts "cyrillic #{Cyrillic::VERSION}"
33
+ exit
34
+ end
35
+
36
+ opts.on("-h", "--help", "Show this help message") do
37
+ puts opts
38
+ exit
39
+ end
40
+ end
41
+
42
+ parser.parse!
43
+
44
+ transliterate = lambda do |text|
45
+ Cyrillic.transliterate(text, scheme || :cyrillic)
46
+ end
47
+
48
+ if ARGV.empty?
49
+ if $stdin.tty?
50
+ puts parser
51
+ exit 1
52
+ else
53
+ $stdin.each_line do |line|
54
+ puts transliterate.call(line.chomp)
55
+ end
56
+ end
57
+ else
58
+ ARGV.each do |arg|
59
+ if File.file?(arg)
60
+ File.foreach(arg) do |line|
61
+ puts transliterate.call(line.chomp)
62
+ end
63
+ else
64
+ puts transliterate.call(arg)
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cyrillic
4
+ module De
5
+ k = %w[А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я].freeze
6
+ v = %w[A B W G D E Jo Sch S I J K L M N O P R S T U F Ch Z Tsch Sch Schtsch "" Y "" E Ju Ja a b w g d e jo sch s i j k l m n o p r s t u f ch z tsch sch schtsch "" y "" e ju ja].freeze
7
+
8
+ CHARACTER_TABLE = k.zip(v).to_h.freeze
9
+ REGEXP = Regexp.union(CHARACTER_TABLE.keys).freeze
10
+ end
11
+ end
12
+
13
+ De = Cyrillic::De unless defined?(De)
@@ -0,0 +1,265 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cyrillic
4
+ module Iso9
5
+ CHARACTER_TABLE = {
6
+ "А" => "A",
7
+ "Ӓ" => "Ä",
8
+ "Ӓ̄" => "Ạ̈",
9
+ "Ӑ" => "Ă",
10
+ "А̄" => "Ā",
11
+ "Ӕ" => "Æ",
12
+ "А́" => "Á",
13
+ "А̊" => "Å",
14
+ "Б" => "B",
15
+ "В" => "V",
16
+ "Г" => "G",
17
+ "Ѓ" => "Ǵ",
18
+ "Ғ" => "Ġ",
19
+ "Ҕ" => "Ğ",
20
+ "Һ" => "Ḥ",
21
+ "Д" => "D",
22
+ "Ђ" => "Đ",
23
+ "Е" => "E",
24
+ "Ӗ" => "Ĕ",
25
+ "Ё" => "Ë",
26
+ "Є" => "Ê",
27
+ "Ж" => "Ž",
28
+ "Җ" => "Ž̦",
29
+ "Ӝ" => "Z̄",
30
+ "Ӂ" => "Z̆",
31
+ "З" => "Z",
32
+ "Ӟ" => "Z̈",
33
+ "Ӡ" => "Ź",
34
+ "Ѕ" => "Ẑ",
35
+ "И" => "I",
36
+ "Ӣ" => "Ī",
37
+ "И́" => "Í",
38
+ "Ӥ" => "Î",
39
+ "Й" => "J",
40
+ "І" => "Ì",
41
+ "Ї" => "Ï",
42
+ "І̄" => "Ǐ",
43
+ "Ј" => "J̌",
44
+ "Ј̵" => "J́",
45
+ "К" => "K",
46
+ "Ќ" => "Ḱ",
47
+ "Ӄ" => "Ḳ",
48
+ "Ҝ" => "K̂",
49
+ "Ҡ" => "Ǩ",
50
+ "Ҟ" => "K̄",
51
+ "Қ" => "K̦",
52
+ "К̨" => "K̀",
53
+ "Ԛ" => "Q",
54
+ "Л" => "L",
55
+ "Љ" => "L̂",
56
+ "Ԡ" => "L̦",
57
+ "М" => "M",
58
+ "Н" => "N",
59
+ "Њ" => "N̂",
60
+ "Ң" => "N̦",
61
+ "Ӊ" => "Ṇ",
62
+ "Ҥ" => "Ṅ",
63
+ "Ԋ" => "Ǹ",
64
+ "Ԣ" => "Ń",
65
+ "Ӈ" => "Ň",
66
+ "Н̄" => "N̄",
67
+ "О" => "O",
68
+ "Ӧ" => "Ö",
69
+ "Ө" => "Ô",
70
+ "Ӫ" => "Ő",
71
+ "Ӧ̄" => "Ọ̈",
72
+ "Ҩ" => "Ò",
73
+ "О́" => "Ó",
74
+ "О̄" => "Ō",
75
+ "Œ" => "Œ",
76
+ "П" => "P",
77
+ "Ҧ" => "Ṕ",
78
+ "Ԥ" => "P̀",
79
+ "Р" => "R",
80
+ "С" => "S",
81
+ "Ҫ" => "Ș",
82
+ "С̀" => "S̀",
83
+ "Т" => "T",
84
+ "Ћ" => "Ć",
85
+ "Ԏ" => "T̀",
86
+ "Т̌" => "Ť",
87
+ "Ҭ" => "Ț",
88
+ "У" => "U",
89
+ "Ӱ" => "Ü",
90
+ "Ӯ" => "Ū",
91
+ "Ў" => "Ŭ",
92
+ "Ӳ" => "Ű",
93
+ "У́" => "Ú",
94
+ "Ү" => "Ù",
95
+ "Ұ" => "U̇",
96
+ "Ӱ̄" => "Ụ̄",
97
+ "Ԝ" => "W",
98
+ "Ф" => "F",
99
+ "Х" => "H",
100
+ "Ҳ" => "H̦",
101
+ "Ц" => "C",
102
+ "Ҵ" => "C̄",
103
+ "Џ" => "D̂",
104
+ "Ч" => "Č",
105
+ "Ҷ" => "C̦",
106
+ "Ӌ" => "C̣",
107
+ "Ӵ" => "C̈",
108
+ "Ҹ" => "Ĉ",
109
+ "Ч̀" => "C̀",
110
+ "Ҽ" => "C̆",
111
+ "Ҿ" => "C̨̆",
112
+ "Ш" => "Š",
113
+ "Щ" => "Ŝ",
114
+ "Ъ" => "ʺ",
115
+ "Ы" => "Y",
116
+ "Ӹ" => "Ÿ",
117
+ "Ы̄" => "Ȳ",
118
+ "Ь" => "ʹ",
119
+ "Э" => "È",
120
+ "Ә" => "A̋",
121
+ "Ӛ" => "À",
122
+ "Ю" => "Û",
123
+ "Ю̄" => "Û̄",
124
+ "Я" => "Â",
125
+ "Ґ" => "G̀",
126
+ "Ѣ" => "Ě",
127
+ "Ѫ" => "Ǎ",
128
+ "Ѳ" => "F̀",
129
+ "Ѵ" => "Ỳ",
130
+ "Ӏ" => "‡",
131
+ "ʼ" => "`",
132
+ "ˮ" => "¨",
133
+
134
+ "а" => "a",
135
+ "ӓ" => "ä",
136
+ "ӓ̄" => "ạ̈",
137
+ "ӑ" => "ă",
138
+ "а̄" => "ā",
139
+ "ӕ" => "æ",
140
+ "а́" => "á",
141
+ "а̊" => "å",
142
+ "б" => "b",
143
+ "в" => "v",
144
+ "г" => "g",
145
+ "ѓ" => "ǵ",
146
+ "ғ" => "ġ",
147
+ "ҕ" => "ğ",
148
+ "һ" => "ḥ",
149
+ "д" => "d",
150
+ "ђ" => "đ",
151
+ "е" => "e",
152
+ "ӗ" => "ĕ",
153
+ "ё" => "ë",
154
+ "є" => "ê",
155
+ "ж" => "ž",
156
+ "җ" => "ž̦",
157
+ "ӝ" => "z̄",
158
+ "ӂ" => "z̆",
159
+ "з" => "z",
160
+ "ӟ" => "z̈",
161
+ "ӡ" => "ź",
162
+ "ѕ" => "ẑ",
163
+ "и" => "i",
164
+ "ӣ" => "ī",
165
+ "и́" => "í",
166
+ "ӥ" => "î",
167
+ "й" => "j",
168
+ "і" => "ì",
169
+ "ї" => "ï",
170
+ "і̄" => "ǐ",
171
+ "ј" => "ǰ",
172
+ "ј̵" => "j́",
173
+ "к" => "k",
174
+ "ќ" => "ḱ",
175
+ "ӄ" => "ḳ",
176
+ "ҝ" => "k̂",
177
+ "ҡ" => "ǩ",
178
+ "ҟ" => "k̄",
179
+ "қ" => "k̦",
180
+ "к̨" => "k̀",
181
+ "ԛ" => "q",
182
+ "л" => "l",
183
+ "љ" => "l̂",
184
+ "ԡ" => "l̦",
185
+ "м" => "m",
186
+ "н" => "n",
187
+ "њ" => "n̂",
188
+ "ң" => "n̦",
189
+ "ӊ" => "ṇ",
190
+ "ҥ" => "ṅ",
191
+ "ԋ" => "ǹ",
192
+ "ԣ" => "ń",
193
+ "ӈ" => "ň",
194
+ "н̄" => "n̄",
195
+ "о" => "o",
196
+ "ӧ" => "ö",
197
+ "ө" => "ô",
198
+ "ӫ" => "ő",
199
+ "ӧ̄" => "ọ̈",
200
+ "ҩ" => "ò",
201
+ "о́" => "ó",
202
+ "о̄" => "ō",
203
+ "œ" => "œ",
204
+ "п" => "p",
205
+ "ҧ" => "ṕ",
206
+ "ԥ" => "p̀",
207
+ "р" => "r",
208
+ "с" => "s",
209
+ "ҫ" => "ș",
210
+ "с̀" => "s̀",
211
+ "т" => "t",
212
+ "ћ" => "ć",
213
+ "ԏ" => "t̀",
214
+ "т̌" => "ť",
215
+ "ҭ" => "ț",
216
+ "у" => "u",
217
+ "ӱ" => "ü",
218
+ "ӯ" => "ū",
219
+ "ў" => "ŭ",
220
+ "ӳ" => "ű",
221
+ "у́" => "ú",
222
+ "ү" => "ù",
223
+ "ұ" => "u̇",
224
+ "ӱ̄" => "ụ̄",
225
+ "ԝ" => "w",
226
+ "ф" => "f",
227
+ "х" => "h",
228
+ "ҳ" => "h̦",
229
+ "ц" => "c",
230
+ "ҵ" => "c̄",
231
+ "џ" => "d̂",
232
+ "ч" => "č",
233
+ "ҷ" => "c̦",
234
+ "ӌ" => "c̣",
235
+ "ӵ" => "c̈",
236
+ "ҹ" => "ĉ",
237
+ "ч̀" => "c̀",
238
+ "ҽ" => "c̆",
239
+ "ҿ" => "c̨̆",
240
+ "ш" => "š",
241
+ "щ" => "ŝ",
242
+ "ъ" => "ʺ",
243
+ "ы" => "y",
244
+ "ӹ" => "ÿ",
245
+ "ы̄" => "ȳ",
246
+ "ь" => "ʹ",
247
+ "э" => "è",
248
+ "ә" => "a̋",
249
+ "ӛ" => "à",
250
+ "ю" => "û",
251
+ "ю̄" => "û̄",
252
+ "я" => "â",
253
+ "ґ" => "g̀",
254
+ "ѣ" => "ě",
255
+ "ѫ" => "ǎ",
256
+ "ѳ" => "f̀",
257
+ "ѵ" => "ỳ",
258
+ "ӏ" => "‡"
259
+ }.freeze
260
+
261
+ REGEXP = Regexp.union(CHARACTER_TABLE.keys).freeze
262
+ end
263
+ end
264
+
265
+ Iso9 = Cyrillic::Iso9 unless defined?(Iso9)
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cyrillic
4
+ module Mongolian
5
+ k = %w[А Б В Г Д Е Ё Ж З И Й К Л М Н О Ө П Р С Т У Ү Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я а б в г д е ё ж з и й к л м н о ө п р с т у ү ф х ц ч ш щ ъ ы ь э ю я].freeze
6
+ v = %w[A B V G D Ye Yo J Z I I K L M N O O P R S T U U F Kh Ts Ch Sh Sh I Y I E Yu Ya a b v g d ye yo j z i i k l m n o o p r s t u u f kh ts ch sh sh i y i e yu ya].freeze
7
+
8
+ CHARACTER_TABLE = k.zip(v).to_h.freeze
9
+ REGEXP = Regexp.union(CHARACTER_TABLE.keys).freeze
10
+ end
11
+ end
12
+
13
+ Mongolian = Cyrillic::Mongolian unless defined?(Mongolian)
@@ -0,0 +1,188 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cyrillic
4
+ module UaPassport
5
+ k = %w[А Б В Г Ґ Д Е Ж З И І К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ а б в г ґ д е ж з и і к л м н о п р с т у ф х ц ч ш щ].freeze
6
+ v = %w[A B V H G D E Zh Z Y I K L M N O P R S T U F Kh Ts Ch Sh Shch a b v h g d e zh z y i k l m n o p r s t u f kh ts ch sh shch].freeze
7
+
8
+ CHARACTER_TABLE = k.zip(v).to_h.freeze
9
+
10
+ class << self
11
+ def transliterate(str = "")
12
+ return "" if str.nil? || str.empty?
13
+
14
+ str = str.to_s.gsub('Зг', 'Zgh').gsub('зг', 'zgh')
15
+
16
+ result = +""
17
+ str.each_char.with_index do |char, index|
18
+ prev_char = index.positive? ? str[index - 1] : nil
19
+ is_word_start = prev_char.nil? || prev_char == ' '
20
+
21
+ case char
22
+ when 'Є'
23
+ result << (is_word_start ? 'Ye' : 'Ie')
24
+ when 'є'
25
+ result << (is_word_start ? 'ye' : 'ie')
26
+ when 'Ї'
27
+ result << (is_word_start ? 'Yi' : 'I')
28
+ when 'ї'
29
+ result << (is_word_start ? 'yi' : 'i')
30
+ when 'Й'
31
+ result << (is_word_start ? 'Y' : 'I')
32
+ when 'й'
33
+ result << (is_word_start ? 'y' : 'i')
34
+ when 'Ю'
35
+ result << (is_word_start ? 'Yu' : 'Iu')
36
+ when 'ю'
37
+ result << (is_word_start ? 'yu' : 'iu')
38
+ when 'Я'
39
+ result << (is_word_start ? 'Ya' : 'Ia')
40
+ when 'я'
41
+ result << (is_word_start ? 'ya' : 'ia')
42
+ when 'Ь', 'ь', "'"
43
+ # Ignored in transliteration
44
+ else
45
+ result << (CHARACTER_TABLE[char] || char)
46
+ end
47
+ end
48
+ result
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ UaPassport = Cyrillic::UaPassport unless defined?(UaPassport)
55
+
56
+ # https://pasport.org.ua/faq/transliteration
57
+ # https://zakon.rada.gov.ua/laws/show/55-2010-%D0%BF/sp:dark?dark=0#Text
58
+
59
+ # ТАБЛИЦЯ
60
+ # транслітерації українського алфавіту латиницею
61
+
62
+ # ------------------------------------------------------------------
63
+ # | Український | Латиниця | Позиція у | Приклади написання |
64
+ # | алфавіт | | слові |--------------------------|
65
+ # | | | |українською | латиницею |
66
+ # | | | | мовою | |
67
+ # |-------------+----------+------------+------------+-------------|
68
+ # | Аа | Aa | |Алушта |Alushta |
69
+ # | | | |Андрій |Andrii |
70
+ # |-------------+----------+------------+------------+-------------|
71
+ # | Бб | Bb | |Борщагівка |Borshchahivka|
72
+ # | | | |Борисенко |Borysenko |
73
+ # |-------------+----------+------------+------------+-------------|
74
+ # | Вв | Vv | |Вінниця |Vinnytsia |
75
+ # | | | |Володимир |Volodymyr |
76
+ # |-------------+----------+------------+------------+-------------|
77
+ # | Гг | Hh | |Гадяч |Hadiach |
78
+ # | | | |Богдан |Bohdan |
79
+ # | | | |Згурський |Zghurskyi |
80
+ # |-------------+----------+------------+------------+-------------|
81
+ # | Ґґ | Gg | |Ґалаґан |Galagan |
82
+ # | | | |Ґорґани |Gorgany |
83
+ # |-------------+----------+------------+------------+-------------|
84
+ # | Дд | Dd | |Донецьк |Donetsk |
85
+ # | | | |Дмитро |Dmytro |
86
+ # |-------------+----------+------------+------------+-------------|
87
+ # | Ее | Ee | |Рівне |Rivne |
88
+ # | | | |Олег |Oleh |
89
+ # | | | |Есмань |Esman |
90
+ # |-------------+----------+------------+------------+-------------|
91
+ # | Єє | Ye | на початку |Єнакієве |Yenakiieve |
92
+ # | | | слова |Гаєвич |Haievych |
93
+ # | | ie | в інших |Короп'є |Koropie |
94
+ # | | | позиціях | | |
95
+ # |-------------+----------+------------+------------+-------------|
96
+ # | Жж | Zh zh | |Житомир |Zhytomyr |
97
+ # | | | |Жанна |Zhanna |
98
+ # | | | |Жежелів |Zhezheliv |
99
+ # |-------------+----------+------------+------------+-------------|
100
+ # | Зз | Zz | |Закарпаття |Zakarpattia |
101
+ # | | | |Казимирчук |Kazymyrchuk |
102
+ # |-------------+----------+------------+------------+-------------|
103
+ # | Ии | Yy | |Медвин |Medvyn |
104
+ # | | | |Михайленко |Mykhailenko |
105
+ # |-------------+----------+------------+------------+-------------|
106
+ # | Іі | Ii | |Іванків |Ivankiv |
107
+ # | | | |Іващенко |Ivashchenko |
108
+ # |-------------+----------+------------+------------+-------------|
109
+ # | Її | Yi | на початку |Їжакевич |Yizhakevych |
110
+ # | | | слова |Кадиївка |Kadyivka |
111
+ # | | i | в інших |Мар'їне |Marine |
112
+ # | | | позиціях | | |
113
+ # |-------------+----------+------------+------------+-------------|
114
+ # | Йй | Y | на початку |Йосипівка |Yosypivka |
115
+ # | | | слова |Стрий |Stryi |
116
+ # | | i | в других |Олексій |Oleksii |
117
+ # | | | позиціях | | |
118
+ # |-------------+----------+------------+------------+-------------|
119
+ # | Кк | Kk | |Київ |Kyiv |
120
+ # | | | |Коваленко |Kovalenko |
121
+ # |-------------+----------+------------+------------+-------------|
122
+ # | Лл | Ll | |Лебедин |Lebedyn |
123
+ # | | | |Леонід |Leonid |
124
+ # |-------------+----------+------------+------------+-------------|
125
+ # | Мм | Mm | |Миколаїв |Mykolaiv |
126
+ # | | | |Маринич |Marynych |
127
+ # |-------------+----------+------------+------------+-------------|
128
+ # | Нн | Nn | |Ніжин |Nizhyn |
129
+ # | | | |Наталія |Nataliia |
130
+ # |-------------+----------+------------+------------+-------------|
131
+ # | Оо | Oo | |Одеса |Odesa |
132
+ # | | | |Онищенко |Onyshchenko |
133
+ # |-------------+----------+------------+------------+-------------|
134
+ # | Пп | Pp | |Полтава |Poltava |
135
+ # | | | |Петро |Petro |
136
+ # |-------------+----------+------------+------------+-------------|
137
+ # | Рр | Rr | |Решетилівка |Reshetylivka |
138
+ # | | | |Рибчинський |Rybchynskyi |
139
+ # |-------------+----------+------------+------------+-------------|
140
+ # | Сс | Ss | |Суми |Sumy |
141
+ # | | | |Соломія |Solomiia |
142
+ # |-------------+----------+------------+------------+-------------|
143
+ # | Тт | Tt | |Тернопіль |Ternopil |
144
+ # | | | |Троць |Trots |
145
+ # |-------------+----------+------------+------------+-------------|
146
+ # | Уу | Uu | |Ужгород |Uzhhorod |
147
+ # | | | |Уляна |Uliana |
148
+ # |-------------+----------+------------+------------+-------------|
149
+ # | Фф | Ff | |Фастів |Fastiv |
150
+ # | | | |Філіпчук |Filipchuk |
151
+ # |-------------+----------+------------+------------+-------------|
152
+ # | Хх | Kh kh | |Харків |Kharkiv |
153
+ # | | | |Христина |Khrystyna |
154
+ # |-------------+----------+------------+------------+-------------|
155
+ # | Цц | Ts ts | |Біла Церква |Bila Tserkva |
156
+ # | | | |Стеценко |Stetsenko |
157
+ # |-------------+----------+------------+------------+-------------|
158
+ # | Чч | Ch ch | |Чернівці |Chernivtsi |
159
+ # | | | |Шевченко |Shevchenko |
160
+ # |-------------+----------+------------+------------+-------------|
161
+ # | Шш | Sh sh | |Шостка |Shostka |
162
+ # | | | |Кишеньки |Kyshenky |
163
+ # |-------------+----------+------------+------------+-------------|
164
+ # | Щщ |Shch shch | |Щербухи |Shcherbukhy |
165
+ # | | | |Гоща |Hoshcha |
166
+ # | | | |Гаращенко |Harashchenko |
167
+ # |-------------+----------+------------+------------+-------------|
168
+ # | Юю | Yu | на початку |Юрій |Yurii |
169
+ # | | | слова |Корюківка |Koriukivka |
170
+ # | | iu | в інших | | |
171
+ # | | | позиціях | | |
172
+ # |-------------+----------+------------+------------+-------------|
173
+ # | Яя | Ya | на початку |Яготин |Yahotyn |
174
+ # | | | слова |Ярошенко |Yaroshenko |
175
+ # | | ia | в інших |Костянтин |Kostiantyn |
176
+ # | | | позиціях |Знам'янка |Znamianka |
177
+ # | | | |Феодосія |Feodosiia |
178
+ # ------------------------------------------------------------------
179
+ #
180
+ # _______________
181
+ # Примітка: 1. Буквосполучення "зг" відтворюється латиницею як "zgh"
182
+ # (наприклад, Згорани - Zghorany, Розгон - Rozghon) на
183
+ # відміну від "zh" - відповідника української літери
184
+ # "ж".
185
+ # 2. М'який знак і апостроф латиницею не відтворюються.
186
+ # 3. Транслітерація прізвищ та імен осіб і географічних
187
+ # назв здійснюється шляхом відтворення кожної літери
188
+ # латиницею.
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cyrillic
4
+ module Ukrainian
5
+ k = %w[А Б В Г Ґ Д Е Є Ж З И І Ї Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ь Ю Я а б в г ґ д е є ж з и і ї й к л м н о п р с т у ф х ц ч ш щ ь ю я].freeze
6
+ v = %w[A B V H G D E Ye Zh Z Y I Yi I K L M N O P R S T U F Kh Ts Ch Sh Shch ʹ Iu Ia a b v h g d e ye zh z y i yi i k l m n o p r s t u f kh ts ch sh shch ʹ iu ia].freeze
7
+
8
+ CHARACTER_TABLE = k.zip(v).to_h.freeze
9
+ REGEXP = Regexp.union(CHARACTER_TABLE.keys).freeze
10
+ end
11
+ end
12
+
13
+ Ukrainian = Cyrillic::Ukrainian unless defined?(Ukrainian)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Cyrillic
2
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
3
5
  end
data/lib/cyrillic.rb CHANGED
@@ -1,93 +1,66 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "cyrillic/version"
4
+ require "cyrillic/iso9"
5
+ require "cyrillic/mongolian"
6
+ require "cyrillic/ukrainian"
7
+ require "cyrillic/ua_passport"
8
+ require "cyrillic/de"
2
9
 
3
10
  module Cyrillic
11
+ k = %w[
12
+ А Б В Г Д Е Ё Ж З И І Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Ѣ Э Ю Я Ѳ Ѵ
13
+ а б в г д е ё ж з и і й к л м н о п р с т у ф х ц ч ш щ ъ ы ь ѣ э ю я ѳ ѵ
14
+ ].freeze
15
+ v = %w[
16
+ A B V G D E Ë ZH Z I Ī Ĭ K L M N O P R S T U F KH TS CH SH SHCH ʺ Y ʹ IE Ė IU IA Ḟ Ẏ
17
+ a b v g d e ë zh z i ī ĭ k l m n o p r s t u f kh ts ch sh shch ʺ y ʹ ie ė iu ia ḟ ẏ
18
+ ].freeze
4
19
 
5
- # Note. The letters І, Ѣ, Ѳ and Ѵ were eliminated in the orthographic reform of 1918.
6
- # For other obsolete letters appearing in Russian texts, consult the Church Slavic table.
7
-
8
- CHARACTER_TABLE = {
9
- "А" => "A",
10
- "Б" => "B",
11
- "В" => "V",
12
- "Г" => "G",
13
- "Д" => "D",
14
- "Е" => "E",
15
- "Ё" => "Ë",
16
- "Ж" => "ZH",
17
- "З" => "Z",
18
- "И" => "I",
19
- "І" => "Ī",
20
- "Й" => "Ĭ",
21
- "К" => "K",
22
- "Л" => "L",
23
- "М" => "M",
24
- "Н" => "N",
25
- "О" => "O",
26
- "П" => "P",
27
- "Р" => "R",
28
- "С" => "S",
29
- "Т" => "T",
30
- "У" => "U",
31
- "Ф" => "F",
32
- "Х" => "KH",
33
- "Ц" => "TS",
34
- "Ч" => "CH",
35
- "Ш" => "SH",
36
- "Щ" => "SHCH",
37
- "Ъ" => "ʺ", #(HARD SIGN)
38
- "Ы" => "Y",
39
- "Ь" => "ʹ", #(SOFT SIGN)
40
- "Ѣ" => "IE",
41
- "Э" => "Ė",
42
- "Ю" => "IU",
43
- "Я" => "IA",
44
- "Ѳ" => "Ḟ",
45
- "Ѵ" => "Ẏ",
20
+ CHARACTER_TABLE = k.zip(v).to_h.freeze
21
+ REGEXP = Regexp.union(CHARACTER_TABLE.keys).freeze
46
22
 
47
- "а" => "a",
48
- "б" => "b",
49
- "в" => "v",
50
- "г" => "g",
51
- "д" => "d",
52
- "е" => "e",
53
- "ё" => "ë",
54
- "ж" => "zh",
55
- "з" => "z",
56
- "и" => "i",
57
- "і" => "ī",
58
- "й" => "ĭ",
59
- "к" => "k",
60
- "л" => "l",
61
- "м" => "m",
62
- "н" => "n",
63
- "о" => "o",
64
- "п" => "p",
65
- "р" => "r",
66
- "с" => "s",
67
- "т" => "t",
68
- "у" => "u",
69
- "ф" => "f",
70
- "х" => "kh",
71
- "ц" => "ts",
72
- "ч" => "ch",
73
- "ш" => "sh",
74
- "щ" => "shch",
75
- "ъ" => "ʺ", #(hard sign)
76
- "ы" => "y",
77
- "ь" => "ʹ", #(soft sign)
78
- "ѣ" => "ie",
79
- "э" => "ė",
80
- "ю" => "iu",
81
- "я" => "ia",
82
- "ѳ" => "ḟ",
83
- "ѵ" => "ẏ",
84
- }
23
+ SCHEMES = {
24
+ cyrillic: [CHARACTER_TABLE, REGEXP].freeze,
25
+ default: [CHARACTER_TABLE, REGEXP].freeze,
26
+ iso9: [Iso9::CHARACTER_TABLE, Iso9::REGEXP].freeze,
27
+ mongolian: [Mongolian::CHARACTER_TABLE, Mongolian::REGEXP].freeze,
28
+ ukrainian: [Ukrainian::CHARACTER_TABLE, Ukrainian::REGEXP].freeze,
29
+ ua_passport: :ua_passport,
30
+ de: [De::CHARACTER_TABLE, De::REGEXP].freeze
31
+ }.freeze
85
32
 
86
33
  class << self
87
- def transliterate(string = "")
88
- string.to_s.gsub(Regexp.union(CHARACTER_TABLE.keys), CHARACTER_TABLE)
34
+ # Transliterates Cyrillic text into Roman (Latin) script.
35
+ #
36
+ # @param string [String, #to_s] The text to transliterate.
37
+ # @param to [Symbol, String] The transliteration scheme (:cyrillic, :iso9, :mongolian, :ukrainian, :ua_passport, :de).
38
+ # @return [String] The transliterated Latin script string.
39
+ # @raise [ArgumentError] If the given transliteration scheme is unknown.
40
+ #
41
+ # @example Default Cyrillic transliteration
42
+ # Cyrillic.transliterate("Кириллица") #=> "Kirillitsa"
43
+ #
44
+ # @example Short alias .t with ISO 9 scheme
45
+ # Cyrillic.t("Кириллица", :iso9) #=> "Kirillica"
46
+ #
47
+ # @example Ukrainian Passport scheme
48
+ # Cyrillic.t("Борщагівка", :ua_passport) #=> "Borshchahivka"
49
+ def transliterate(string = "", to = :cyrillic)
50
+ return "" if string.nil? || string.empty?
51
+
52
+ scheme_key = to.to_s.downcase.to_sym
53
+ scheme = SCHEMES[scheme_key]
54
+ unless scheme
55
+ available = (SCHEMES.keys - [:default]).map(&:inspect).join(", ")
56
+ raise ArgumentError, "Unknown transliteration scheme: #{to.inspect}. Available schemes: #{available}"
57
+ end
58
+
59
+ return UaPassport.transliterate(string) if scheme_key == :ua_passport
60
+
61
+ table, regexp = scheme
62
+ string.to_s.gsub(regexp, table)
89
63
  end
90
- alias_method :t, :transliterate
64
+ alias t transliterate
91
65
  end
92
-
93
66
  end
metadata CHANGED
@@ -1,82 +1,129 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyrillic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rovetz
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2018-04-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: bundler
13
+ name: irb
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - "~>"
16
+ - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '1.16'
18
+ version: '0'
20
19
  type: :development
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - "~>"
23
+ - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '1.16'
25
+ version: '0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: minitest
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '5.25'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '5.25'
27
40
  - !ruby/object:Gem::Dependency
28
41
  name: rake
29
42
  requirement: !ruby/object:Gem::Requirement
30
43
  requirements:
31
- - - "~>"
44
+ - - ">="
32
45
  - !ruby/object:Gem::Version
33
- version: '10.0'
46
+ version: '13.2'
34
47
  type: :development
35
48
  prerelease: false
36
49
  version_requirements: !ruby/object:Gem::Requirement
37
50
  requirements:
38
- - - "~>"
51
+ - - ">="
39
52
  - !ruby/object:Gem::Version
40
- version: '10.0'
53
+ version: '13.2'
41
54
  - !ruby/object:Gem::Dependency
42
- name: minitest
55
+ name: rdoc
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ type: :development
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: rubocop
43
70
  requirement: !ruby/object:Gem::Requirement
44
71
  requirements:
45
- - - "~>"
72
+ - - ">="
46
73
  - !ruby/object:Gem::Version
47
- version: '5.0'
74
+ version: '1.64'
48
75
  type: :development
49
76
  prerelease: false
50
77
  version_requirements: !ruby/object:Gem::Requirement
51
78
  requirements:
52
- - - "~>"
79
+ - - ">="
53
80
  - !ruby/object:Gem::Version
54
- version: '5.0'
55
- description: Romanization (transliteration) of Cyrillic. Converts Cyrillic text to
56
- the Roman (Latin) script
81
+ version: '1.64'
82
+ - !ruby/object:Gem::Dependency
83
+ name: simplecov
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0.22'
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0.22'
96
+ description: Converts Cyrillic text to the Roman (Latin) script
57
97
  email:
58
98
  - zakbox@gmail.com
59
- executables: []
99
+ executables:
100
+ - cyrillic
60
101
  extensions: []
61
102
  extra_rdoc_files: []
62
103
  files:
63
- - ".gitignore"
64
- - ".travis.yml"
104
+ - ".rubocop.yml"
105
+ - CHANGELOG.md
65
106
  - CODE_OF_CONDUCT.md
66
- - Gemfile
67
107
  - LICENSE.txt
68
108
  - README.md
69
109
  - Rakefile
70
- - bin/console
71
- - bin/setup
72
110
  - cyrillic.gemspec
111
+ - exe/cyrillic
73
112
  - lib/cyrillic.rb
113
+ - lib/cyrillic/de.rb
114
+ - lib/cyrillic/iso9.rb
115
+ - lib/cyrillic/mongolian.rb
116
+ - lib/cyrillic/ua_passport.rb
117
+ - lib/cyrillic/ukrainian.rb
74
118
  - lib/cyrillic/version.rb
75
119
  homepage: https://github.com/rovetz/cyrillic
76
120
  licenses:
77
121
  - MIT
78
- metadata: {}
79
- post_install_message:
122
+ metadata:
123
+ source_code_uri: https://github.com/rovetz/cyrillic
124
+ changelog_uri: https://github.com/rovetz/cyrillic/blob/main/CHANGELOG.md
125
+ bug_tracker_uri: https://github.com/rovetz/cyrillic/issues
126
+ rubygems_mfa_required: 'true'
80
127
  rdoc_options: []
81
128
  require_paths:
82
129
  - lib
@@ -84,16 +131,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
84
131
  requirements:
85
132
  - - ">="
86
133
  - !ruby/object:Gem::Version
87
- version: '0'
134
+ version: 3.3.0
88
135
  required_rubygems_version: !ruby/object:Gem::Requirement
89
136
  requirements:
90
137
  - - ">="
91
138
  - !ruby/object:Gem::Version
92
139
  version: '0'
93
140
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.7.6
96
- signing_key:
141
+ rubygems_version: 4.0.20
97
142
  specification_version: 4
98
143
  summary: Romanization (transliteration) of Cyrillic
99
144
  test_files: []
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.0
5
- before_install: gem install bundler -v 1.16.1
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in cyrillic.gemspec
6
- gemspec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "cyrillic"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here