ruby-przypadki 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5ad1c5f7ffc820c32d006fe5d7d22ada97979311a65b0f08a9e407c326cd4394
4
+ data.tar.gz: d3a8646bea39c98cdf8f089f03490db2c534193926c363ce231afde7365a4a72
5
+ SHA512:
6
+ metadata.gz: 9f580c7c33fc04bb36001df4cab8774b81a899154c35813d58220bda4e00a55770c4089cfe5541e3e334ec48519202a8bd8a1aa9fab0a05f75f661a4b28c4102
7
+ data.tar.gz: e327ae4d635f59d9ea145e751f8857ab016bc5af18c272d45ffbe1a08392176de2cb66b51334d0f32a40445ce448612d28f053f37d613952086c95917cec690c
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,267 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 3.1
6
+ DisplayCopNames: true
7
+
8
+ Style/SymbolArray:
9
+ Enabled: true
10
+
11
+ Style/StringLiterals:
12
+ EnforcedStyle: single_quotes
13
+
14
+ Style/ClassAndModuleChildren:
15
+ EnforcedStyle: compact
16
+
17
+ Layout/SpaceInsideHashLiteralBraces:
18
+ EnforcedStyle: no_space
19
+
20
+ Layout/FirstHashElementIndentation:
21
+ Enabled: false
22
+
23
+ Style/TrailingCommaInArrayLiteral:
24
+ EnforcedStyleForMultiline: comma
25
+
26
+ Style/TrailingCommaInHashLiteral:
27
+ EnforcedStyleForMultiline: comma
28
+
29
+ Layout/AccessModifierIndentation:
30
+ EnforcedStyle: outdent
31
+
32
+ Layout/EndAlignment:
33
+ AutoCorrect: true
34
+
35
+ Layout/DefEndAlignment:
36
+ AutoCorrect: true
37
+
38
+ Style/RaiseArgs:
39
+ EnforcedStyle: compact
40
+
41
+ Style/FormatString:
42
+ EnforcedStyle: sprintf
43
+
44
+ Metrics/ClassLength:
45
+ Enabled: false
46
+
47
+ Metrics/ModuleLength:
48
+ Enabled: false
49
+
50
+ Style/FrozenStringLiteralComment:
51
+ Enabled: false
52
+
53
+ Layout/LineLength:
54
+ Enabled: false
55
+
56
+ Style/AndOr:
57
+ Enabled: false
58
+
59
+ Style/Documentation:
60
+ Enabled: false
61
+
62
+ Style/PerlBackrefs:
63
+ Enabled: false
64
+
65
+ Style/RegexpLiteral:
66
+ Enabled: false
67
+
68
+ Metrics/MethodLength:
69
+ Enabled: false
70
+
71
+ Style/BlockDelimiters:
72
+ Enabled: false
73
+
74
+ Style/MixinUsage:
75
+ Enabled: false
76
+
77
+ Metrics/AbcSize:
78
+ Enabled: false
79
+
80
+ Metrics/CyclomaticComplexity:
81
+ Enabled: false
82
+
83
+ Metrics/PerceivedComplexity:
84
+ Enabled: false
85
+
86
+ Metrics/BlockLength:
87
+ Enabled: false
88
+
89
+ Style/DoubleNegation:
90
+ Enabled: false
91
+
92
+ RSpec/DescribedClass:
93
+ Enabled: false
94
+
95
+ Style/NumericPredicate:
96
+ Enabled: false
97
+
98
+ RSpec/ExampleLength:
99
+ Enabled: false
100
+
101
+ RSpec/MultipleExpectations:
102
+ Enabled: false
103
+
104
+ Security/Open:
105
+ Enabled: false
106
+
107
+ Style/RescueModifier:
108
+ Enabled: false
109
+
110
+ Naming/MethodParameterName:
111
+ Enabled: false
112
+
113
+ Gemspec/DeprecatedAttributeAssignment: # (new in 1.10)
114
+ Enabled: true
115
+ Layout/SpaceBeforeBrackets: # (new in 1.7)
116
+ Enabled: true
117
+ Lint/AmbiguousAssignment: # (new in 1.7)
118
+ Enabled: true
119
+ Lint/DeprecatedConstants: # (new in 1.8)
120
+ Enabled: true
121
+ Lint/DuplicateBranch: # (new in 1.3)
122
+ Enabled: true
123
+ Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
124
+ Enabled: true
125
+ Lint/EmptyBlock: # (new in 1.1)
126
+ Enabled: true
127
+ Lint/EmptyClass: # (new in 1.3)
128
+ Enabled: true
129
+ Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
130
+ Enabled: true
131
+ Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
132
+ Enabled: true
133
+ Lint/NumberedParameterAssignment: # (new in 1.9)
134
+ Enabled: true
135
+ Lint/OrAssignmentToConstant: # (new in 1.9)
136
+ Enabled: true
137
+ Lint/RedundantDirGlobSort: # (new in 1.8)
138
+ Enabled: true
139
+ Lint/SymbolConversion: # (new in 1.9)
140
+ Enabled: true
141
+ Lint/ToEnumArguments: # (new in 1.1)
142
+ Enabled: true
143
+ Lint/TripleQuotes: # (new in 1.9)
144
+ Enabled: true
145
+ Lint/UnexpectedBlockArity: # (new in 1.5)
146
+ Enabled: true
147
+ Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
148
+ Enabled: true
149
+ Style/ArgumentsForwarding: # (new in 1.1)
150
+ Enabled: true
151
+ Style/CollectionCompact: # (new in 1.2)
152
+ Enabled: true
153
+ Style/DocumentDynamicEvalDefinition: # (new in 1.1)
154
+ Enabled: true
155
+ Style/EndlessMethod: # (new in 1.8)
156
+ Enabled: true
157
+ Style/HashConversion: # (new in 1.10)
158
+ Enabled: true
159
+ Style/HashExcept: # (new in 1.7)
160
+ Enabled: true
161
+ Style/IfWithBooleanLiteralBranches: # (new in 1.9)
162
+ Enabled: true
163
+ Style/NegatedIfElseCondition: # (new in 1.2)
164
+ Enabled: true
165
+ Style/NilLambda: # (new in 1.3)
166
+ Enabled: true
167
+ Style/RedundantArgument: # (new in 1.4)
168
+ Enabled: true
169
+ Style/SwapValues: # (new in 1.1)
170
+ Enabled: true
171
+
172
+ Gemspec/RequireMFA: # new in 1.23
173
+ Enabled: true
174
+ Layout/LineContinuationLeadingSpace: # new in 1.31
175
+ Enabled: true
176
+ Layout/LineContinuationSpacing: # new in 1.31
177
+ Enabled: true
178
+ Layout/LineEndStringConcatenationIndentation: # new in 1.18
179
+ Enabled: true
180
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
181
+ Enabled: true
182
+ Lint/AmbiguousRange: # new in 1.19
183
+ Enabled: true
184
+ Lint/ConstantOverwrittenInRescue: # new in 1.31
185
+ Enabled: true
186
+ Lint/EmptyInPattern: # new in 1.16
187
+ Enabled: true
188
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
189
+ Enabled: true
190
+ Lint/NonAtomicFileOperation: # new in 1.31
191
+ Enabled: true
192
+ Lint/RefinementImportMethods: # new in 1.27
193
+ Enabled: true
194
+ Lint/RequireRangeParentheses: # new in 1.32
195
+ Enabled: true
196
+ Lint/RequireRelativeSelfPath: # new in 1.22
197
+ Enabled: true
198
+ Lint/UselessRuby2Keywords: # new in 1.23
199
+ Enabled: true
200
+ Naming/BlockForwarding: # new in 1.24
201
+ Enabled: true
202
+ Security/CompoundHash: # new in 1.28
203
+ Enabled: true
204
+ Security/IoMethods: # new in 1.22
205
+ Enabled: true
206
+ Style/EmptyHeredoc: # new in 1.32
207
+ Enabled: true
208
+ Style/EnvHome: # new in 1.29
209
+ Enabled: true
210
+ Style/FetchEnvVar: # new in 1.28
211
+ Enabled: true
212
+ Style/FileRead: # new in 1.24
213
+ Enabled: true
214
+ Style/FileWrite: # new in 1.24
215
+ Enabled: true
216
+ Style/InPatternThen: # new in 1.16
217
+ Enabled: true
218
+ Style/MagicCommentFormat: # new in 1.35
219
+ Enabled: true
220
+ Style/MapCompactWithConditionalBlock: # new in 1.30
221
+ Enabled: true
222
+ Style/MapToHash: # new in 1.24
223
+ Enabled: true
224
+ Style/MultilineInPatternThen: # new in 1.16
225
+ Enabled: true
226
+ Style/NestedFileDirname: # new in 1.26
227
+ Enabled: true
228
+ Style/NumberedParameters: # new in 1.22
229
+ Enabled: true
230
+ Style/NumberedParametersLimit: # new in 1.22
231
+ Enabled: true
232
+ Style/ObjectThen: # new in 1.28
233
+ Enabled: true
234
+ Style/OpenStructUse: # new in 1.23
235
+ Enabled: true
236
+ Style/QuotedSymbols: # new in 1.16
237
+ Enabled: true
238
+ Style/RedundantInitialize: # new in 1.27
239
+ Enabled: true
240
+ Style/RedundantSelfAssignmentBranch: # new in 1.19
241
+ Enabled: true
242
+ Style/SelectByRegexp: # new in 1.22
243
+ Enabled: true
244
+ Style/StringChars: # new in 1.12
245
+ Enabled: true
246
+ RSpec/BeEq: # new in 2.9.0
247
+ Enabled: true
248
+ RSpec/BeNil: # new in 2.9.0
249
+ Enabled: true
250
+ RSpec/ChangeByZero: # new in 2.11.0
251
+ Enabled: true
252
+ RSpec/ExcessiveDocstringSpacing: # new in 2.5
253
+ Enabled: true
254
+ RSpec/IdenticalEqualityAssertion: # new in 2.4
255
+ Enabled: true
256
+ RSpec/SubjectDeclaration: # new in 2.5
257
+ Enabled: true
258
+ RSpec/VerifiedDoubleReference: # new in 2.10.0
259
+ Enabled: true
260
+ RSpec/Capybara/SpecificMatcher: # new in 2.12
261
+ Enabled: true
262
+ RSpec/FactoryBot/SyntaxMethods: # new in 2.7
263
+ Enabled: true
264
+ RSpec/Rails/AvoidSetupHook: # new in 2.4
265
+ Enabled: true
266
+ RSpec/Rails/HaveHttpStatus: # new in 2.12
267
+ Enabled: true
data/.ruby-version ADDED
@@ -0,0 +1,2 @@
1
+ 3.4.7
2
+
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in ruby-przypadki.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0'
9
+
10
+ gem 'rspec', '~> 3.0'
11
+
12
+ gem 'rubocop', '~> 1.21'
13
+ gem 'rubocop-rspec'
data/Gemfile.lock ADDED
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ruby-przypadki (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ diff-lcs (1.5.0)
11
+ json (2.6.2)
12
+ parallel (1.22.1)
13
+ parser (3.1.2.1)
14
+ ast (~> 2.4.1)
15
+ rainbow (3.1.1)
16
+ rake (13.0.6)
17
+ regexp_parser (2.5.0)
18
+ rexml (3.2.5)
19
+ rspec (3.11.0)
20
+ rspec-core (~> 3.11.0)
21
+ rspec-expectations (~> 3.11.0)
22
+ rspec-mocks (~> 3.11.0)
23
+ rspec-core (3.11.0)
24
+ rspec-support (~> 3.11.0)
25
+ rspec-expectations (3.11.0)
26
+ diff-lcs (>= 1.2.0, < 2.0)
27
+ rspec-support (~> 3.11.0)
28
+ rspec-mocks (3.11.1)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.11.0)
31
+ rspec-support (3.11.0)
32
+ rubocop (1.35.1)
33
+ json (~> 2.3)
34
+ parallel (~> 1.10)
35
+ parser (>= 3.1.2.1)
36
+ rainbow (>= 2.2.2, < 4.0)
37
+ regexp_parser (>= 1.8, < 3.0)
38
+ rexml (>= 3.2.5, < 4.0)
39
+ rubocop-ast (>= 1.20.1, < 2.0)
40
+ ruby-progressbar (~> 1.7)
41
+ unicode-display_width (>= 1.4.0, < 3.0)
42
+ rubocop-ast (1.21.0)
43
+ parser (>= 3.1.1.0)
44
+ rubocop-rspec (2.12.1)
45
+ rubocop (~> 1.31)
46
+ ruby-progressbar (1.11.0)
47
+ unicode-display_width (2.2.0)
48
+
49
+ PLATFORMS
50
+ arm64-darwin-21
51
+ arm64-darwin-24
52
+ x86_64-linux
53
+
54
+ DEPENDENCIES
55
+ rake (~> 13.0)
56
+ rspec (~> 3.0)
57
+ rubocop (~> 1.21)
58
+ rubocop-rspec
59
+ ruby-przypadki!
60
+
61
+ BUNDLED WITH
62
+ 2.3.7
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Tomasz Pędraszewski
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,39 @@
1
+ # Ruby::Przypadki
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ruby/przypadki`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'ruby-przypadki'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install ruby-przypadki
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ 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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ruby-przypadki.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruby
4
+ end
5
+
6
+ module Ruby::Przypadki
7
+ VERSION = '0.1.0'
8
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'przypadki/version'
4
+
5
+ module Ruby
6
+ end
7
+
8
+ module Ruby::Przypadki
9
+ end
10
+
11
+ # Your code goes here...
12
+ class Ruby::Przypadki::Error < StandardError
13
+ # Your code goes here...
14
+ end
15
+
16
+ class String
17
+ unless method_defined?(:ends_with?)
18
+ def ends_with?(suffix)
19
+ return true if suffix.empty?
20
+
21
+ self[-suffix.length..] == suffix
22
+ end
23
+ end
24
+ end
25
+
26
+ module Ruby::Przypadki
27
+ def self.dopelniacz(word)
28
+ return "#{word[0...-2]}ła" if word.ends_with?('eł')
29
+
30
+ return "#{word[0...-1]}ego" if word.ends_with?('cy')
31
+
32
+ return "#{word[0...-2]}ka" if word.ends_with?('ek')
33
+
34
+ return "#{word[0...-2]}i" if word.ends_with?('ja')
35
+ return "#{word[0...-1]}i" if word.ends_with?('ia')
36
+
37
+ return "#{word[0...-1]}i" if word.ends_with?('ka')
38
+ return "#{word[0...-1]}a" if word.ends_with?('ko')
39
+
40
+ return "#{word}ego" if word.ends_with?('i')
41
+
42
+ return "#{word[0...-1]}y" if word.ends_with?('a')
43
+
44
+ "#{word}a"
45
+ end
46
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/ruby/przypadki/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'ruby-przypadki'
7
+ spec.version = Ruby::Przypadki::VERSION
8
+ spec.authors = ['Tomasz Pędraszewski']
9
+ spec.email = ['t.pedraszewski@28byteslater.com']
10
+
11
+ spec.summary = 'Odmiana polskich słów przez przypadki.'
12
+ spec.homepage = 'https://github.com/dabroz/ruby-przypadki'
13
+ spec.license = 'MIT'
14
+ spec.required_ruby_version = '>= 3.1.0'
15
+
16
+ # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
17
+
18
+ spec.metadata['homepage_uri'] = spec.homepage
19
+ spec.metadata['source_code_uri'] = spec.homepage
20
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
21
+
22
+ # Specify which files should be added to the gem when it is released.
23
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
+ `git ls-files -z`.split("\x0").reject do |f|
26
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
27
+ end
28
+ end
29
+ spec.bindir = 'exe'
30
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ['lib']
32
+
33
+ # Uncomment to register a new dependency of your gem
34
+ # spec.add_dependency "example-gem", "~> 1.0"
35
+
36
+ # For more information and examples about making a new gem, check out our
37
+ # guide at: https://bundler.io/guides/creating_gem.html
38
+ spec.metadata['rubygems_mfa_required'] = 'true'
39
+ end
@@ -0,0 +1,6 @@
1
+ module Ruby
2
+ module Przypadki
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-przypadki
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Tomasz Pędraszewski
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ email:
13
+ - t.pedraszewski@28byteslater.com
14
+ executables: []
15
+ extensions: []
16
+ extra_rdoc_files: []
17
+ files:
18
+ - ".rspec"
19
+ - ".rubocop.yml"
20
+ - ".ruby-version"
21
+ - Gemfile
22
+ - Gemfile.lock
23
+ - LICENSE.txt
24
+ - README.md
25
+ - Rakefile
26
+ - lib/ruby/przypadki.rb
27
+ - lib/ruby/przypadki/version.rb
28
+ - ruby-przypadki.gemspec
29
+ - sig/ruby/przypadki.rbs
30
+ homepage: https://github.com/dabroz/ruby-przypadki
31
+ licenses:
32
+ - MIT
33
+ metadata:
34
+ homepage_uri: https://github.com/dabroz/ruby-przypadki
35
+ source_code_uri: https://github.com/dabroz/ruby-przypadki
36
+ rubygems_mfa_required: 'true'
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 3.1.0
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ requirements: []
51
+ rubygems_version: 3.6.9
52
+ specification_version: 4
53
+ summary: Odmiana polskich słów przez przypadki.
54
+ test_files: []