koper 0.0.1
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/lib/koper/array.path.rb +5 -0
- data/lib/koper/hash.path.rb +32 -0
- data/lib/koper/version.rb +3 -0
- data/lib/koper.rb +2 -0
- metadata +49 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e83dd5f2d3da04a4b22abe981c8ba029be729330af2f78911b7363f74fd6e039
|
4
|
+
data.tar.gz: 29cc6d027ba625c563f17339916bb70a704c78b405c14ee657f08eca18c355a0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8512e1ed64440df3a64be2e7f33ed4f9bc5e10934e219f68db46e909b1d8afa8aec102d1c78a4a07c479313685fda72bf416cb06ea9ee5d6a68b407211650d58
|
7
|
+
data.tar.gz: 9a5fd662d117ed7ffcbc1d7c2ea2c2d80f69c58f274c4e949468979f718ea86a3f653a9bb5861dc1789a79bbd315ce8600b383ac9d057d0ca043099b2d39dde7
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class Hash
|
2
|
+
def /(key)
|
3
|
+
case key
|
4
|
+
when Enumerable
|
5
|
+
fetch_values *key
|
6
|
+
else
|
7
|
+
fetch key
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def &(key)
|
12
|
+
case key
|
13
|
+
when Enumerable
|
14
|
+
slice *key
|
15
|
+
else
|
16
|
+
slice key
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def !()
|
21
|
+
invert
|
22
|
+
end
|
23
|
+
|
24
|
+
def +(other)
|
25
|
+
case other
|
26
|
+
when Hash
|
27
|
+
merge other
|
28
|
+
else
|
29
|
+
raise NoMethodError.new "'+' operator for #{self.class} and #{other.class} is undefined"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/koper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: koper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Łukasz Pomietło
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-02-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: " It extends some standard classes with operators whose mathematical
|
14
|
+
and logical meaning is difficult to justify.\n"
|
15
|
+
email: oficjalnyadreslukasza@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/koper.rb
|
21
|
+
- lib/koper/array.path.rb
|
22
|
+
- lib/koper/hash.path.rb
|
23
|
+
- lib/koper/version.rb
|
24
|
+
homepage: https://github.com/lpogic/koper
|
25
|
+
licenses:
|
26
|
+
- Zlib
|
27
|
+
metadata:
|
28
|
+
documentation_uri: https://github.com/lpogic/koper/blob/main/doc/wiki/README.md
|
29
|
+
homepage_uri: https://github.com/lpogic/koper
|
30
|
+
post_install_message:
|
31
|
+
rdoc_options: []
|
32
|
+
require_paths:
|
33
|
+
- lib
|
34
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 3.2.2
|
39
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
requirements: []
|
45
|
+
rubygems_version: 3.5.6
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: Controversial standard class operator set
|
49
|
+
test_files: []
|