grc 0.1.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 798c467ff22b45398cdc96912bb4ea808fa4e00cfdf5d914c58624be1622efef
4
- data.tar.gz: c08a1f326962c3354cb7ceeea7ac75215cdbc54955f56ce236b52f9a01bd8155
3
+ metadata.gz: 548df19ff151d10d595c45a8d964e8b6d6b5eef701bf6fef730307a8307e73be
4
+ data.tar.gz: ba58fa1b46dcd84f2d39447358ab5f165110f1d4afb3e7b91630c271f80e4e2d
5
5
  SHA512:
6
- metadata.gz: 6dcce9c085b9b6de13e35b561ba8830405e61fe1db6c7be4d6d6378cdf62a3916fca4c2b7c79d7d8982825a9036b02e5be0f6347aacba1209011356db377803f
7
- data.tar.gz: 343da32bfd320228e8d530ae17456edc9212bc9b4d0f0d5307f32e9c25e2242e87d11b944c8be79e747b2f8a6d269e98d90fb95ee84540fff4667ede785af304
6
+ metadata.gz: 7332f28b7ec732a811560205874d824588515acf2ae367c767d9d7edb7ab715005394fd080b064280b72b34f1170873c890ab41550c69080bc39350ab4c8d2fe
7
+ data.tar.gz: 6bb907945e3bc1d5f2fedc6d099d2c8d5b9c32378a3168f323e7971f04873dcd55c9fa905fdb327d59070830fe2ec0273188e144ff6bba3340a374dd9f372ba1
data/.idea/grc.iml CHANGED
@@ -12,43 +12,53 @@
12
12
  <orderEntry type="jdk" jdkName="rbenv: 3.1.0" jdkType="RUBY_SDK" />
13
13
  <orderEntry type="sourceFolder" forTests="false" />
14
14
  <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, rbenv: 3.1.0) [gem]" level="application" />
15
- <orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.17, rbenv: 3.1.0) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.22, rbenv: 3.1.0) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="coveralls (v0.8.23, rbenv: 3.1.0) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="docile (v1.4.0, rbenv: 3.1.0) [gem]" level="application" />
16
18
  <orderEntry type="library" scope="PROVIDED" name="json (v2.6.2, rbenv: 3.1.0) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="minitest (v5.16.2, rbenv: 3.1.0) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.16.3, rbenv: 3.1.0) [gem]" level="application" />
18
20
  <orderEntry type="library" scope="PROVIDED" name="parallel (v1.22.1, rbenv: 3.1.0) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="parser (v3.1.2.0, rbenv: 3.1.0) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="parser (v3.1.2.1, rbenv: 3.1.0) [gem]" level="application" />
20
22
  <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, rbenv: 3.1.0) [gem]" level="application" />
21
23
  <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, rbenv: 3.1.0) [gem]" level="application" />
22
24
  <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.5.0, rbenv: 3.1.0) [gem]" level="application" />
23
25
  <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, rbenv: 3.1.0) [gem]" level="application" />
24
- <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.31.2, rbenv: 3.1.0) [gem]" level="application" />
25
- <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.19.1, rbenv: 3.1.0) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.36.0, rbenv: 3.1.0) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.21.0, rbenv: 3.1.0) [gem]" level="application" />
26
28
  <orderEntry type="library" scope="PROVIDED" name="rubocop-minitest (v0.20.1, rbenv: 3.1.0) [gem]" level="application" />
27
29
  <orderEntry type="library" scope="PROVIDED" name="rubocop-rake (v0.6.0, rbenv: 3.1.0) [gem]" level="application" />
28
30
  <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, rbenv: 3.1.0) [gem]" level="application" />
29
- <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.2.0, rbenv: 3.1.0) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="rubyzip (v2.3.2, rbenv: 3.1.0) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="simplecov (v0.16.1, rbenv: 3.1.0) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.10.2, rbenv: 3.1.0) [gem]" level="application" />
34
+ <orderEntry type="library" scope="PROVIDED" name="sync (v0.5.0, rbenv: 3.1.0) [gem]" level="application" />
35
+ <orderEntry type="library" scope="PROVIDED" name="term-ansicolor (v1.7.1, rbenv: 3.1.0) [gem]" level="application" />
36
+ <orderEntry type="library" scope="PROVIDED" name="thor (v1.2.1, rbenv: 3.1.0) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="tins (v1.31.1, rbenv: 3.1.0) [gem]" level="application" />
38
+ <orderEntry type="library" scope="PROVIDED" name="unicode-data (v0.1.1, rbenv: 3.1.0) [gem]" level="application" />
39
+ <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.3.0, rbenv: 3.1.0) [gem]" level="application" />
30
40
  <orderEntry type="library" scope="PROVIDED" name="unicode-name (v1.10.0, rbenv: 3.1.0) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="unicode-types (v1.7.0, rbenv: 3.1.0) [gem]" level="application" />
41
+ <orderEntry type="library" scope="PROVIDED" name="unicode-types (v1.8.0, rbenv: 3.1.0) [gem]" level="application" />
32
42
  </component>
33
43
  <component name="RakeTasksCache">
34
44
  <option name="myRootTask">
35
45
  <RakeTaskImpl id="rake">
36
46
  <subtasks>
37
- <RakeTaskImpl description="Build grc-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
47
+ <RakeTaskImpl description="Build grc-0.1.3.gem into the pkg directory" fullCommand="build" id="build" />
38
48
  <RakeTaskImpl id="build">
39
49
  <subtasks>
40
- <RakeTaskImpl description="Generate SHA512 checksum if grc-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
50
+ <RakeTaskImpl description="Generate SHA512 checksum if grc-0.1.3.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
41
51
  </subtasks>
42
52
  </RakeTaskImpl>
43
53
  <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
44
54
  <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
45
- <RakeTaskImpl description="Build and install grc-0.1.0.gem into system gems" fullCommand="install" id="install" />
55
+ <RakeTaskImpl description="Build and install grc-0.1.3.gem into system gems" fullCommand="install" id="install" />
46
56
  <RakeTaskImpl id="install">
47
57
  <subtasks>
48
- <RakeTaskImpl description="Build and install grc-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
58
+ <RakeTaskImpl description="Build and install grc-0.1.3.gem into system gems without network access" fullCommand="install:local" id="local" />
49
59
  </subtasks>
50
60
  </RakeTaskImpl>
51
- <RakeTaskImpl description="Create tag v0.1.0 and build and push grc-0.1.0.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
61
+ <RakeTaskImpl description="Create tag v0.1.3 and build and push grc-0.1.3.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
52
62
  <RakeTaskImpl description="Run RuboCop" fullCommand="rubocop" id="rubocop" />
53
63
  <RakeTaskImpl id="rubocop">
54
64
  <subtasks>
data/.idea/workspace.xml CHANGED
@@ -4,9 +4,10 @@
4
4
  <option name="autoReloadType" value="SELECTIVE" />
5
5
  </component>
6
6
  <component name="ChangeListManager">
7
- <list default="true" id="0af4ebef-9f59-4a85-9f65-0d8163baa737" name="Changes" comment="2022-07-12-01-33">
7
+ <list default="true" id="0af4ebef-9f59-4a85-9f65-0d8163baa737" name="Changes" comment="experimenting with unicode/data, codepoints.">
8
+ <change beforePath="$PROJECT_DIR$/.idea/grc.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/grc.iml" afterDir="false" />
8
9
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
9
- <change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile.lock" afterDir="false" />
10
+ <change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" />
10
11
  <change beforePath="$PROJECT_DIR$/lib/grc.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/grc.rb" afterDir="false" />
11
12
  <change beforePath="$PROJECT_DIR$/lib/grc/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/grc/version.rb" afterDir="false" />
12
13
  </list>
@@ -15,6 +16,13 @@
15
16
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
16
17
  <option name="LAST_RESOLUTION" value="IGNORE" />
17
18
  </component>
19
+ <component name="FileTemplateManagerImpl">
20
+ <option name="RECENT_TEMPLATES">
21
+ <list>
22
+ <option value="teeste" />
23
+ </list>
24
+ </option>
25
+ </component>
18
26
  <component name="Git.Settings">
19
27
  <option name="PUSH_TAGS">
20
28
  <GitPushTagMode>
@@ -22,8 +30,18 @@
22
30
  <option name="title" value="All" />
23
31
  </GitPushTagMode>
24
32
  </option>
33
+ <option name="RECENT_BRANCH_BY_REPOSITORY">
34
+ <map>
35
+ <entry key="$PROJECT_DIR$" value="dev" />
36
+ </map>
37
+ </option>
25
38
  <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
26
39
  </component>
40
+ <component name="HighlightingSettingsPerFile">
41
+ <setting file="file://$PROJECT_DIR$/Gemfile" root0="FORCE_HIGHLIGHTING" />
42
+ <setting file="file://$PROJECT_DIR$/grc.gemspec" root0="FORCE_HIGHLIGHTING" />
43
+ <setting file="file://$PROJECT_DIR$/lib/grc.rb" root0="FORCE_HIGHLIGHTING" />
44
+ </component>
27
45
  <component name="MarkdownSettingsMigration">
28
46
  <option name="stateVersion" value="1" />
29
47
  </component>
@@ -35,13 +53,17 @@
35
53
  </component>
36
54
  <component name="PropertiesComponent">{
37
55
  &quot;keyToString&quot;: {
56
+ &quot;Project.color&quot;: &quot;003853&quot;,
38
57
  &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
39
58
  &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
59
+ &quot;ToolWindowGitHub Copilot.ShowToolbar&quot;: &quot;false&quot;,
60
+ &quot;last_opened_file_path&quot;: &quot;/Users/bcdav/Dropbox/Developer/Ruby/Gems/grc&quot;,
40
61
  &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
41
- &quot;ruby.rails.projectView.checked&quot;: &quot;true&quot;
62
+ &quot;ruby.rails.projectView.checked&quot;: &quot;true&quot;,
63
+ &quot;settings.editor.selected.configurable&quot;: &quot;preferences.editor&quot;
42
64
  }
43
65
  }</component>
44
- <component name="RunManager" selected="Test::Unit/Shoulda/Minitest.test_grc.rb">
66
+ <component name="RunManager" selected="Ruby.grc">
45
67
  <configuration name="grc" type="RubyRunConfigurationType" factoryName="Ruby" temporary="true">
46
68
  <module name="grc" />
47
69
  <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="" />
@@ -61,6 +83,19 @@
61
83
  <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
62
84
  <method v="2" />
63
85
  </configuration>
86
+ <configuration name="scratch_2" type="RubyRunConfigurationType" factoryName="Ruby" temporary="true">
87
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="" />
88
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$PROJECT_DIR$" />
89
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
90
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
91
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
92
+ <EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
93
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
94
+ <EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
95
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$APPLICATION_CONFIG_DIR$/scratches/scratch_2.rb" />
96
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
97
+ <method v="2" />
98
+ </configuration>
64
99
  <configuration name="test_grc.rb" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
65
100
  <module name="grc" />
66
101
  <predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
@@ -92,7 +127,7 @@
92
127
  <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
93
128
  <method v="2" />
94
129
  </configuration>
95
- <configuration name="test_unicode_name" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
130
+ <configuration name="test_oxia_to_tonos" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
96
131
  <module name="grc" />
97
132
  <predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
98
133
  <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
@@ -115,7 +150,38 @@
115
150
  <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/test/test_grc.rb" />
116
151
  <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPTS_PATHS" VALUE="$MODULE_DIR$/test/test_grc.rb" />
117
152
  <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
118
- <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="^test_unicode_name$" />
153
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="^test_oxia_to_tonos$" />
154
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_METHOD" />
155
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
156
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
157
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
158
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
159
+ <method v="2" />
160
+ </configuration>
161
+ <configuration name="test_tonos_to_oxia" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
162
+ <module name="grc" />
163
+ <predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
164
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
165
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
166
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
167
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
168
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
169
+ <envs>
170
+ <env name="JRUBY_OPTS" value="-X+O" />
171
+ </envs>
172
+ <EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
173
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
174
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_BRANCH_COVERAGE="true" ENABLE_FORKED_COVERAGE="true">
175
+ <COVERAGE_PATTERN ENABLED="true">
176
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
177
+ </COVERAGE_PATTERN>
178
+ </EXTENSION>
179
+ <EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
180
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
181
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/test/test_grc.rb" />
182
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPTS_PATHS" VALUE="$MODULE_DIR$/test/test_grc.rb" />
183
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
184
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="^test_tonos_to_oxia$" />
119
185
  <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_METHOD" />
120
186
  <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
121
187
  <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
@@ -125,14 +191,19 @@
125
191
  </configuration>
126
192
  <recent_temporary>
127
193
  <list>
194
+ <item itemvalue="Test::Unit/Shoulda/Minitest.test_tonos_to_oxia" />
195
+ <item itemvalue="Test::Unit/Shoulda/Minitest.test_oxia_to_tonos" />
128
196
  <item itemvalue="Test::Unit/Shoulda/Minitest.test_grc.rb" />
129
- <item itemvalue="Test::Unit/Shoulda/Minitest.test_unicode_name" />
197
+ <item itemvalue="Ruby.scratch_2" />
130
198
  <item itemvalue="Ruby.grc" />
131
199
  </list>
132
200
  </recent_temporary>
133
201
  </component>
134
202
  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
135
203
  <component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="true" RAILS_SPRING_PRE_LOADER_OPTION="true" />
204
+ <component name="SvnConfiguration">
205
+ <configuration />
206
+ </component>
136
207
  <component name="TaskManager">
137
208
  <task active="true" id="Default" summary="Default task">
138
209
  <changelist id="0af4ebef-9f59-4a85-9f65-0d8163baa737" name="Changes" comment="" />
@@ -141,7 +212,34 @@
141
212
  <option name="presentableId" value="Default" />
142
213
  <updated>1657595515095</updated>
143
214
  <workItem from="1657595516239" duration="5292000" />
144
- <workItem from="1657776231899" duration="6000" />
215
+ <workItem from="1657776231899" duration="3819000" />
216
+ <workItem from="1657925313775" duration="11283000" />
217
+ <workItem from="1658162313087" duration="7923000" />
218
+ <workItem from="1658182588862" duration="10908000" />
219
+ <workItem from="1658229649287" duration="2005000" />
220
+ <workItem from="1658243583313" duration="8538000" />
221
+ <workItem from="1658327357205" duration="4811000" />
222
+ <workItem from="1658437305242" duration="60892000" />
223
+ <workItem from="1658793189231" duration="3008000" />
224
+ <workItem from="1659046804362" duration="2017000" />
225
+ <workItem from="1659197586942" duration="1414000" />
226
+ <workItem from="1659204674764" duration="580000" />
227
+ <workItem from="1659298414038" duration="277000" />
228
+ <workItem from="1659298764460" duration="21000" />
229
+ <workItem from="1659298848656" duration="1163000" />
230
+ <workItem from="1659382588913" duration="1766000" />
231
+ <workItem from="1659393975105" duration="7621000" />
232
+ <workItem from="1659884686054" duration="564000" />
233
+ <workItem from="1659914689266" duration="599000" />
234
+ <workItem from="1660407810452" duration="566000" />
235
+ <workItem from="1661147582360" duration="9000" />
236
+ <workItem from="1661570128064" duration="567000" />
237
+ <workItem from="1661730913413" duration="563000" />
238
+ <workItem from="1661793944163" duration="564000" />
239
+ <workItem from="1662035865384" duration="1169000" />
240
+ <workItem from="1662266053254" duration="7000" />
241
+ <workItem from="1662493848057" duration="1197000" />
242
+ <workItem from="1664331878344" duration="2087000" />
145
243
  </task>
146
244
  <task id="LOCAL-00001" summary="Initial commit">
147
245
  <created>1657596693848</created>
@@ -199,7 +297,175 @@
199
297
  <option name="project" value="LOCAL" />
200
298
  <updated>1657600429179</updated>
201
299
  </task>
202
- <option name="localTasksCounter" value="9" />
300
+ <task id="LOCAL-00009" summary="fixed no_upcase_diacritics">
301
+ <created>1657776287327</created>
302
+ <option name="number" value="00009" />
303
+ <option name="presentableId" value="LOCAL-00009" />
304
+ <option name="project" value="LOCAL" />
305
+ <updated>1657776287327</updated>
306
+ </task>
307
+ <task id="LOCAL-00010" summary="fixed no_upcase_diacritics">
308
+ <created>1657776308249</created>
309
+ <option name="number" value="00010" />
310
+ <option name="presentableId" value="LOCAL-00010" />
311
+ <option name="project" value="LOCAL" />
312
+ <updated>1657776308249</updated>
313
+ </task>
314
+ <task id="LOCAL-00011" summary="minor fix">
315
+ <created>1657777089163</created>
316
+ <option name="number" value="00011" />
317
+ <option name="presentableId" value="LOCAL-00011" />
318
+ <option name="project" value="LOCAL" />
319
+ <updated>1657777089163</updated>
320
+ </task>
321
+ <task id="LOCAL-00012" summary="minor fix">
322
+ <created>1657777286176</created>
323
+ <option name="number" value="00012" />
324
+ <option name="presentableId" value="LOCAL-00012" />
325
+ <option name="project" value="LOCAL" />
326
+ <updated>1657777286176</updated>
327
+ </task>
328
+ <task id="LOCAL-00013" summary="2022-07-16-03-34">
329
+ <created>1657953258951</created>
330
+ <option name="number" value="00013" />
331
+ <option name="presentableId" value="LOCAL-00013" />
332
+ <option name="project" value="LOCAL" />
333
+ <updated>1657953258951</updated>
334
+ </task>
335
+ <task id="LOCAL-00014" summary="2022-07-16-03-45">
336
+ <created>1657953913633</created>
337
+ <option name="number" value="00014" />
338
+ <option name="presentableId" value="LOCAL-00014" />
339
+ <option name="project" value="LOCAL" />
340
+ <updated>1657953913633</updated>
341
+ </task>
342
+ <task id="LOCAL-00015" summary="2022-07-16-12-41">
343
+ <created>1657986087994</created>
344
+ <option name="number" value="00015" />
345
+ <option name="presentableId" value="LOCAL-00015" />
346
+ <option name="project" value="LOCAL" />
347
+ <updated>1657986087994</updated>
348
+ </task>
349
+ <task id="LOCAL-00016" summary="2022-07-16-12-41">
350
+ <created>1657986472233</created>
351
+ <option name="number" value="00016" />
352
+ <option name="presentableId" value="LOCAL-00016" />
353
+ <option name="project" value="LOCAL" />
354
+ <updated>1657986472233</updated>
355
+ </task>
356
+ <task id="LOCAL-00017" summary="README updated">
357
+ <created>1658025693260</created>
358
+ <option name="number" value="00017" />
359
+ <option name="presentableId" value="LOCAL-00017" />
360
+ <option name="project" value="LOCAL" />
361
+ <updated>1658025693260</updated>
362
+ </task>
363
+ <task id="LOCAL-00018" summary="README updated">
364
+ <created>1658025874297</created>
365
+ <option name="number" value="00018" />
366
+ <option name="presentableId" value="LOCAL-00018" />
367
+ <option name="project" value="LOCAL" />
368
+ <updated>1658025874297</updated>
369
+ </task>
370
+ <task id="LOCAL-00019" summary="README updated">
371
+ <created>1658029175162</created>
372
+ <option name="number" value="00019" />
373
+ <option name="presentableId" value="LOCAL-00019" />
374
+ <option name="project" value="LOCAL" />
375
+ <updated>1658029175162</updated>
376
+ </task>
377
+ <task id="LOCAL-00020" summary="README updated">
378
+ <created>1658030060833</created>
379
+ <option name="number" value="00020" />
380
+ <option name="presentableId" value="LOCAL-00020" />
381
+ <option name="project" value="LOCAL" />
382
+ <updated>1658030060833</updated>
383
+ </task>
384
+ <task id="LOCAL-00021" summary="README updated">
385
+ <created>1658098607476</created>
386
+ <option name="number" value="00021" />
387
+ <option name="presentableId" value="LOCAL-00021" />
388
+ <option name="project" value="LOCAL" />
389
+ <updated>1658098607476</updated>
390
+ </task>
391
+ <task id="LOCAL-00022" summary="Coveralls">
392
+ <created>1658280422988</created>
393
+ <option name="number" value="00022" />
394
+ <option name="presentableId" value="LOCAL-00022" />
395
+ <option name="project" value="LOCAL" />
396
+ <updated>1658280422988</updated>
397
+ </task>
398
+ <task id="LOCAL-00023" summary="Coveralls">
399
+ <created>1658280656062</created>
400
+ <option name="number" value="00023" />
401
+ <option name="presentableId" value="LOCAL-00023" />
402
+ <option name="project" value="LOCAL" />
403
+ <updated>1658280656062</updated>
404
+ </task>
405
+ <task id="LOCAL-00024" summary="Fix last commit">
406
+ <created>1658281489780</created>
407
+ <option name="number" value="00024" />
408
+ <option name="presentableId" value="LOCAL-00024" />
409
+ <option name="project" value="LOCAL" />
410
+ <updated>1658281489780</updated>
411
+ </task>
412
+ <task id="LOCAL-00025" summary="Fix last commit">
413
+ <created>1658282205375</created>
414
+ <option name="number" value="00025" />
415
+ <option name="presentableId" value="LOCAL-00025" />
416
+ <option name="project" value="LOCAL" />
417
+ <updated>1658282205375</updated>
418
+ </task>
419
+ <task id="LOCAL-00026" summary="Fix last commit">
420
+ <created>1658282499690</created>
421
+ <option name="number" value="00026" />
422
+ <option name="presentableId" value="LOCAL-00026" />
423
+ <option name="project" value="LOCAL" />
424
+ <updated>1658282499690</updated>
425
+ </task>
426
+ <task id="LOCAL-00027" summary="Fix last commit">
427
+ <created>1658282721327</created>
428
+ <option name="number" value="00027" />
429
+ <option name="presentableId" value="LOCAL-00027" />
430
+ <option name="project" value="LOCAL" />
431
+ <updated>1658282721327</updated>
432
+ </task>
433
+ <task id="LOCAL-00028" summary="Fix last commit">
434
+ <created>1658282904134</created>
435
+ <option name="number" value="00028" />
436
+ <option name="presentableId" value="LOCAL-00028" />
437
+ <option name="project" value="LOCAL" />
438
+ <updated>1658282904134</updated>
439
+ </task>
440
+ <task id="LOCAL-00029" summary="Fixed readme">
441
+ <created>1658890232799</created>
442
+ <option name="number" value="00029" />
443
+ <option name="presentableId" value="LOCAL-00029" />
444
+ <option name="project" value="LOCAL" />
445
+ <updated>1658890232799</updated>
446
+ </task>
447
+ <task id="LOCAL-00030" summary="codepoints, unicode/data">
448
+ <created>1658890400055</created>
449
+ <option name="number" value="00030" />
450
+ <option name="presentableId" value="LOCAL-00030" />
451
+ <option name="project" value="LOCAL" />
452
+ <updated>1658890400055</updated>
453
+ </task>
454
+ <task id="LOCAL-00031" summary="Fixed readme">
455
+ <created>1658890938880</created>
456
+ <option name="number" value="00031" />
457
+ <option name="presentableId" value="LOCAL-00031" />
458
+ <option name="project" value="LOCAL" />
459
+ <updated>1658890938880</updated>
460
+ </task>
461
+ <task id="LOCAL-00032" summary="Fixed readme">
462
+ <created>1658891037810</created>
463
+ <option name="number" value="00032" />
464
+ <option name="presentableId" value="LOCAL-00032" />
465
+ <option name="project" value="LOCAL" />
466
+ <updated>1658891037810</updated>
467
+ </task>
468
+ <option name="localTasksCounter" value="33" />
203
469
  <servers />
204
470
  </component>
205
471
  <component name="TypeScriptGeneratedFilesManager">
@@ -210,7 +476,24 @@
210
476
  <map>
211
477
  <entry key="MAIN">
212
478
  <value>
213
- <State />
479
+ <State>
480
+ <option name="CUSTOM_BOOLEAN_PROPERTIES">
481
+ <map>
482
+ <entry key="Show.Git.Branches" value="true" />
483
+ </map>
484
+ </option>
485
+ <option name="FILTERS">
486
+ <map>
487
+ <entry key="branch">
488
+ <value>
489
+ <list>
490
+ <option value="Main" />
491
+ </list>
492
+ </value>
493
+ </entry>
494
+ </map>
495
+ </option>
496
+ </State>
214
497
  </value>
215
498
  </entry>
216
499
  </map>
@@ -223,11 +506,24 @@
223
506
  <MESSAGE value="2022-07-12-01-11" />
224
507
  <MESSAGE value="2022-07-12-01-24" />
225
508
  <MESSAGE value="2022-07-12-01-33" />
226
- <option name="LAST_COMMIT_MESSAGE" value="2022-07-12-01-33" />
509
+ <MESSAGE value="fixed no_upcase_diacritics" />
510
+ <MESSAGE value="minor fix" />
511
+ <MESSAGE value="Fixed `oxia_to_tonos` &amp; `tonos_to_oxia` and added the options of `to_tonos` &amp; `to_oxia`. Added `transliterate`." />
512
+ <MESSAGE value="2022-07-16-03-34" />
513
+ <MESSAGE value="2022-07-16-03-45" />
514
+ <MESSAGE value="2022-07-16-12-41" />
515
+ <MESSAGE value="README updated" />
516
+ <MESSAGE value="Coveralls" />
517
+ <MESSAGE value="Fix last commit" />
518
+ <MESSAGE value="codepoints, unicode/data" />
519
+ <MESSAGE value="Fixed readme" />
520
+ <option name="LAST_COMMIT_MESSAGE" value="Fixed readme" />
227
521
  </component>
228
522
  <component name="com.intellij.coverage.CoverageDataManagerImpl">
229
- <SUITE FILE_PATH="coverage/grc@test_grc_rb.rcov" NAME="test_grc.rb Coverage Results" MODIFIED="1657599843372" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="grc" />
230
523
  <SUITE FILE_PATH="coverage/grc@test_unicode_name.rcov" NAME="test_unicode_name Coverage Results" MODIFIED="1657596419433" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="grc" />
231
- <SUITE FILE_PATH="coverage/grc@grc.rcov" NAME="grc Coverage Results" MODIFIED="1657596407748" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="grc" />
524
+ <SUITE FILE_PATH="coverage/grc@test_tonos_to_oxia.rcov" NAME="test_tonos_to_oxia Coverage Results" MODIFIED="1657950558051" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="grc" />
525
+ <SUITE FILE_PATH="coverage/grc@test_oxia_to_tonos.rcov" NAME="test_oxia_to_tonos Coverage Results" MODIFIED="1657949990401" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="grc" />
526
+ <SUITE FILE_PATH="coverage/grc@grc.rcov" NAME="grc Coverage Results" MODIFIED="1658890073797" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="grc" />
527
+ <SUITE FILE_PATH="coverage/grc@test_grc_rb.rcov" NAME="test_grc.rb Coverage Results" MODIFIED="1657599843372" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="grc" />
232
528
  </component>
233
529
  </project>
data/.rubocop.yml CHANGED
@@ -11,3 +11,12 @@ Style/StringLiteralsInInterpolation:
11
11
 
12
12
  Layout/LineLength:
13
13
  Max: 480
14
+
15
+ Metrics/AbcSize:
16
+ Enabled: false
17
+
18
+ Metrics/MethodLength:
19
+ Enabled: false
20
+
21
+ Metrics/ModuleLength:
22
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -3,3 +3,22 @@
3
3
  ## [0.1.0] - 2022-07-12
4
4
 
5
5
  - Initial release
6
+
7
+ ## [0.1.1] - 2022-07-14
8
+
9
+ - Fixed `no_upcase_diacritics`, `no_downcase_diacritics` and `no_diacritics`.
10
+
11
+ ## [0.1.2] - 2022-07-14
12
+
13
+ - Minor bugfix
14
+ - Updated documentation
15
+
16
+ ## [0.1.3] - 2022-07-16
17
+
18
+ - Fixed `oxia_to_tonos` & `tonos_to_oxia`
19
+ - New shorter versions `to_tonos` & `to_oxia`.
20
+ - Added `transliterate` (experimental: please report any errors).
21
+
22
+ ## [0.1.4] - 2022-07-16
23
+
24
+ - Added `to_grave` and `to_acute`.
data/Gemfile CHANGED
@@ -16,3 +16,7 @@ gem 'unicode-name', '~> 1.10.0'
16
16
  gem 'rubocop-minitest', '~> 0.20.1'
17
17
 
18
18
  gem 'rubocop-rake', '~> 0.6.0'
19
+
20
+ gem 'unicode-data', '~> 0.1.1'
21
+
22
+ gem 'coveralls', require: false
data/README.md CHANGED
@@ -1,7 +1,11 @@
1
- # GRC - Methods for working with Ancient Greek in Ruby
2
-
3
1
  [![Ruby](https://github.com/bcdavasconcelos/grc/actions/workflows/main.yml/badge.svg)](https://github.com/bcdavasconcelos/grc/actions/workflows/main.yml) [![Gem Version](https://badge.fury.io/rb/grc.svg)](https://badge.fury.io/rb/grc)
4
2
 
3
+ <!--[![Coverage Status](https://coveralls.io/repos/github/bcdavasconcelos/grc/badge.svg?branch=Main)](https://coveralls.io/github/bcdavasconcelos/grc?branch=Main)-->
4
+
5
+ # GRC - Ancient Greek Methods for Ruby
6
+
7
+ Several problems can come up when using unicode greek characters. This gem solves some of them.
8
+
5
9
  ## Installation
6
10
 
7
11
  Install the gem and add to the application's Gemfile by executing:
@@ -14,6 +18,232 @@ If bundler is not being used to manage dependencies, install the gem by executin
14
18
 
15
19
  ## Usage
16
20
 
21
+ ```ruby
22
+ require 'grc'
23
+ ```
24
+
25
+ ## General methods
26
+
27
+ ### `grc?` (str → bool)
28
+
29
+ String contains greek letters? This method will check and return `true` or `false`.
30
+
31
+ ```ruby
32
+ irb(main):001:0> 'Μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος'.grc?
33
+ => true
34
+
35
+ irb(main):002:0> 'Greekless sentence'.grc?
36
+ => false
37
+ ```
38
+
39
+ ### `tokenize` (str → array)
40
+
41
+ This method will tokenize a string; i.e., return an array of objects such as words and punctuation marks.
42
+
43
+ ```ruby
44
+ irb(main):003:0> 'Πάντες ἄνθρωποι τοῦ εἰδέναι ὀρέγονται φύσει. σημεῖον δ᾽ ἡ τῶν αἰσθήσεων ἀγάπησις· καὶ γὰρ χωρὶς τῆς χρείας ἀγαπῶνται δι᾽ αὑτάς, καὶ μάλιστα τῶν ἄλλων ἡ διὰ τῶν ὀμμάτων.'.tokenize
45
+ => ["Πάντες", "ἄνθρωποι", "τοῦ", "εἰδέναι", "ὀρέγονται", "φύσει", ".", "σημεῖον", "δ᾽", "ἡ",
46
+ "τῶν", "αἰσθήσεων", "ἀγάπησις", "·", "καὶ", "γὰρ", "χωρὶς", "τῆς", "χρείας", "ἀγαπῶνται",
47
+ "δι᾽", "αὑτάς", ",", "καὶ", "μάλιστα", "τῶν", "ἄλλων", "ἡ", "διὰ", "τῶν", "ὀμμάτων", "."]
48
+
49
+ irb(main):004:0> 'Μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος'.tokenize
50
+ => ["Μῆνιν", "ἄειδε", "θεὰ", "Πηληϊάδεω", "Ἀχιλῆος"]
51
+ ```
52
+
53
+ ### `transliterate` (str → str)
54
+
55
+ This is highly experimental method to transliterate greek into latin letters. Users are likely to encounter bugs and edge-cases. Please, report them.
56
+
57
+ ```ruby
58
+ irb(main):005:0> 'Μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος'.transliterate
59
+ => "mēnin aeide thea pēlēiadeō achilēos"
60
+
61
+ irb(main):006:0> 'Πάντες ἄνθρωποι τοῦ εἰδέναι ὀρέγονται φύσει'.transliterate
62
+ => "pantes anthrōpoi tou eidenai oregontai physei"
63
+ ```
64
+
65
+ ## Unicode Inspection Methods
66
+
67
+ ### `unicode_points` (str → array)
68
+
69
+ This method will return an array with unicode points (the Unicode mapping) of every character in the string.
70
+
71
+ ```ruby
72
+ irb(main):008:0> 'θεὰ'.unicode_points
73
+ => ["\\u03B8", "\\u03B5", "\\u1F70"]
74
+ ```
75
+
76
+ ### `hash_dump`: (str → hash)
77
+
78
+ Same as `unicode_points`, but returns a hash. Still experimental.
79
+
80
+ ```ruby
81
+ irb(main):009:0> str.hash_dump
82
+ => {"ἄ"=>"\"\\u1F04\"", "ε"=>"\"\\u03B5\"", "ι"=>"\"\\u03B9\"", "δ"=>"\"\\u03B4\""}
83
+ ```
84
+
85
+ ### `unicode_name` (str → array)
86
+
87
+ This method will return an array with the unicode name of each character in the string.
88
+
89
+ ```ruby
90
+ irb(main):010:0> 'θεὰ'.unicode_name
91
+ => ["GREEK SMALL LETTER THETA", "GREEK SMALL LETTER EPSILON", "GREEK SMALL LETTER ALPHA WITH VARIA"]
92
+ ```
93
+
94
+ ## Unicode Normalization
95
+
96
+ Unicode Normalization is exceptionally important for Greek texts. It is used to normalize the text to a standard form, which is used by the computer to compare texts and for performing searches in a database.
97
+
98
+ ### `nfd`: Canonical Decomposition (str → str)
99
+
100
+ This methods will decompose a string into its parts using the canonical decomposition method. This is useful for preparing a string to be used in searches. It will never damage the text by performing irreparable changes: a string can be recomposed using the canonical composition at any time.
101
+
102
+ This is our test string. Pay attention to the first character.
103
+
104
+ ```ruby
105
+ irb(main):011:0> str = 'ἄνθρωπος'
106
+ => "ἄνθρωπος"
107
+ irb(main):012:0> str.unicode_name
108
+ =>
109
+ ["GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA",
110
+ "GREEK SMALL LETTER NU",
111
+ "GREEK SMALL LETTER THETA",
112
+ "GREEK SMALL LETTER RHO",
113
+ "GREEK SMALL LETTER OMEGA",
114
+ "GREEK SMALL LETTER PI",
115
+ "GREEK SMALL LETTER OMICRON",
116
+ "GREEK SMALL LETTER FINAL SIGMA"]
117
+ ```
118
+
119
+ Now, we decomposed the precomposed unicode characters.
120
+
121
+ ```ruby
122
+ irb(main):013:0> str = str.nfd
123
+ => "ἄνθρωπος"
124
+ irb(main):014:0> str.unicode_name
125
+ =>
126
+ ["GREEK SMALL LETTER ALPHA",
127
+ "COMBINING COMMA ABOVE",
128
+ "COMBINING ACUTE ACCENT",
129
+ "GREEK SMALL LETTER NU",
130
+ "GREEK SMALL LETTER THETA",
131
+ "GREEK SMALL LETTER RHO",
132
+ "GREEK SMALL LETTER OMEGA",
133
+ "GREEK SMALL LETTER PI",
134
+ "GREEK SMALL LETTER OMICRON",
135
+ "GREEK SMALL LETTER FINAL SIGMA"]
136
+ ```
137
+
138
+ Notice how `ἄ` (`GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA`) becomes `α` (`GREEK SMALL LETTER ALPHA`), `̓` (`COMBINING COMMA ABOVE`), `́` (`COMBINING ACUTE ACCENT`). If we decompose a string and then try to match a query against it, there will be no need to get the diacritics right and we'll only need the base-character.
139
+
140
+ ### `nfc` (str → str)
141
+
142
+ Using the result string from the last example, we can compose the characters back into its precomposed form. `α` (alpha), `̓` (smooth breathing), `́` (acute accent) will be composed back into a single character, that is, `ἄ` (alpha with breathing and acute accent).
143
+
144
+ ```ruby
145
+ irb(main):015:0> str = str.nfc
146
+ => "ἄνθρωπος"
147
+ irb(main):016:0> str.unicode_name
148
+ =>
149
+ ["GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA",
150
+ "GREEK SMALL LETTER NU",
151
+ "GREEK SMALL LETTER THETA",
152
+ "GREEK SMALL LETTER RHO",
153
+ "GREEK SMALL LETTER OMEGA",
154
+ "GREEK SMALL LETTER PI",
155
+ "GREEK SMALL LETTER OMICRON",
156
+ "GREEK SMALL LETTER FINAL SIGMA"]
157
+ ```
158
+
159
+ ## Diacritical marks
160
+
161
+ This is our example string for the next 3 methods.
162
+
163
+ ```ruby
164
+ irb(main):017:0> str = 'Μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος'
165
+ => "Μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος"
166
+ ```
167
+
168
+ ### `no_downcase_diacritics` (str → str)
169
+
170
+ Remove from lowercase characters.
171
+
172
+ ```ruby
173
+ irb(main):018:0> str.no_downcase_diacritics
174
+ => "Μηνιν αειδε θεα Πηληιαδεω Ἀχιληος"
175
+ ```
176
+
177
+ ### `no_upcase_diacritics` (str → str)
178
+
179
+ Remove from uppercase characters.
180
+
181
+ ```ruby
182
+ irb(main):019:0> str.no_upcase_diacritics
183
+ => "Μῆνιν ἄειδε θεὰ Πηληϊάδεω Αχιλῆος"
184
+ ```
185
+
186
+ ### `no_diacritics` (str → str)
187
+
188
+ Remove from all characters.
189
+
190
+ ```ruby
191
+ irb(main):020:0> str.no_diacritics
192
+ => "Μηνιν αειδε θεα Πηληιαδεω Αχιληος"
193
+ ```
194
+
195
+ ## Accents
196
+
197
+ ### `to_grave` (str → str)
198
+
199
+ Change the acute for a grave accent. Alternative name: `tonos_to_grave`
200
+
201
+ ```ruby
202
+ irb(main):021:0> str = str.to_grave
203
+ => "θεὰ"
204
+ ```
205
+
206
+ ### `to_acute` (str → str)
207
+
208
+ Change the grave for an acute accent. Alternative: `grave_to_acute`
209
+
210
+ ```ruby
211
+ irb(main):022:0> str = str.to_acute
212
+ => "θεά"
213
+ ```
214
+
215
+ ### `to_oxia` (str → str)
216
+
217
+ Tonos → Oxia. This should also be self-explanatory, but only if one is aware of the existence of two different types of acute accent for Greek letters in the Unicode system. If you didn't know, now you do.
218
+
219
+ The `tonos` was created when Greece adopted the monotonic system. It was considered a new kind of diacritical mark. Later, this changed and everyone agreed that it is, in fact, no different from the acute accent of polytonic greek.
220
+
221
+ When the Greek Extended Character Set was created specifically for polytonic Greek, however, another character was introduced to represent the acute accent. This character is called `oxia`.
222
+
223
+ The end result? Both characters are visually impossible to distinguish. The `tonos` is now the same as the `oxia` and the standard way to represent the acute accent when it is the only diacritical mark of the base character. Whenever you are typing, if you include other diacritics, it will automatically turn into an `oxia`. But, keep in mind that they have different code points, so one won't match against the other.
224
+
225
+ ```ruby
226
+ irb(main):023:0> str = str.to_oxia
227
+ => "θεά"
228
+
229
+ irb(main):024:0> str.unicode_name
230
+ => ["GREEK SMALL LETTER THETA", "GREEK SMALL LETTER EPSILON", "GREEK SMALL LETTER ALPHA WITH OXIA"]
231
+ ```
232
+
233
+ ### `to_tonos` (str → str)
234
+
235
+ Oxia → Tonos. If in doubt about whether to use `oxia` or `tonos`, the correct answer is `tonos`. So, use this methods to convert an `oxia` to a `tonos`, in all cases where it should be used.
236
+
237
+ ```ruby
238
+ irb(main):025:0> str = str.to_tonos
239
+ => "θεά"
240
+
241
+ irb(main):026:0> str.unicode_name
242
+ => ["GREEK SMALL LETTER THETA", "GREEK SMALL LETTER EPSILON", "GREEK SMALL LETTER ALPHA WITH TONOS"]
243
+ ```
244
+ ## See also
245
+
246
+ - [Unicode in Ruby](https://idiosyncratic-ruby.com/66-ruby-has-character.html)
17
247
 
18
248
  ## Development
19
249
 
@@ -23,7 +253,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
23
253
 
24
254
  ## Contributing
25
255
 
26
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/grc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/grc/blob/Main/CODE_OF_CONDUCT.md).
256
+ Bug reports and pull requests are welcome on GitHub at https://github.com/bcdav/grc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md).
27
257
 
28
258
  ## License
29
259
 
@@ -31,4 +261,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
31
261
 
32
262
  ## Code of Conduct
33
263
 
34
- Everyone interacting in the Grc project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/grc/blob/Main/CODE_OF_CONDUCT.md).
264
+ Everyone interacting in the Grc project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md).
data/lib/grc/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Grc
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.4'
5
5
  end
data/lib/grc.rb CHANGED
@@ -6,84 +6,249 @@ require_relative 'grc/version'
6
6
  module Grc
7
7
  class Error < StandardError; end
8
8
 
9
+ @std_error = 'ERROR: String does not contain any greek. Summon the muse and try again.'
10
+
11
+ # General methods
12
+
13
+ # `grc?` (str → bool)
14
+ # Returns true if the string contains greek characters.
9
15
  def grc?
10
16
  !scan(/(\p{Greek})/).empty?
11
17
  end
12
18
 
13
- def no_downcase_diacritics
14
- tr('ἀἄᾄἂᾂἆᾆᾀἁἅᾅἃᾃἇᾇᾁάάᾴὰᾲᾰᾶᾷᾱᾳἐἔἒἑἕἓέέὲἠἤᾔἢᾒἦᾖᾐἡἥᾕἣᾓἧᾗᾑήήῄὴῂῆῇῃἰἴἲἶἱἵἳἷίίὶῐῖϊϊΐῒῗῑὀὄὂὁὅὃόόὸῤῥὐὔὒὖὑὕὓὗύύὺῠῦϋΰΰΰῢῧῡὠὤᾤὢᾢὦᾦᾠὡὥᾥὣᾣὧᾧᾡώώῴὼῲῶῷῳ',
15
- 'ααααααααααααααααααααααααααεεεεεεεεεηηηηηηηηηηηηηηηηηηηηηηηηιιιιιιιιιιιιιιιιιιιοοοοοοοοορρυυυυυυυυυυυυυυυυυυυυωωωωωωωωωωωωωωωωωωωωωωωω')
19
+ # `tokenize` (str → array)
20
+ # Returns an array of tokens from the string.
21
+ def tokenize
22
+ gsub(/([[:punct:]]|·|·|‧|⸱|𐄁|\.|;|;)/, ' \1').split
16
23
  end
17
24
 
18
- def no_upcase_diacritics
25
+ # `transliterate` (str → str)
26
+ # Returns a string with greek characters replaced with their transliteration.
27
+ def transliterate
28
+ return @std_error unless grc?
29
+
30
+ result = []
19
31
  str = self
20
- ars = [[/[́̀͂́́́̀͂]/, ''], [/Α͂/, 'Α'], [/Η͂/, 'Η'], [/Ί|Ὶ|Ι͂|́Ι|̀Ι|͂Ι/, 'Ι'],
21
- [/Ρ̓/, 'Ρ'], [/ Ὺ| ́Υ|Υ̓|Ύ|Ὺ|Υ͂|́Υ|̀Υ|͂Υ/, 'Υ'], [/͂Ω/, 'Ω']] # Adhoc solution for crazy diacritics with capital letters
22
- ars.each do |a|
23
- str = str.gsub(/#{a[0]}/, a[1])
32
+ str.tokenize do |token|
33
+ result << if token.grc?
34
+ the_word = token.gsub(/ῥ/, 'rh')
35
+ the_word = the_word =~ /[ἁἅᾅἃᾃἇᾇᾁἑἕἓἡἥᾕἣᾓἧᾗᾑἱἵἳἷὁὅὃὑὕὓὗὡὥᾥὣᾣὧᾧᾡ]/ ? "h#{the_word.no_diacritics}" : the_word.no_diacritics
36
+ hash.each { |k, v| the_word = the_word.gsub(/#{k}/, v) }
37
+ the_word
38
+ else
39
+ word
40
+ end
24
41
  end
25
- str = str.tr('ἈἌἊἎἉἍἋἏΆᾺᾸᾹἘἜἚἙἝἛΈῈἨἬἪἮἩἭἫἯΉῊἸἼἺἾἹἽἻἿΊῚῘΪῙὈὌὊὉὍὋΌῸΡῬὙὝὛὟΎῪῨΫῩὨὬὪὮὩὭὫὯΏῺ',
26
- 'ΑΑΑΑΑΑΑΑΑΑΑΑΕΕΕΕΕΕΕΕΗΗΗΗΗΗΗΗΗΗΙΙΙΙΙΙΙΙΙΙΙΙΙΟΟΟΟΟΟΟΟΡΡΥΥΥΥΥΥΥΥΥΩΩΩΩΩΩΩΩΩΩ')
42
+ result.join(' ')
27
43
  end
28
44
 
29
- def no_diacritics
30
- no_downcase_diacritics.no_upcase_diacritics
45
+ # Unicode Inspection Methods
46
+
47
+ # `unicode_points` (str → array)
48
+ # Returns an array of unicode points from the string.
49
+ def unicode_points
50
+ unpack('U*').map { |i| "\\u#{i.to_s(16).rjust(4, "0").upcase}" }
31
51
  end
32
52
 
33
- def tonos_to_oxia
34
- tr('ΆΈΉΊΎΌΏάέήίΐύΰόώ',
35
- 'ΆΈΉΊΎΌΏάέήίΐύΰόώ')
53
+ # `hash_dump`: (str → hash)
54
+ # Returns a hash of the string's unicode points (Char: Unicode_points).
55
+ def hash_dump
56
+ hash = {}
57
+ each_char do |character|
58
+ hash[character] = character.dump
59
+ end
60
+ hash
36
61
  end
37
62
 
38
- def oxia_to_tonos
39
- tr('ΆΈΉΊΎΌΏάέήίΐύΰόώ',
40
- 'ΆΈΉΊΎΌΏάέήίΐύΰόώ')
63
+ # `unicode_name` (str → array)
64
+ # Returns an array of unicode names from the string.
65
+ def unicode_name
66
+ require 'unicode/name'
67
+ each_char.map { |character| Unicode::Name.of character }
41
68
  end
42
69
 
43
- def acute_to_grave
70
+ # Unicode Normalization
71
+
72
+ # `nfd` (str → str)
73
+ # Returns a string with the canonical decomposition of the string.
74
+ def nfd
75
+ unicode_normalize(:nfd)
76
+ end
77
+
78
+ # `nfc` (str → str)
79
+ # Returns a string with the canonical composition of the string.
80
+ def nfc
81
+ unicode_normalize(:nfc)
82
+ end
83
+
84
+ # Case folding
85
+
86
+ # `grc_downcase` (str → str)
87
+ # Returns the lowercase version of string for greek characters resolving confusable characters.
88
+ # See https://www.w3.org/TR/charmod-norm/#PreNormalization
89
+ def grc_downcase
90
+ nfd.downcase.nfc
91
+ end
92
+
93
+ # `grc_upcase` (str → str)
94
+ # Default `upcase` methods strips diacritical marks from greek characters.
95
+ # This method returns the corresponding uppercase version of string for greek characters preserving diacritical marks.
96
+ # See pages 1-7 of http://www.tlg.uci.edu/encoding/precomposed.pdf
97
+ # https://icu.unicode.org/design/case/greek-upper
98
+ def grc_upcase
99
+ case_map = {
100
+ ᾀ: 'ᾈ',
101
+ ᾁ: 'ᾉ',
102
+ ᾂ: 'ᾊ',
103
+ ᾃ: 'ᾋ',
104
+ ᾄ: 'ᾌ',
105
+ ᾅ: 'ᾍ',
106
+ ᾆ: 'ᾎ',
107
+ ᾇ: 'ᾏ',
108
+ ᾐ: 'ᾘ',
109
+ ᾑ: 'ᾙ',
110
+ ᾒ: 'ᾚ',
111
+ ᾓ: 'ᾛ',
112
+ ᾔ: 'ᾜ',
113
+ ᾕ: 'ᾝ',
114
+ ᾖ: 'ᾞ',
115
+ ᾗ: 'ᾟ',
116
+ ᾠ: 'ᾨ',
117
+ ᾡ: 'ᾩ',
118
+ ᾢ: 'ᾪ',
119
+ ᾣ: 'ᾫ',
120
+ ᾤ: 'ᾬ',
121
+ ᾥ: 'ᾭ',
122
+ ᾦ: 'ᾮ',
123
+ ᾧ: 'ᾯ',
124
+ ᾳ: 'ᾼ',
125
+ ῃ: 'ῌ',
126
+ ῳ: 'ῼ'
127
+ }
128
+
129
+ nfc.each_char.map do |char|
130
+ if char.grc?
131
+ case_map[:"#{char}"] || char.upcase
132
+ else
133
+ char
134
+ end
135
+ end.join
136
+ end
137
+
138
+ # Diacritical marks
139
+
140
+ # `no_downcase_diacritics` (str → str)
141
+ # Returns a string with the diacritics removed from lowercase characters.
142
+ def no_downcase_diacritics
143
+ return @std_error unless grc?
144
+
145
+ each_char.map do |char| # Loop through each character
146
+ if char.grc? && char.lower? # If character is greek and lowercase
147
+ char.nfd.gsub(/\p{Mn}/, '').nfc # decompose, remove non-spacing markers (diacritics), recompose and return
148
+ else # else
149
+ char # return char
150
+ end
151
+ end.join # end char loop
152
+ end
153
+
154
+ # `no_upcase_diacritics` (str → str)
155
+ # Returns a string with the diacritics removed from uppercase characters.
156
+ def no_upcase_diacritics
157
+ return @std_error unless grc?
158
+
159
+ each_char.map do |char| # Loop through each character
160
+ if char.grc? && char.upper? # If character is greek and uppercase
161
+ char.nfd.gsub(/\p{Mn}/, '').nfc # Decompose, remove non-spacing markers (diacritics), recompose and return
162
+ else # else
163
+ char # Return char
164
+ end
165
+ end.join
166
+ end
167
+
168
+ # `no_diacritics` (str → str)
169
+ # Returns a string with the diacritics removed.
170
+ def no_diacritics
171
+ return @std_error unless grc?
172
+
173
+ no_downcase_diacritics.no_upcase_diacritics
174
+ end
175
+
176
+ # Accents
177
+
178
+ # `to_grave` (str → str)
179
+ # Returns a string with the grave replacing the acute accent.
180
+ def to_grave
181
+ return @std_error unless grc?
182
+
183
+ # Simple transform method with grave to acute mapping
44
184
  tr('ἄᾄἅᾅάάᾴἔἕέέἤᾔἥᾕήήῄἴἵίίΐὄὅόόὔὕύύΰΰὤᾤὥᾥώῴ',
45
185
  'ἂᾂἃᾃὰὰᾲἒἓὲὲἢᾒἣᾓὴὴῂἲἳὶὶῒὂὃὸὸὒὓὺὺῢῢὢᾢὣᾣὼῲ')
46
186
  end
47
187
 
48
- def grave_to_acute
188
+ # `to_acute` (str → str)
189
+ # Returns a string with the acute replacing the grave accent.
190
+ def to_acute
191
+ return @std_error unless grc?
192
+
193
+ # Simple transform method with acute to grave mapping
49
194
  tr('ἂᾂἃᾃὰὰᾲἒἓὲὲἢᾒἣᾓὴὴῂἲἳὶὶῒὂὃὸὸὒὓὺὺῢῢὢᾢὣᾣὼῲ',
50
195
  'ἄᾄἅᾅάάᾴἔἕέέἤᾔἥᾕήήῄἴἵίίΐὄὅόόὔὕύύΰΰὤᾤὥᾥώῴ')
51
196
  end
52
197
 
53
- def tokenize
54
- gsub(/([[:punct:]]|·|·|‧|⸱|𐄁|\.|;|;)/, ' \1').split
198
+ # `to_oxia` (str → str)
199
+ # Returns a string with the oxia replacing the tonos.
200
+ def to_oxia
201
+ return @std_error unless grc?
202
+
203
+ tr('άΆέΈήΉίΊΐόΌύΎΰώΏ',
204
+ 'άΆέΈήΉίΊΐόΌύΎΰώΏ')
55
205
  end
56
206
 
57
- def unicode_char
58
- each_char.map(&:to_s)
207
+ # `to_tonos` (str → str)
208
+ # Returns a string with the tonos replacing the oxia.
209
+ # See page 9 of http://www.tlg.uci.edu/encoding/precomposed.pdf
210
+ def to_tonos
211
+ return @std_error unless grc?
212
+
213
+ tr('άΆέΈήΉίΊΐόΌύΎΰώΏ',
214
+ 'άΆέΈήΉίΊΐόΌύΎΰώΏ')
59
215
  end
60
216
 
61
- def unicode_name
62
- require 'unicode/name'
63
- each_char.map { |character| Unicode::Name.of character }
217
+ def upper?
218
+ !!match(/\p{Upper}/)
64
219
  end
65
220
 
66
- def unicode_points
67
- unpack('U*').map { |i| "\\u#{i.to_s(16).rjust(4, "0").upcase}" }
221
+ def lower?
222
+ !!match(/\p{Lower}/)
68
223
  end
69
224
 
70
- def hash_dump
71
- hash = {}
72
- each_char do |character|
73
- hash[character] = character.dump
74
- end
75
- hash
225
+ def oxia_to_tonos
226
+ return @std_error unless grc?
227
+
228
+ to_tonos
76
229
  end
77
230
 
78
- def nfc
79
- unicode_normalize(:nfc)
231
+ def tonos_to_oxia
232
+ return @std_error unless grc?
233
+
234
+ to_oxia
80
235
  end
81
236
 
82
- def nfd
83
- unicode_normalize(:nfd)
237
+ def grave_to_acute
238
+ return @std_error unless grc?
239
+
240
+ to_acute
241
+ end
242
+
243
+ def acute_to_grave
244
+ return @std_error unless grc?
245
+
246
+ to_grave
84
247
  end
248
+
85
249
  end
86
250
 
251
+
87
252
  class String
88
253
  include Grc
89
- end
254
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernardo C.D.A. Vasconcelos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-14 00:00:00.000000000 Z
11
+ date: 2022-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -67,7 +67,6 @@ files:
67
67
  - CHANGELOG.md
68
68
  - CODE_OF_CONDUCT.md
69
69
  - Gemfile
70
- - Gemfile.lock
71
70
  - LICENSE.txt
72
71
  - README.md
73
72
  - Rakefile
@@ -96,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
95
  - !ruby/object:Gem::Version
97
96
  version: '0'
98
97
  requirements: []
99
- rubygems_version: 3.3.17
98
+ rubygems_version: 3.3.22
100
99
  signing_key:
101
100
  specification_version: 4
102
101
  summary: Methods in Ruby for working with Ancient Greek
data/Gemfile.lock DELETED
@@ -1,57 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- grc (0.1.1)
5
- minitest (~> 5.0)
6
- rake (~> 13.0)
7
- unicode-name (~> 1.10.0)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- ast (2.4.2)
13
- json (2.6.2)
14
- minitest (5.16.2)
15
- parallel (1.22.1)
16
- parser (3.1.2.0)
17
- ast (~> 2.4.1)
18
- rainbow (3.1.1)
19
- rake (13.0.6)
20
- regexp_parser (2.5.0)
21
- rexml (3.2.5)
22
- rubocop (1.31.2)
23
- json (~> 2.3)
24
- parallel (~> 1.10)
25
- parser (>= 3.1.0.0)
26
- rainbow (>= 2.2.2, < 4.0)
27
- regexp_parser (>= 1.8, < 3.0)
28
- rexml (>= 3.2.5, < 4.0)
29
- rubocop-ast (>= 1.18.0, < 2.0)
30
- ruby-progressbar (~> 1.7)
31
- unicode-display_width (>= 1.4.0, < 3.0)
32
- rubocop-ast (1.19.1)
33
- parser (>= 3.1.1.0)
34
- rubocop-minitest (0.20.1)
35
- rubocop (>= 0.90, < 2.0)
36
- rubocop-rake (0.6.0)
37
- rubocop (~> 1.0)
38
- ruby-progressbar (1.11.0)
39
- unicode-display_width (2.2.0)
40
- unicode-name (1.10.0)
41
- unicode-types (~> 1.7)
42
- unicode-types (1.7.0)
43
-
44
- PLATFORMS
45
- arm64-darwin-21
46
-
47
- DEPENDENCIES
48
- grc!
49
- minitest (~> 5.0)
50
- rake (~> 13.0)
51
- rubocop (~> 1.21)
52
- rubocop-minitest (~> 0.20.1)
53
- rubocop-rake (~> 0.6.0)
54
- unicode-name (~> 1.10.0)
55
-
56
- BUNDLED WITH
57
- 2.3.17