frozen_void 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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/frozen_void.rb +58 -0
  3. metadata +71 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 16d77a4469472951a33fb8a70c044e7171bccad31bd28fbeb3423fbeb74686c3
4
+ data.tar.gz: 6d4f529c6ef4d3287e32263680ef6a1fa7d327d4c37876fc8f552a19000bf123
5
+ SHA512:
6
+ metadata.gz: 2a034e7c1a93cc9a09d4027d6a9904185920b6c2e72f7d75d1f2f7eeb2685a5d554103bd9ee83162bab8a41439d3d366a5cf3e47d10839e4643e28d042da6061
7
+ data.tar.gz: 0ba7c46fc661273d27420499424aa4853e2999ef3590d480bc854178f94b67e41647681927f3851ab4688e317279b57145cc3f13196166e11d4178861510398d
@@ -0,0 +1,58 @@
1
+ require "frozen_void/set"
2
+
3
+ # a source of unalterable emptiness
4
+ module FrozenVoid
5
+ IMMUTABLE_EMPTY_SET = Set.new.freeze
6
+
7
+ # @example is empty
8
+ # a_set = FrozenVoid.set
9
+ # a_set.empty? #=> true
10
+ # @example cannot be added to
11
+ # a_set = FrozenVoid.set
12
+ # a_set.add(:warmth) #=> raise FrozenError, "can't modify frozen Hash: {}"
13
+ # @example is the same object as some other set from the void
14
+ # a_set = FrozenVoid.set
15
+ # another_set = FrozenVoid.set
16
+ # a_set.equal?(another_set) #=> true
17
+ #
18
+ # @return [Set] eternally empty
19
+ def self.set
20
+ FrozenVoid::Set.new
21
+ end
22
+
23
+ IMMUTABLE_EMPTY_ARRAY = [].freeze
24
+
25
+ # @example is empty
26
+ # an_array = FrozenVoid.array
27
+ # an_array.empty? #=> true
28
+ # @example cannot be added to
29
+ # an_array = FrozenVoid.array
30
+ # an_array.push(:warmth) #=> raise FrozenError, "can't modify frozen Array: []"
31
+ # @example is the same object as some other array from the void
32
+ # an_array = FrozenVoid.array
33
+ # another_array = FrozenVoid.array
34
+ # an_array.equal?(another_array) #=> true
35
+ #
36
+ # @return [Array] never to be filled
37
+ def self.array
38
+ IMMUTABLE_EMPTY_ARRAY
39
+ end
40
+
41
+ IMMUTABLE_EMPTY_STRING = "".freeze
42
+
43
+ # @example is empty
44
+ # a_string = FrozenVoid.string
45
+ # a_string.empty? #=> true
46
+ # @example cannot be modified
47
+ # a_string = FrozenVoid.string
48
+ # a_string.upcase! #=> raise FrozenError, "can't modify frozen String: \"\""
49
+ # @example is the same object as some other string from the void
50
+ # a_string = FrozenVoid.string
51
+ # another_string = FrozenVoid.string
52
+ # a_string.equal?(another_string) #=> true
53
+ #
54
+ # @return [String] forever bereft of character
55
+ def self.string
56
+ IMMUTABLE_EMPTY_STRING
57
+ end
58
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: frozen_void
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Robb Kidd
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-12-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: yard-doctest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description:
42
+ email: robb@thekidds.org
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - lib/frozen_void.rb
48
+ homepage: https://github.com/robbkidd/frozen_void
49
+ licenses:
50
+ - Apache 2.0
51
+ metadata: {}
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubygems_version: 3.2.22
68
+ signing_key:
69
+ specification_version: 4
70
+ summary: A source of unalterable emptiness.
71
+ test_files: []