linguadata 0.1.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 +7 -0
- data/.idea/.gitignore +8 -0
- data/.idea/copyright/profiles_settings.xml +12 -0
- data/.idea/inspectionProfiles/Project_Default.xml +9 -0
- data/.idea/linguadata.iml +100 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vcs.xml +6 -0
- data/.rspec +3 -0
- data/.standard.yml +0 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +134 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +14 -0
- data/Steepfile +21 -0
- data/lib/linguadata/version.rb +6 -0
- data/lib/linguadata.rb +99 -0
- data/linguadata.gemspec +39 -0
- data/sig/linguadata.rbs +99 -0
- metadata +68 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: aee10a6dc55a1876434e26a5ce69a31f0aa2af115e695119c24725b0be5d7bd4
|
|
4
|
+
data.tar.gz: ef7ca5fc1601445335b0d96e2728901e484d481705ac753b1a61f12de70bc69b
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 142baa27ab1b10eeb5ff881fc6fe19b9da083eca4a7b6fc59b825de562dff0622a726b5382123930b4bb437b2b8e8577a4c288afec765a1cd437288c023fd89a
|
|
7
|
+
data.tar.gz: 54159013543920cf8a3245ff2805b61605b4fd6f458d9cfb7eb8777fc79f508c4eb647111f2a2f22a9788ccac6937e8ef8e14dc05b5b2cd88e05c881960b578e
|
data/.idea/.gitignore
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<component name="CopyrightManager">
|
|
2
|
+
<settings>
|
|
3
|
+
<LanguageOptions name="RBS">
|
|
4
|
+
<option name="block" value="false" />
|
|
5
|
+
<option name="prefixLines" value="false" />
|
|
6
|
+
</LanguageOptions>
|
|
7
|
+
<LanguageOptions name="Ruby">
|
|
8
|
+
<option name="block" value="false" />
|
|
9
|
+
<option name="prefixLines" value="false" />
|
|
10
|
+
</LanguageOptions>
|
|
11
|
+
</settings>
|
|
12
|
+
</component>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="Rubocop" enabled="true" level="WARNING" enabled_by_default="true">
|
|
5
|
+
<option name="myUseStandardGemIfPossible" value="true" />
|
|
6
|
+
<option name="myRunRubocopOnSave" value="true" />
|
|
7
|
+
</inspection_tool>
|
|
8
|
+
</profile>
|
|
9
|
+
</component>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
|
4
|
+
<shared />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="NewModuleRootManager">
|
|
7
|
+
<content url="file://$MODULE_DIR$">
|
|
8
|
+
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
|
9
|
+
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
|
10
|
+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
|
11
|
+
</content>
|
|
12
|
+
<orderEntry type="jdk" jdkName="rbenv: 3.2.2" jdkType="RUBY_SDK" />
|
|
13
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="activesupport (v7.1.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, rbenv: 3.2.2) [gem]" level="application" />
|
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="bigdecimal (v3.1.4, rbenv: 3.2.2) [gem]" level="application" />
|
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.10, rbenv: 3.2.2) [gem]" level="application" />
|
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.2.2, rbenv: 3.2.2) [gem]" level="application" />
|
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="connection_pool (v2.4.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="csv (v3.2.7, rbenv: 3.2.2) [gem]" level="application" />
|
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.0, rbenv: 3.2.2) [gem]" level="application" />
|
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="drb (v2.1.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="ffi (v1.16.3, rbenv: 3.2.2) [gem]" level="application" />
|
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="fileutils (v1.7.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="i18n (v1.14.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="json (v2.6.3, rbenv: 3.2.2) [gem]" level="application" />
|
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="language_server-protocol (v3.17.0.3, rbenv: 3.2.2) [gem]" level="application" />
|
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="lint_roller (v1.1.0, rbenv: 3.2.2) [gem]" level="application" />
|
|
29
|
+
<orderEntry type="library" scope="PROVIDED" name="listen (v3.8.0, rbenv: 3.2.2) [gem]" level="application" />
|
|
30
|
+
<orderEntry type="library" scope="PROVIDED" name="logger (v1.5.3, rbenv: 3.2.2) [gem]" level="application" />
|
|
31
|
+
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.20.0, rbenv: 3.2.2) [gem]" level="application" />
|
|
32
|
+
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.23.0, rbenv: 3.2.2) [gem]" level="application" />
|
|
33
|
+
<orderEntry type="library" scope="PROVIDED" name="parser (v3.2.2.4, rbenv: 3.2.2) [gem]" level="application" />
|
|
34
|
+
<orderEntry type="library" scope="PROVIDED" name="racc (v1.7.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
35
|
+
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
36
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, rbenv: 3.2.2) [gem]" level="application" />
|
|
37
|
+
<orderEntry type="library" scope="PROVIDED" name="rb-fsevent (v0.11.2, rbenv: 3.2.2) [gem]" level="application" />
|
|
38
|
+
<orderEntry type="library" scope="PROVIDED" name="rb-inotify (v0.10.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
39
|
+
<orderEntry type="library" scope="PROVIDED" name="rbs (v3.2.2, rbenv: 3.2.2) [gem]" level="application" />
|
|
40
|
+
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.8.2, rbenv: 3.2.2) [gem]" level="application" />
|
|
41
|
+
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.6, rbenv: 3.2.2) [gem]" level="application" />
|
|
42
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.12.0, rbenv: 3.2.2) [gem]" level="application" />
|
|
43
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.12.2, rbenv: 3.2.2) [gem]" level="application" />
|
|
44
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.12.3, rbenv: 3.2.2) [gem]" level="application" />
|
|
45
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.12.6, rbenv: 3.2.2) [gem]" level="application" />
|
|
46
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.12.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
47
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop (v1.56.4, rbenv: 3.2.2) [gem]" level="application" />
|
|
48
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.29.0, rbenv: 3.2.2) [gem]" level="application" />
|
|
49
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-performance (v1.19.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
50
|
+
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.13.0, rbenv: 3.2.2) [gem]" level="application" />
|
|
51
|
+
<orderEntry type="library" scope="PROVIDED" name="standard (v1.31.2, rbenv: 3.2.2) [gem]" level="application" />
|
|
52
|
+
<orderEntry type="library" scope="PROVIDED" name="standard-custom (v1.0.2, rbenv: 3.2.2) [gem]" level="application" />
|
|
53
|
+
<orderEntry type="library" scope="PROVIDED" name="standard-performance (v1.2.1, rbenv: 3.2.2) [gem]" level="application" />
|
|
54
|
+
<orderEntry type="library" scope="PROVIDED" name="steep (v1.5.3, rbenv: 3.2.2) [gem]" level="application" />
|
|
55
|
+
<orderEntry type="library" scope="PROVIDED" name="strscan (v3.0.7, rbenv: 3.2.2) [gem]" level="application" />
|
|
56
|
+
<orderEntry type="library" scope="PROVIDED" name="terminal-table (v3.0.2, rbenv: 3.2.2) [gem]" level="application" />
|
|
57
|
+
<orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.6, rbenv: 3.2.2) [gem]" level="application" />
|
|
58
|
+
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.5.0, rbenv: 3.2.2) [gem]" level="application" />
|
|
59
|
+
</component>
|
|
60
|
+
<component name="RakeTasksCache">
|
|
61
|
+
<option name="myRootTask">
|
|
62
|
+
<RakeTaskImpl id="rake">
|
|
63
|
+
<subtasks>
|
|
64
|
+
<RakeTaskImpl description="Build linguadata-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
|
|
65
|
+
<RakeTaskImpl id="build">
|
|
66
|
+
<subtasks>
|
|
67
|
+
<RakeTaskImpl description="Generate SHA512 checksum if linguadata-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
|
68
|
+
</subtasks>
|
|
69
|
+
</RakeTaskImpl>
|
|
70
|
+
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
|
71
|
+
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
|
72
|
+
<RakeTaskImpl description="Build and install linguadata-0.1.0.gem into system gems" fullCommand="install" id="install" />
|
|
73
|
+
<RakeTaskImpl id="install">
|
|
74
|
+
<subtasks>
|
|
75
|
+
<RakeTaskImpl description="Build and install linguadata-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
|
|
76
|
+
</subtasks>
|
|
77
|
+
</RakeTaskImpl>
|
|
78
|
+
<RakeTaskImpl description="Create tag v0.1.0 and build and push linguadata-0.1.0.gem to TODO: Set to your gem server 'https://example.com'" fullCommand="release[remote]" id="release[remote]" />
|
|
79
|
+
<RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
|
|
80
|
+
<RakeTaskImpl description="Lint with the Standard Ruby style guide" fullCommand="standard" id="standard" />
|
|
81
|
+
<RakeTaskImpl id="standard">
|
|
82
|
+
<subtasks>
|
|
83
|
+
<RakeTaskImpl description="Lint and automatically make safe fixes with the Standard Ruby style guide" fullCommand="standard:fix" id="fix" />
|
|
84
|
+
<RakeTaskImpl description="Lint and automatically make fixes (even unsafe ones" fullCommand="standard:fix_unsafely" id="fix_unsafely" />
|
|
85
|
+
</subtasks>
|
|
86
|
+
</RakeTaskImpl>
|
|
87
|
+
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
|
88
|
+
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
|
89
|
+
<RakeTaskImpl id="release">
|
|
90
|
+
<subtasks>
|
|
91
|
+
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
|
92
|
+
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
|
93
|
+
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
|
94
|
+
</subtasks>
|
|
95
|
+
</RakeTaskImpl>
|
|
96
|
+
</subtasks>
|
|
97
|
+
</RakeTaskImpl>
|
|
98
|
+
</option>
|
|
99
|
+
</component>
|
|
100
|
+
</module>
|
data/.idea/modules.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/linguadata.iml" filepath="$PROJECT_DIR$/.idea/linguadata.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
data/.idea/vcs.xml
ADDED
data/.rspec
ADDED
data/.standard.yml
ADDED
|
File without changes
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
22
|
+
advances of any kind
|
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
24
|
+
* Public or private harassment
|
|
25
|
+
* Publishing others' private information, such as a physical or email
|
|
26
|
+
address, without their explicit permission
|
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
28
|
+
professional setting
|
|
29
|
+
|
|
30
|
+
## Enforcement Responsibilities
|
|
31
|
+
|
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
33
|
+
|
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
35
|
+
|
|
36
|
+
## Scope
|
|
37
|
+
|
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
39
|
+
|
|
40
|
+
## Enforcement
|
|
41
|
+
|
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at danny.pechersky@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
|
43
|
+
|
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
45
|
+
|
|
46
|
+
## Enforcement Guidelines
|
|
47
|
+
|
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
49
|
+
|
|
50
|
+
### 1. Correction
|
|
51
|
+
|
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
53
|
+
|
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
55
|
+
|
|
56
|
+
### 2. Warning
|
|
57
|
+
|
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
59
|
+
|
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
61
|
+
|
|
62
|
+
### 3. Temporary Ban
|
|
63
|
+
|
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
65
|
+
|
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
67
|
+
|
|
68
|
+
### 4. Permanent Ban
|
|
69
|
+
|
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
71
|
+
|
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
73
|
+
|
|
74
|
+
## Attribution
|
|
75
|
+
|
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
78
|
+
|
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
|
80
|
+
|
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
|
82
|
+
|
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
linguadata (0.1.0)
|
|
5
|
+
|
|
6
|
+
GEM
|
|
7
|
+
remote: https://rubygems.org/
|
|
8
|
+
specs:
|
|
9
|
+
activesupport (7.1.1)
|
|
10
|
+
base64
|
|
11
|
+
bigdecimal
|
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
13
|
+
connection_pool (>= 2.2.5)
|
|
14
|
+
drb
|
|
15
|
+
i18n (>= 1.6, < 2)
|
|
16
|
+
minitest (>= 5.1)
|
|
17
|
+
mutex_m
|
|
18
|
+
tzinfo (~> 2.0)
|
|
19
|
+
ast (2.4.2)
|
|
20
|
+
base64 (0.1.1)
|
|
21
|
+
bigdecimal (3.1.4)
|
|
22
|
+
concurrent-ruby (1.2.2)
|
|
23
|
+
connection_pool (2.4.1)
|
|
24
|
+
csv (3.2.7)
|
|
25
|
+
diff-lcs (1.5.0)
|
|
26
|
+
drb (2.1.1)
|
|
27
|
+
ruby2_keywords
|
|
28
|
+
ffi (1.16.3)
|
|
29
|
+
fileutils (1.7.1)
|
|
30
|
+
i18n (1.14.1)
|
|
31
|
+
concurrent-ruby (~> 1.0)
|
|
32
|
+
json (2.6.3)
|
|
33
|
+
language_server-protocol (3.17.0.3)
|
|
34
|
+
lint_roller (1.1.0)
|
|
35
|
+
listen (3.8.0)
|
|
36
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
37
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
|
38
|
+
logger (1.5.3)
|
|
39
|
+
minitest (5.20.0)
|
|
40
|
+
mutex_m (0.1.2)
|
|
41
|
+
parallel (1.23.0)
|
|
42
|
+
parser (3.2.2.4)
|
|
43
|
+
ast (~> 2.4.1)
|
|
44
|
+
racc
|
|
45
|
+
racc (1.7.1)
|
|
46
|
+
rainbow (3.1.1)
|
|
47
|
+
rake (13.0.6)
|
|
48
|
+
rb-fsevent (0.11.2)
|
|
49
|
+
rb-inotify (0.10.1)
|
|
50
|
+
ffi (~> 1.0)
|
|
51
|
+
rbs (3.2.2)
|
|
52
|
+
regexp_parser (2.8.2)
|
|
53
|
+
rexml (3.2.6)
|
|
54
|
+
rspec (3.12.0)
|
|
55
|
+
rspec-core (~> 3.12.0)
|
|
56
|
+
rspec-expectations (~> 3.12.0)
|
|
57
|
+
rspec-mocks (~> 3.12.0)
|
|
58
|
+
rspec-core (3.12.2)
|
|
59
|
+
rspec-support (~> 3.12.0)
|
|
60
|
+
rspec-expectations (3.12.3)
|
|
61
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
62
|
+
rspec-support (~> 3.12.0)
|
|
63
|
+
rspec-mocks (3.12.6)
|
|
64
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
65
|
+
rspec-support (~> 3.12.0)
|
|
66
|
+
rspec-support (3.12.1)
|
|
67
|
+
rubocop (1.56.4)
|
|
68
|
+
base64 (~> 0.1.1)
|
|
69
|
+
json (~> 2.3)
|
|
70
|
+
language_server-protocol (>= 3.17.0)
|
|
71
|
+
parallel (~> 1.10)
|
|
72
|
+
parser (>= 3.2.2.3)
|
|
73
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
74
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
75
|
+
rexml (>= 3.2.5, < 4.0)
|
|
76
|
+
rubocop-ast (>= 1.28.1, < 2.0)
|
|
77
|
+
ruby-progressbar (~> 1.7)
|
|
78
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
79
|
+
rubocop-ast (1.29.0)
|
|
80
|
+
parser (>= 3.2.1.0)
|
|
81
|
+
rubocop-performance (1.19.1)
|
|
82
|
+
rubocop (>= 1.7.0, < 2.0)
|
|
83
|
+
rubocop-ast (>= 0.4.0)
|
|
84
|
+
ruby-progressbar (1.13.0)
|
|
85
|
+
ruby2_keywords (0.0.5)
|
|
86
|
+
securerandom (0.2.2)
|
|
87
|
+
standard (1.31.2)
|
|
88
|
+
language_server-protocol (~> 3.17.0.2)
|
|
89
|
+
lint_roller (~> 1.0)
|
|
90
|
+
rubocop (~> 1.56.4)
|
|
91
|
+
standard-custom (~> 1.0.0)
|
|
92
|
+
standard-performance (~> 1.2)
|
|
93
|
+
standard-custom (1.0.2)
|
|
94
|
+
lint_roller (~> 1.0)
|
|
95
|
+
rubocop (~> 1.50)
|
|
96
|
+
standard-performance (1.2.1)
|
|
97
|
+
lint_roller (~> 1.1)
|
|
98
|
+
rubocop-performance (~> 1.19.1)
|
|
99
|
+
steep (1.5.3)
|
|
100
|
+
activesupport (>= 5.1)
|
|
101
|
+
concurrent-ruby (>= 1.1.10)
|
|
102
|
+
csv (>= 3.0.9)
|
|
103
|
+
fileutils (>= 1.1.0)
|
|
104
|
+
json (>= 2.1.0)
|
|
105
|
+
language_server-protocol (>= 3.15, < 4.0)
|
|
106
|
+
listen (~> 3.0)
|
|
107
|
+
logger (>= 1.3.0)
|
|
108
|
+
parser (>= 3.1)
|
|
109
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
110
|
+
rbs (>= 3.1.0)
|
|
111
|
+
securerandom (>= 0.1)
|
|
112
|
+
strscan (>= 1.0.0)
|
|
113
|
+
terminal-table (>= 2, < 4)
|
|
114
|
+
strscan (3.0.7)
|
|
115
|
+
terminal-table (3.0.2)
|
|
116
|
+
unicode-display_width (>= 1.1.1, < 3)
|
|
117
|
+
tzinfo (2.0.6)
|
|
118
|
+
concurrent-ruby (~> 1.0)
|
|
119
|
+
unicode-display_width (2.5.0)
|
|
120
|
+
|
|
121
|
+
PLATFORMS
|
|
122
|
+
arm64-darwin-23
|
|
123
|
+
x86_64-linux
|
|
124
|
+
|
|
125
|
+
DEPENDENCIES
|
|
126
|
+
linguadata!
|
|
127
|
+
rake
|
|
128
|
+
rbs
|
|
129
|
+
rspec
|
|
130
|
+
standard
|
|
131
|
+
steep
|
|
132
|
+
|
|
133
|
+
BUNDLED WITH
|
|
134
|
+
2.4.10
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Daniel Pechersky
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Linguadata
|
|
2
|
+
|
|
3
|
+
Rust's `Result` and `Option` types for Ruby. Properly type annotated.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the gem and add to the application's Gemfile by executing:
|
|
8
|
+
|
|
9
|
+
$ bundle add linguadata
|
|
10
|
+
|
|
11
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
|
12
|
+
|
|
13
|
+
$ gem install linguadata
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
TODO: Write usage instructions here
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can
|
|
22
|
+
also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
23
|
+
|
|
24
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
|
|
25
|
+
version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
|
|
26
|
+
push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
27
|
+
|
|
28
|
+
## Contributing
|
|
29
|
+
|
|
30
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/DanielPechersky/linguadata. This project is
|
|
31
|
+
intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
|
|
32
|
+
the [code of conduct](https://github.com/DanielPechersky/linguadata/blob/main/CODE_OF_CONDUCT.md).
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
37
|
+
|
|
38
|
+
## Code of Conduct
|
|
39
|
+
|
|
40
|
+
Everyone interacting in the Linguadata project's codebases, issue trackers, chat rooms and mailing lists is expected to
|
|
41
|
+
follow the [code of conduct](https://github.com/[USERNAME]/linguadata/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/Steepfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
D = Steep::Diagnostic
|
|
2
|
+
|
|
3
|
+
target :lib do
|
|
4
|
+
signature "sig"
|
|
5
|
+
|
|
6
|
+
check "lib" # Directory name
|
|
7
|
+
# check "Gemfile" # File name
|
|
8
|
+
|
|
9
|
+
# library "pathname", "set" # Standard libraries
|
|
10
|
+
# library "strong_json" # Gems
|
|
11
|
+
|
|
12
|
+
configure_code_diagnostics(D::Ruby.strict)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# target :test do
|
|
16
|
+
# signature "sig", "sig-private"
|
|
17
|
+
#
|
|
18
|
+
# check "test"
|
|
19
|
+
#
|
|
20
|
+
# # library "pathname", "set" # Standard libraries
|
|
21
|
+
# end
|
data/lib/linguadata.rb
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# typed: strict
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require_relative "linguadata/version"
|
|
5
|
+
|
|
6
|
+
module Linguadata
|
|
7
|
+
module Option
|
|
8
|
+
class Some < Data.define(:value)
|
|
9
|
+
def unwrap = value
|
|
10
|
+
|
|
11
|
+
def map(&block) = Some[block.call(value)]
|
|
12
|
+
|
|
13
|
+
def some? = true
|
|
14
|
+
|
|
15
|
+
def none? = false
|
|
16
|
+
|
|
17
|
+
def unwrap_or_else(&_block) = value
|
|
18
|
+
|
|
19
|
+
def unwrap_or(_other) = value
|
|
20
|
+
|
|
21
|
+
def and_then(&block) = block.call(value)
|
|
22
|
+
|
|
23
|
+
def filter(&block)
|
|
24
|
+
if block.call(value)
|
|
25
|
+
self
|
|
26
|
+
else
|
|
27
|
+
None[]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class None < Data.define
|
|
33
|
+
def value = raise "Cannot get value from None"
|
|
34
|
+
|
|
35
|
+
def unwrap = value
|
|
36
|
+
|
|
37
|
+
def map(&_block) = self
|
|
38
|
+
|
|
39
|
+
def some? = false
|
|
40
|
+
|
|
41
|
+
def none? = true
|
|
42
|
+
|
|
43
|
+
def unwrap_or_else(&block) = block.call
|
|
44
|
+
|
|
45
|
+
def unwrap_or(other) = other
|
|
46
|
+
|
|
47
|
+
def and_then(&_block) = self
|
|
48
|
+
|
|
49
|
+
def filter(&_block) = self
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def from_nillable(value)
|
|
53
|
+
case value
|
|
54
|
+
in nil
|
|
55
|
+
None[]
|
|
56
|
+
else
|
|
57
|
+
Some[value]
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
module Result
|
|
63
|
+
class Success < Data.define(:value)
|
|
64
|
+
def error = raise "Cannot get error from Success"
|
|
65
|
+
|
|
66
|
+
def unwrap = value
|
|
67
|
+
|
|
68
|
+
def unwrap_failure = error
|
|
69
|
+
|
|
70
|
+
def success = Option::Some[value]
|
|
71
|
+
|
|
72
|
+
def failure = Option::None[]
|
|
73
|
+
|
|
74
|
+
def map(&block) = Success[block.call(value)]
|
|
75
|
+
|
|
76
|
+
def map_failure(&_block) = self
|
|
77
|
+
|
|
78
|
+
def and_then(&block) = block.call(value)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
class Failure < Data.define(:error)
|
|
82
|
+
def value = raise "Cannot get value from Failure"
|
|
83
|
+
|
|
84
|
+
def unwrap = value
|
|
85
|
+
|
|
86
|
+
def unwrap_failure = error
|
|
87
|
+
|
|
88
|
+
def success = Option::None[]
|
|
89
|
+
|
|
90
|
+
def failure = Option::Some[error]
|
|
91
|
+
|
|
92
|
+
def map(&_block) = self
|
|
93
|
+
|
|
94
|
+
def map_failure(&block) = Failure[block.call(error)]
|
|
95
|
+
|
|
96
|
+
def and_then(&_block) = self
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
data/linguadata.gemspec
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/linguadata/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "linguadata"
|
|
7
|
+
spec.version = Linguadata::VERSION
|
|
8
|
+
spec.authors = ["Daniel Pechersky"]
|
|
9
|
+
spec.email = ["danny.pechersky@gmail.com"]
|
|
10
|
+
|
|
11
|
+
spec.summary = "Result and Option types in Ruby, inspired by Rust"
|
|
12
|
+
spec.description = "Bringing Rust's Result and Option types to Ruby, using the Data class introduced in Ruby 3.2"
|
|
13
|
+
spec.homepage = "https://github.com/DanielPechersky/linguadata"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
spec.required_ruby_version = ">= 3.2.0"
|
|
16
|
+
|
|
17
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
|
18
|
+
|
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
20
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
|
21
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/CHANGELOG.md"
|
|
22
|
+
|
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
25
|
+
spec.files = Dir.chdir(__dir__) do
|
|
26
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
|
27
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
spec.bindir = "exe"
|
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
32
|
+
spec.require_paths = ["lib"]
|
|
33
|
+
|
|
34
|
+
# Uncomment to register a new dependency of your gem
|
|
35
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
|
36
|
+
|
|
37
|
+
# For more information and examples about making a new gem, check out our
|
|
38
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
|
39
|
+
end
|
data/sig/linguadata.rbs
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
module Linguadata
|
|
2
|
+
VERSION: String
|
|
3
|
+
|
|
4
|
+
module DataHelpers
|
|
5
|
+
class ZeroItemData < Data
|
|
6
|
+
def self.new: () -> instance
|
|
7
|
+
|
|
8
|
+
def self.[]: () -> instance
|
|
9
|
+
|
|
10
|
+
def deconstruct: () -> [ ]
|
|
11
|
+
|
|
12
|
+
def deconstruct_keys: (?Array[Symbol]?) -> { }
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class OneItemData[T] < Data
|
|
16
|
+
def deconstruct: () -> [T]
|
|
17
|
+
|
|
18
|
+
def deconstruct_keys: (?Array[Symbol]?) -> { Symbol: T }
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
module Option
|
|
23
|
+
type option[T] = Some[T] | None
|
|
24
|
+
|
|
25
|
+
class Some[T] < DataHelpers::OneItemData[T]
|
|
26
|
+
include _Option[T]
|
|
27
|
+
|
|
28
|
+
def self.new: [T] (T) -> Some[T]
|
|
29
|
+
|
|
30
|
+
def self.[]: [T] (T) -> Some[T]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class None < DataHelpers::ZeroItemData
|
|
34
|
+
include _Option[bot]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
interface _Option[T]
|
|
38
|
+
def value: () -> T
|
|
39
|
+
|
|
40
|
+
def unwrap: () -> T
|
|
41
|
+
|
|
42
|
+
def some?: () -> bool
|
|
43
|
+
|
|
44
|
+
def none?: () -> bool
|
|
45
|
+
|
|
46
|
+
def map: [U] { (T) -> U } -> option[U]
|
|
47
|
+
|
|
48
|
+
def unwrap_or: [U] (U) -> (T | U)
|
|
49
|
+
|
|
50
|
+
def unwrap_or_else: [U] { () -> U } -> (T | U)
|
|
51
|
+
|
|
52
|
+
def and_then: [U] { (T) -> option[U] } -> option[U]
|
|
53
|
+
|
|
54
|
+
def filter: { (T) -> bool } -> option[T]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def from_nillable: [T] (T? value) -> option[T]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
module Result
|
|
61
|
+
type result[T, E] = Success[T] | Failure[E]
|
|
62
|
+
|
|
63
|
+
class Success[T] < DataHelpers::OneItemData[T]
|
|
64
|
+
include _Result[T, bot]
|
|
65
|
+
|
|
66
|
+
def self.new: [T] (T) -> Success[T]
|
|
67
|
+
|
|
68
|
+
def self.[]: [T] (T) -> Success[T]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
class Failure[E] < DataHelpers::OneItemData[E]
|
|
72
|
+
include _Result[bot, E]
|
|
73
|
+
|
|
74
|
+
def self.new: [E] (E) -> Failure[E]
|
|
75
|
+
|
|
76
|
+
def self.[]: [E] (E) -> Failure[E]
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
interface _Result[T, E]
|
|
80
|
+
def value: () -> T
|
|
81
|
+
|
|
82
|
+
def error: () -> E
|
|
83
|
+
|
|
84
|
+
def unwrap: () -> T
|
|
85
|
+
|
|
86
|
+
def unwrap_failure: () -> E
|
|
87
|
+
|
|
88
|
+
def success: () -> Option::option[T]
|
|
89
|
+
|
|
90
|
+
def failure: () -> Option::option[E]
|
|
91
|
+
|
|
92
|
+
def map: [U] { (T) -> U } -> result[U, E]
|
|
93
|
+
|
|
94
|
+
def map_failure: [F] { (E) -> F } -> result[T, F]
|
|
95
|
+
|
|
96
|
+
def and_then: [U] { (T) -> result[U, E] } -> result[U, E]
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: linguadata
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Daniel Pechersky
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2023-10-24 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Bringing Rust's Result and Option types to Ruby, using the Data class
|
|
14
|
+
introduced in Ruby 3.2
|
|
15
|
+
email:
|
|
16
|
+
- danny.pechersky@gmail.com
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- ".idea/.gitignore"
|
|
22
|
+
- ".idea/copyright/profiles_settings.xml"
|
|
23
|
+
- ".idea/inspectionProfiles/Project_Default.xml"
|
|
24
|
+
- ".idea/linguadata.iml"
|
|
25
|
+
- ".idea/modules.xml"
|
|
26
|
+
- ".idea/vcs.xml"
|
|
27
|
+
- ".rspec"
|
|
28
|
+
- ".standard.yml"
|
|
29
|
+
- CHANGELOG.md
|
|
30
|
+
- CODE_OF_CONDUCT.md
|
|
31
|
+
- Gemfile
|
|
32
|
+
- Gemfile.lock
|
|
33
|
+
- LICENSE.txt
|
|
34
|
+
- README.md
|
|
35
|
+
- Rakefile
|
|
36
|
+
- Steepfile
|
|
37
|
+
- lib/linguadata.rb
|
|
38
|
+
- lib/linguadata/version.rb
|
|
39
|
+
- linguadata.gemspec
|
|
40
|
+
- sig/linguadata.rbs
|
|
41
|
+
homepage: https://github.com/DanielPechersky/linguadata
|
|
42
|
+
licenses:
|
|
43
|
+
- MIT
|
|
44
|
+
metadata:
|
|
45
|
+
allowed_push_host: https://rubygems.org
|
|
46
|
+
homepage_uri: https://github.com/DanielPechersky/linguadata
|
|
47
|
+
source_code_uri: https://github.com/DanielPechersky/linguadata
|
|
48
|
+
changelog_uri: https://github.com/DanielPechersky/linguadata/CHANGELOG.md
|
|
49
|
+
post_install_message:
|
|
50
|
+
rdoc_options: []
|
|
51
|
+
require_paths:
|
|
52
|
+
- lib
|
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
54
|
+
requirements:
|
|
55
|
+
- - ">="
|
|
56
|
+
- !ruby/object:Gem::Version
|
|
57
|
+
version: 3.2.0
|
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
|
+
requirements:
|
|
60
|
+
- - ">="
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '0'
|
|
63
|
+
requirements: []
|
|
64
|
+
rubygems_version: 3.4.10
|
|
65
|
+
signing_key:
|
|
66
|
+
specification_version: 4
|
|
67
|
+
summary: Result and Option types in Ruby, inspired by Rust
|
|
68
|
+
test_files: []
|