trinkets 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +97 -53
- data/doc/class/init.md +181 -130
- data/doc/enumerable/each_with_hash.md +47 -0
- data/lib/{trinkets → explicit/trinkets}/extend/class/init.rb +22 -11
- data/lib/explicit/trinkets/include/enumerable/each_with_hash.rb +14 -0
- data/lib/explicit/trinkets/patch/enumerable/each_with_hash.rb +9 -0
- data/lib/explicit/trinkets/refine/enumerable/each_with_hash.rb +15 -0
- data/lib/implicit/trinkets/class/init.rb +1 -0
- data/lib/implicit/trinkets/enumerable/each_with_hash.rb +1 -0
- data/lib/trinkets/version.rb +1 -1
- metadata +53 -17
- data/.rspec +0 -3
- data/Rakefile +0 -8
- data/lib/trinkets.rb +0 -3
- data/trinkets.gemspec +0 -32
- /data/lib/{trinkets → explicit/trinkets}/patch/class/init.rb +0 -0
- /data/lib/{trinkets → explicit/trinkets}/refine/class/init.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb82b9c6f72cce48f7d303e989870bc05e77429508c17f266428d15bc0821628
|
4
|
+
data.tar.gz: 1dc0a8334a869e8be5b4e397caeed6be9ff16b495514425e184938d538b0b2e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b57aecbcc07de7c710804302accad6fe49d610c133fabf74040a0cca376129258dc064eb967c0ff50570d72b46d641160fda6485222d29f47f06117b57db55c
|
7
|
+
data.tar.gz: 7714dbbd7e295d87d9f6c98aac8d6aade0d6a57d86e69368c039e8022824511f897f1a2d8f90f5f70b1fb598741b4bfbfdbb5308a164f40dc2fcb6da01491148
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
### [0.3.1](https://github.com/SilverPhoenix99/trinkets/tree/v0.3.1)
|
3
|
+
* Fixed repeated arguments in `Class::init`.
|
4
|
+
|
5
|
+
### [0.3.0](https://github.com/SilverPhoenix99/trinkets/tree/v0.3.0)
|
6
|
+
* Restructured folders to default to `/refine/`.
|
7
|
+
* Added `Enumerable#each_with_hash`/`Enumerator#with_hash`.
|
8
|
+
|
9
|
+
### [0.2.0](https://github.com/SilverPhoenix99/trinkets/tree/v0.2.0)
|
10
|
+
* Added `attr: :none` as an option for `Class::init`.
|
11
|
+
|
12
|
+
### [0.1.0](https://github.com/SilverPhoenix99/trinkets/tree/v0.1.0)
|
13
|
+
* Added `Class::init`.
|
data/README.md
CHANGED
@@ -1,53 +1,97 @@
|
|
1
|
-
# Trinkets
|
2
|
-
|
3
|
-
It's the bootleg [facets](https://github.com/rubyworks/facets?tab=readme-ov-file#ruby-facets).
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
```ruby
|
21
|
-
require 'trinkets/
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
1
|
+
# Trinkets
|
2
|
+
|
3
|
+
It's the bootleg [facets](https://github.com/rubyworks/facets?tab=readme-ov-file#ruby-facets).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
### RubyGems
|
8
|
+
```
|
9
|
+
gem install trinkets
|
10
|
+
```
|
11
|
+
|
12
|
+
### Bundler
|
13
|
+
```ruby
|
14
|
+
gem 'trinkets', require: false
|
15
|
+
```
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
The trinkets are loaded with the following structure:
|
20
|
+
```ruby
|
21
|
+
require 'trinkets/{how-to-patch}/{class}/{method}'
|
22
|
+
```
|
23
|
+
|
24
|
+
There are 3 ways to load trinkets, which are represented by the `{how-to-patch}` portion in the requires:
|
25
|
+
* `refine` : As refinements;
|
26
|
+
* `extend`/`include` : As explicit `extend` or `include`;
|
27
|
+
* `patch` : As implicit `include` or `extend`, a.k.a. monkey-patching.
|
28
|
+
|
29
|
+
### Refinement
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
require 'trinkets/class/init'
|
33
|
+
|
34
|
+
using ::Trinkets::Class::Init
|
35
|
+
```
|
36
|
+
|
37
|
+
The `refine` subdirectory is the default, and it can be omitted from `require`. The above is the same as:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
require 'trinkets/refine/class/init'
|
41
|
+
```
|
42
|
+
|
43
|
+
### Extend / Include
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
require 'trinkets/extend/class/init'
|
47
|
+
|
48
|
+
class Test
|
49
|
+
extend ::Trinkets::Class::Init
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
require 'trinkets/include/enumerable/each_with_hash'
|
55
|
+
|
56
|
+
class Test
|
57
|
+
include Enumerable
|
58
|
+
include ::Trinkets::Enumerable::WithHash
|
59
|
+
end
|
60
|
+
```
|
61
|
+
|
62
|
+
### Mokey Patching
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
require 'trinkets/patch/class/init'
|
66
|
+
```
|
67
|
+
|
68
|
+
## Available modules
|
69
|
+
|
70
|
+
|Trinket|
|
71
|
+
|---|
|
72
|
+
|[class/init](doc/class/init.md)|
|
73
|
+
|[enumerable/each_with_hash](doc/enumerable/each_with_hash.md)|
|
74
|
+
|
75
|
+
## Versioning
|
76
|
+
|
77
|
+
Versions follow semantic versioning: `major.minor.patch`
|
78
|
+
* `major`: breaking changes.
|
79
|
+
* `minor`: improvements and new features that are backwards compatible.
|
80
|
+
* `patch`: backwards compatible fixes to existing features, or documentation improvements.
|
81
|
+
|
82
|
+
[//]: # (TODO: Development)
|
83
|
+
|
84
|
+
## Contributing
|
85
|
+
|
86
|
+
Steps to include when developing the feature/fix:
|
87
|
+
* Add or change the appropriate RSpec tests.
|
88
|
+
* Document the feature.
|
89
|
+
* Might not apply to fixes if the feature didn't change.
|
90
|
+
* Bump the [version](lib/trinkets/version.rb).
|
91
|
+
* Update the Changelog.
|
92
|
+
|
93
|
+
[//]: # (TODO: Contributing)
|
94
|
+
|
95
|
+
## License
|
96
|
+
|
97
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/doc/class/init.md
CHANGED
@@ -1,130 +1,181 @@
|
|
1
|
-
# Description
|
2
|
-
|
3
|
-
It allows generating simple `#initialize` methods.
|
4
|
-
|
5
|
-
To use it define a class and call `::init` like you would call `::attr` methods:
|
6
|
-
* pass the name of the arguments as symbols
|
7
|
-
* pass options at the end:
|
8
|
-
* `attr` : what getters and/or setters to define
|
9
|
-
* can be `:accessor`, `:reader`, `:writer` or `:none`
|
10
|
-
* defaults to `:accessor`
|
11
|
-
* `kw` : if arguments are to be set as keyword arguments
|
12
|
-
* defaults to `false`
|
13
|
-
|
14
|
-
The same options can be used per individual argument
|
15
|
-
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
class
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
#
|
25
|
-
class
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
#
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
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
|
-
|
130
|
-
|
1
|
+
# Description
|
2
|
+
|
3
|
+
It allows generating simple `#initialize` methods.
|
4
|
+
|
5
|
+
To use it, define a class and call `::init` like you would call `::attr` methods:
|
6
|
+
* pass the name of the arguments as symbols
|
7
|
+
* pass options at the end:
|
8
|
+
* `attr` : what getters and/or setters to define
|
9
|
+
* can be `:accessor`, `:reader`, `:writer` or `:none`
|
10
|
+
* defaults to `:accessor`
|
11
|
+
* `kw` : if arguments are to be set as keyword arguments
|
12
|
+
* defaults to `false`
|
13
|
+
|
14
|
+
The same options can be used per individual argument.
|
15
|
+
|
16
|
+
# Requiring
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
# As a refinement
|
20
|
+
require 'trinkets/class/init' # implicit
|
21
|
+
# or
|
22
|
+
require 'trinkets/refine/class/init' # explicit
|
23
|
+
|
24
|
+
# As extend
|
25
|
+
require 'trinkets/extend/class/init'
|
26
|
+
|
27
|
+
# As monkey-patch
|
28
|
+
require 'trinkets/patch/class/init'
|
29
|
+
```
|
30
|
+
|
31
|
+
# Examples
|
32
|
+
|
33
|
+
## Simple Initialize
|
34
|
+
```ruby
|
35
|
+
class Test
|
36
|
+
init :a, :b
|
37
|
+
end
|
38
|
+
|
39
|
+
# would be the same as
|
40
|
+
class Test
|
41
|
+
attr_accessor :a, :b
|
42
|
+
def initialize(a, b)
|
43
|
+
@a = a
|
44
|
+
@b = b
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
test = Test.new(1, 2)
|
49
|
+
|
50
|
+
test.a
|
51
|
+
# 1
|
52
|
+
|
53
|
+
test.b
|
54
|
+
# 2
|
55
|
+
|
56
|
+
test.a = 3
|
57
|
+
# 3
|
58
|
+
```
|
59
|
+
|
60
|
+
## Read only access to instance variables
|
61
|
+
```ruby
|
62
|
+
class TestAttr
|
63
|
+
init :a, :b, attr: :reader
|
64
|
+
end
|
65
|
+
|
66
|
+
# would be the same as
|
67
|
+
class TestAttr
|
68
|
+
attr_reader :a, :b
|
69
|
+
def initialize(a, b)
|
70
|
+
@a = a
|
71
|
+
@b = b
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
test = TestAttr.new(1, 2)
|
76
|
+
|
77
|
+
test.a
|
78
|
+
# 1
|
79
|
+
|
80
|
+
test.b
|
81
|
+
# 2
|
82
|
+
|
83
|
+
test.a = 3
|
84
|
+
# => raises NoMethodError
|
85
|
+
```
|
86
|
+
|
87
|
+
## Initialize uses keyword arguments
|
88
|
+
```ruby
|
89
|
+
class TestKW
|
90
|
+
init :a, :b, kw: :true
|
91
|
+
end
|
92
|
+
|
93
|
+
# would be the same as
|
94
|
+
class TestKW
|
95
|
+
attr_accessor :a, :b
|
96
|
+
def initialize(a:, b:)
|
97
|
+
@a = a
|
98
|
+
@b = b
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
test = TestKW.new(a: 1, b: 2)
|
103
|
+
|
104
|
+
test.a
|
105
|
+
# 1
|
106
|
+
|
107
|
+
test.b
|
108
|
+
# 2
|
109
|
+
```
|
110
|
+
|
111
|
+
## Individual attribute options
|
112
|
+
```ruby
|
113
|
+
class TestAttrOptions
|
114
|
+
init [:a, kw: true, attr: :reader],
|
115
|
+
:b,
|
116
|
+
[:c, kw: true],
|
117
|
+
[:d, attr: :none]
|
118
|
+
end
|
119
|
+
|
120
|
+
# would be the same as
|
121
|
+
class TestAttrOptions
|
122
|
+
attr_reader :a
|
123
|
+
attr_accessor :b, :c
|
124
|
+
def initialize(b, d, a:, c:)
|
125
|
+
@a = a
|
126
|
+
@b = b
|
127
|
+
@c = c
|
128
|
+
@d = d
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
test = TestAttrOptions.new(2, 4, a: 1, c: 3)
|
133
|
+
|
134
|
+
test.a
|
135
|
+
# 1
|
136
|
+
|
137
|
+
test.b
|
138
|
+
# 2
|
139
|
+
|
140
|
+
test.c
|
141
|
+
# 3
|
142
|
+
|
143
|
+
test.d
|
144
|
+
# => raises NoMethodError
|
145
|
+
|
146
|
+
test.a = 5
|
147
|
+
# => raises NoMethodError
|
148
|
+
```
|
149
|
+
|
150
|
+
## Mixed together
|
151
|
+
```ruby
|
152
|
+
class TestMixed
|
153
|
+
init [:a, attr: :reader],
|
154
|
+
:b,
|
155
|
+
kw: true
|
156
|
+
end
|
157
|
+
|
158
|
+
# would be the same as
|
159
|
+
class TestMixed
|
160
|
+
attr_reader :a
|
161
|
+
attr_accessor :b
|
162
|
+
def initialize(a:, b:)
|
163
|
+
@a = a
|
164
|
+
@b = b
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
test = TestMixed.new(1, 2)
|
169
|
+
|
170
|
+
test.a
|
171
|
+
# 1
|
172
|
+
|
173
|
+
test.b
|
174
|
+
# 2
|
175
|
+
|
176
|
+
test.b = 3
|
177
|
+
# 3
|
178
|
+
|
179
|
+
test.a = 4
|
180
|
+
# => raises NoMethodError
|
181
|
+
```
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Description
|
2
|
+
|
3
|
+
It defines `Enumerable#each_with_hash`, which is a simple wrapper for `Enumerable#each_with_object({})`.
|
4
|
+
|
5
|
+
It also includes the alias `Enumerator#with_hash(&)`.
|
6
|
+
|
7
|
+
# Requiring
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
# As a refinement
|
11
|
+
require 'trinkets/enumerable/each_with_hash' # implicit
|
12
|
+
# or
|
13
|
+
require 'trinkets/refine/enumerable/each_with_hash' # explicit
|
14
|
+
|
15
|
+
# As include
|
16
|
+
require 'trinkets/include/enumerable/each_with_hash'
|
17
|
+
|
18
|
+
# As monkey-patch
|
19
|
+
require 'trinkets/patch/enumerable/each_with_hash'
|
20
|
+
```
|
21
|
+
|
22
|
+
# Examples
|
23
|
+
|
24
|
+
These examples are all equivalent.
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
[2, 3, 4, 5].each_with_hash { |value, hash| hash[value] = value * value }
|
28
|
+
# => {2=>4, 3=>9, 4=>16, 5=>25}
|
29
|
+
|
30
|
+
[2, 3, 4, 5].each_with_hash
|
31
|
+
# => #<Enumerator: [2, 3, 4, 5]:each_with_object({})>
|
32
|
+
```
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
[2, 3, 4, 5].each
|
36
|
+
.with_hash { |value, hash| hash[value] = value * value }
|
37
|
+
|
38
|
+
# => {2=>4, 3=>9, 4=>16, 5=>25}
|
39
|
+
```
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
[2, 3, 4, 5].each
|
43
|
+
.with_hash
|
44
|
+
.each { |value, hash| hash[value] = value * value }
|
45
|
+
|
46
|
+
# => {2=>4, 3=>9, 4=>16, 5=>25}
|
47
|
+
```
|
@@ -11,16 +11,7 @@ module Trinkets
|
|
11
11
|
|
12
12
|
default_attr_options = { attr: attr, kw: kw }
|
13
13
|
|
14
|
-
|
15
|
-
# @type [Hash[Symbol, Hash]]
|
16
|
-
attrs = attrs.map { |a| [*a] }
|
17
|
-
.map { |a| a.size == 1 ? a << {} : a }
|
18
|
-
.each_with_object({}) do |(name, opts), h|
|
19
|
-
# name, opts = a
|
20
|
-
name = name.to_s.sub(/^@/, '').to_sym
|
21
|
-
opts = default_attr_options.merge(opts)
|
22
|
-
h[name] = opts
|
23
|
-
end
|
14
|
+
attrs = ::Trinkets::Class.send(:sanitize_attrs, attrs, default_attr_options)
|
24
15
|
|
25
16
|
attr_methods = (ATTR - [:none])
|
26
17
|
.each_with_object({}) do |name, h|
|
@@ -43,12 +34,32 @@ module Trinkets
|
|
43
34
|
.partition { |_, kw_opt| kw_opt }
|
44
35
|
.map(&:to_h)
|
45
36
|
|
46
|
-
init_method = ::Trinkets::Class.send
|
37
|
+
init_method = ::Trinkets::Class.send(:define_initialize, attrs, kw_attrs)
|
47
38
|
define_method :initialize, init_method
|
48
39
|
end
|
49
40
|
end
|
50
41
|
|
51
42
|
class << self
|
43
|
+
private def sanitize_attrs(attrs, default_attr_options)
|
44
|
+
# Normalize attrs into an array: [[:name, **options], ...]
|
45
|
+
# @type [Array[Array[Symbol, Hash]]]
|
46
|
+
attrs = attrs.map do |a|
|
47
|
+
name, opts = [*a]
|
48
|
+
name = name.to_s.sub(/^@/, '').to_sym
|
49
|
+
opts = default_attr_options.merge(opts || {})
|
50
|
+
[name, opts]
|
51
|
+
end
|
52
|
+
|
53
|
+
repeated_attrs = attrs.map(&:first)
|
54
|
+
.tally
|
55
|
+
.select { |_, count| count > 1 }
|
56
|
+
.keys
|
57
|
+
|
58
|
+
raise ArgumentError, "duplicated argument names: #{repeated_attrs.join(', ')}" if repeated_attrs.any?
|
59
|
+
|
60
|
+
attrs.to_h
|
61
|
+
end
|
62
|
+
|
52
63
|
# @param [Hash[Symbol Boolean]] attrs
|
53
64
|
# @param [Hash[Symbol Boolean]] kw_attrs
|
54
65
|
private def define_initialize(attrs, kw_attrs)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative '../../include/enumerable/each_with_hash'
|
2
|
+
|
3
|
+
module Trinkets
|
4
|
+
module Enumerable
|
5
|
+
module WithHash
|
6
|
+
refine ::Enumerable do
|
7
|
+
import_methods ::Trinkets::Enumerable::WithHash
|
8
|
+
end
|
9
|
+
|
10
|
+
refine ::Enumerator do
|
11
|
+
import_methods ::Trinkets::Enumerator::WithHash
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require_relative '../../../explicit/trinkets/refine/class/init'
|
@@ -0,0 +1 @@
|
|
1
|
+
require_relative '../../../explicit/trinkets/refine/enumerable/each_with_hash'
|
data/lib/trinkets/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trinkets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SilverPhoenix99
|
@@ -9,9 +9,37 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
13
|
-
dependencies:
|
14
|
-
|
12
|
+
date: 2024-02-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '3.0'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '3.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: simplecov
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.22.0
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.22.0
|
42
|
+
description: Truly outrageous bootleg facets in your trinkets box.
|
15
43
|
email:
|
16
44
|
- antoniopedrosilvapinto@gmail.com
|
17
45
|
- pedro.at.miranda@gmail.com
|
@@ -19,40 +47,48 @@ executables: []
|
|
19
47
|
extensions: []
|
20
48
|
extra_rdoc_files: []
|
21
49
|
files:
|
22
|
-
- ".rspec"
|
23
50
|
- CHANGELOG.md
|
24
51
|
- LICENSE.txt
|
25
52
|
- README.md
|
26
|
-
- Rakefile
|
27
53
|
- doc/class/init.md
|
28
|
-
-
|
29
|
-
- lib/trinkets/extend/class/init.rb
|
30
|
-
- lib/trinkets/
|
31
|
-
- lib/trinkets/
|
54
|
+
- doc/enumerable/each_with_hash.md
|
55
|
+
- lib/explicit/trinkets/extend/class/init.rb
|
56
|
+
- lib/explicit/trinkets/include/enumerable/each_with_hash.rb
|
57
|
+
- lib/explicit/trinkets/patch/class/init.rb
|
58
|
+
- lib/explicit/trinkets/patch/enumerable/each_with_hash.rb
|
59
|
+
- lib/explicit/trinkets/refine/class/init.rb
|
60
|
+
- lib/explicit/trinkets/refine/enumerable/each_with_hash.rb
|
61
|
+
- lib/implicit/trinkets/class/init.rb
|
62
|
+
- lib/implicit/trinkets/enumerable/each_with_hash.rb
|
32
63
|
- lib/trinkets/version.rb
|
33
|
-
|
34
|
-
homepage: http://nowhere.example.com
|
64
|
+
homepage: https://github.com/SilverPhoenix99/trinkets
|
35
65
|
licenses:
|
36
66
|
- MIT
|
37
67
|
metadata:
|
38
|
-
homepage_uri:
|
68
|
+
homepage_uri: https://github.com/SilverPhoenix99/trinkets
|
69
|
+
source_code_uri: https://github.com/SilverPhoenix99/trinkets
|
70
|
+
changelog_uri: https://github.com/SilverPhoenix99/trinkets/blob/master/CHANGELOG.md
|
71
|
+
bug_tracker_uri: https://github.com/SilverPhoenix99/trinkets/issues
|
72
|
+
documentation_uri: https://github.com/SilverPhoenix99/trinkets/blob/master/README.md
|
39
73
|
post_install_message:
|
40
74
|
rdoc_options: []
|
41
75
|
require_paths:
|
42
|
-
- lib
|
76
|
+
- lib/explicit
|
77
|
+
- lib/implicit
|
78
|
+
- lib/trinkets
|
43
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
44
80
|
requirements:
|
45
81
|
- - ">="
|
46
82
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3.
|
83
|
+
version: 3.1.0
|
48
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
85
|
requirements:
|
50
86
|
- - ">="
|
51
87
|
- !ruby/object:Gem::Version
|
52
88
|
version: '0'
|
53
89
|
requirements: []
|
54
|
-
rubygems_version: 3.5.
|
90
|
+
rubygems_version: 3.5.5
|
55
91
|
signing_key:
|
56
92
|
specification_version: 4
|
57
|
-
summary:
|
93
|
+
summary: Bootleg facets, with new trinkets.
|
58
94
|
test_files: []
|
data/.rspec
DELETED
data/Rakefile
DELETED
data/lib/trinkets.rb
DELETED
data/trinkets.gemspec
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'lib/trinkets/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'trinkets'
|
7
|
-
spec.version = Trinkets::VERSION
|
8
|
-
spec.authors = %w[SilverPhoenix99 P3t3rU5]
|
9
|
-
spec.email = %w[antoniopedrosilvapinto@gmail.com pedro.at.miranda@gmail.com]
|
10
|
-
|
11
|
-
spec.summary = 'Trinkets in your box.'
|
12
|
-
spec.description = 'Truly outrageous trinkets.'
|
13
|
-
spec.homepage = 'http://nowhere.example.com'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
spec.required_ruby_version = '>= 3.2.0'
|
16
|
-
|
17
|
-
# spec.metadata['allowed_push_host'] = 'TODO: Set to your gem server "https://example.com"'
|
18
|
-
|
19
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
-
# spec.metadata['source_code_uri'] = "TODO: Put your gem's public repo URL here."
|
21
|
-
# spec.metadata['changelog_uri'] = "TODO: Put your gem's CHANGELOG.md URL here."
|
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
|
-
(File.expand_path(f) == __FILE__) ||
|
28
|
-
f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile])
|
29
|
-
end
|
30
|
-
end
|
31
|
-
spec.require_paths = ['lib']
|
32
|
-
end
|
File without changes
|
File without changes
|