modularity 3.1.0 → 3.2.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 +4 -4
- data/.github/workflows/test.yml +2 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +2 -2
- data/README.md +4 -4
- 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: 3500f4c9d90a6b3b13f9a1a7aca62a5cc3ddcfc06865e26ccb7283ac9af29b97
|
4
|
+
data.tar.gz: b6dda8d76433413451f2fbafaa4b4fde63b16b5397942132cfb7b7a0eb1292d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 274f172610a0900ec8348a45488b8e54c061d5809942f16094f886e7e8e1ddf828635640568db36b0177d2b575c9f319ce75ba07bfb473b1a5e00180f3a6c0d0
|
7
|
+
data.tar.gz: 031fa42034a8453d3cd0e0742109c7a2652e4de41b1be4d04d891e20a74e822b2105257ebb6ec470e09eae12dd043cd51501faf05e97c1b44d2c435c287fc473
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
modularity (3.
|
4
|
+
modularity (3.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: http://rubygems.org/
|
@@ -9,7 +9,7 @@ GEM
|
|
9
9
|
byebug (11.1.3)
|
10
10
|
coderay (1.1.3)
|
11
11
|
diff-lcs (1.4.4)
|
12
|
-
gemika (0.
|
12
|
+
gemika (0.8.1)
|
13
13
|
method_source (1.0.0)
|
14
14
|
pry (0.13.1)
|
15
15
|
coderay (~> 1.1)
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ in a way that is less awkward than using modules.
|
|
13
13
|
|
14
14
|
Add the following to your `Gemfile`:
|
15
15
|
|
16
|
-
```
|
16
|
+
```ruby
|
17
17
|
gem 'modularity'
|
18
18
|
```
|
19
19
|
|
@@ -32,7 +32,7 @@ and macros.
|
|
32
32
|
|
33
33
|
Here is an example of a `strip_field` macro, which created setter methods that remove leading and trailing whitespace from newly assigned values:
|
34
34
|
|
35
|
-
```
|
35
|
+
```ruby
|
36
36
|
# app/models/article.rb
|
37
37
|
class Article < ActiveRecord::Base
|
38
38
|
include DoesStripFields[:name, :brand]
|
@@ -61,7 +61,7 @@ Using a module to add both instance methods and class methods is
|
|
61
61
|
[very awkward](http://redcorundum.blogspot.com/2006/06/mixing-in-class-methods.html).
|
62
62
|
Modularity does away with the clutter and lets you say this:
|
63
63
|
|
64
|
-
```
|
64
|
+
```ruby
|
65
65
|
# app/models/model.rb
|
66
66
|
class Model
|
67
67
|
include Mixin
|
@@ -88,7 +88,7 @@ Models are often concerned with multiple themes like "authentication", "contact
|
|
88
88
|
a couple of validations and callbacks here, and some method there. Modularity lets you organize your model into multiple
|
89
89
|
partial classes, so each file can deal with a single aspect of your model:
|
90
90
|
|
91
|
-
```
|
91
|
+
```ruby
|
92
92
|
# app/models/user.rb
|
93
93
|
class User < ActiveRecord::Base
|
94
94
|
include DoesAuthentication
|
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.
|
4
|
+
version: 3.2.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:
|
11
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Traits and partial classes for Ruby
|
14
14
|
email:
|