modularity 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +4 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/modularity/as_trait.rb +17 -5
- data/lib/modularity/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae6112d5216094ee4cccfb211acdce311c402126a0108d56910a42b4ffe49776
|
4
|
+
data.tar.gz: 91c78a395463428308e3fda20fd7f6788191e49509b565653549f9a2e6e91314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21c3e3f0553bdc7c7a7367ff59a19ca8d0c374033347492972afa0ba551338aca9009405ba544ea30e50e1a824c94af7d09d9b4c77f53b885fc658e42be48253
|
7
|
+
data.tar.gz: 14b814a52fa1cd6623abd1dceca1e85658e6aa503002b0dbc60b4de0940c0bb1adbe2339c5bd70c33c7cb1166c6c02997aa9a195a488aa17e7dcc27d1ca9878f
|
data/.github/workflows/test.yml
CHANGED
@@ -16,10 +16,14 @@ jobs:
|
|
16
16
|
include:
|
17
17
|
- ruby: 2.5.7
|
18
18
|
gemfile: Gemfile
|
19
|
+
- ruby: 2.6.10
|
20
|
+
gemfile: Gemfile
|
19
21
|
- ruby: 2.7.4
|
20
22
|
gemfile: Gemfile
|
21
23
|
- ruby: 3.0.2
|
22
24
|
gemfile: Gemfile
|
25
|
+
- ruby: 3.1.2
|
26
|
+
gemfile: Gemfile
|
23
27
|
env:
|
24
28
|
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
25
29
|
steps:
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,13 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
10
10
|
### Compatible changes
|
11
11
|
|
12
12
|
|
13
|
+
## 3.1.0 - 2022-06-01
|
14
|
+
|
15
|
+
### Compatible changes
|
16
|
+
|
17
|
+
- Add support for separation of positional and keyword arguments in ruby 3
|
18
|
+
|
19
|
+
|
13
20
|
## 3.0.1 - 2022-03-09
|
14
21
|
|
15
22
|
### Compatible changes
|
data/Gemfile.lock
CHANGED
data/lib/modularity/as_trait.rb
CHANGED
@@ -2,14 +2,19 @@ module Modularity
|
|
2
2
|
|
3
3
|
class ParametrizedTrait < Module
|
4
4
|
|
5
|
-
def initialize(blank_trait, args)
|
5
|
+
def initialize(blank_trait, args, kwargs)
|
6
6
|
@args = args
|
7
|
+
@kwargs = kwargs
|
7
8
|
@macro = blank_trait.instance_variable_get(:@modularity_macro)
|
8
9
|
include(blank_trait)
|
9
10
|
end
|
10
11
|
|
11
12
|
def included(base)
|
12
|
-
|
13
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7')
|
14
|
+
base.class_exec(*@args, &@macro)
|
15
|
+
else
|
16
|
+
base.class_exec(*@args, **@kwargs, &@macro)
|
17
|
+
end
|
13
18
|
end
|
14
19
|
|
15
20
|
end
|
@@ -27,9 +32,16 @@ module Modularity
|
|
27
32
|
|
28
33
|
end
|
29
34
|
|
30
|
-
|
31
|
-
|
32
|
-
|
35
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7')
|
36
|
+
def self.[](*args)
|
37
|
+
blank_trait = self
|
38
|
+
ParametrizedTrait.new(blank_trait, args, {})
|
39
|
+
end
|
40
|
+
else
|
41
|
+
def self.[](*args, **kwargs)
|
42
|
+
blank_trait = self
|
43
|
+
ParametrizedTrait.new(blank_trait, args, kwargs)
|
44
|
+
end
|
33
45
|
end
|
34
46
|
|
35
47
|
end
|
data/lib/modularity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modularity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Traits and partial classes for Ruby
|
14
14
|
email:
|