u-attributes 2.1.1 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +180 -41
- data/lib/micro/attributes.rb +69 -29
- data/lib/micro/attributes/diff.rb +26 -14
- data/lib/micro/attributes/features.rb +128 -75
- data/lib/micro/attributes/features/accept.rb +132 -0
- data/lib/micro/attributes/features/accept/strict.rb +26 -0
- data/lib/micro/attributes/features/activemodel_validations.rb +54 -10
- data/lib/micro/attributes/features/initialize.rb +3 -8
- data/lib/micro/attributes/features/keys_as_symbol.rb +31 -0
- data/lib/micro/attributes/macros.rb +150 -27
- data/lib/micro/attributes/utils.rb +47 -14
- data/lib/micro/attributes/version.rb +1 -1
- data/u-attributes.gemspec +1 -1
- metadata +5 -4
- data/assets/u-attributes_logo_v1.png +0 -0
- data/lib/micro/attributes/with.rb +0 -100
data/u-attributes.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
# Specify which files should be added to the gem when it is released.
|
21
21
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
22
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
23
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|assets)/}) }
|
24
24
|
end
|
25
25
|
spec.bindir = 'exe'
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: u-attributes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Serradura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kind
|
@@ -76,20 +76,21 @@ files:
|
|
76
76
|
- LICENSE.txt
|
77
77
|
- README.md
|
78
78
|
- Rakefile
|
79
|
-
- assets/u-attributes_logo_v1.png
|
80
79
|
- bin/console
|
81
80
|
- bin/setup
|
82
81
|
- lib/micro/attributes.rb
|
83
82
|
- lib/micro/attributes/diff.rb
|
84
83
|
- lib/micro/attributes/features.rb
|
84
|
+
- lib/micro/attributes/features/accept.rb
|
85
|
+
- lib/micro/attributes/features/accept/strict.rb
|
85
86
|
- lib/micro/attributes/features/activemodel_validations.rb
|
86
87
|
- lib/micro/attributes/features/diff.rb
|
87
88
|
- lib/micro/attributes/features/initialize.rb
|
88
89
|
- lib/micro/attributes/features/initialize/strict.rb
|
90
|
+
- lib/micro/attributes/features/keys_as_symbol.rb
|
89
91
|
- lib/micro/attributes/macros.rb
|
90
92
|
- lib/micro/attributes/utils.rb
|
91
93
|
- lib/micro/attributes/version.rb
|
92
|
-
- lib/micro/attributes/with.rb
|
93
94
|
- lib/u-attributes.rb
|
94
95
|
- test.sh
|
95
96
|
- u-attributes.gemspec
|
Binary file
|
@@ -1,100 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'micro/attributes/features/diff'
|
4
|
-
require 'micro/attributes/features/initialize'
|
5
|
-
require 'micro/attributes/features/initialize/strict'
|
6
|
-
require 'micro/attributes/features/activemodel_validations'
|
7
|
-
|
8
|
-
module Micro
|
9
|
-
module Attributes
|
10
|
-
module With
|
11
|
-
#
|
12
|
-
# Features
|
13
|
-
#
|
14
|
-
module Diff
|
15
|
-
def self.included(base)
|
16
|
-
base.send(:include, ::Micro::Attributes)
|
17
|
-
base.send(:include, ::Micro::Attributes::Features::Diff)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
module Initialize
|
22
|
-
def self.included(base)
|
23
|
-
base.send(:include, ::Micro::Attributes)
|
24
|
-
base.send(:include, ::Micro::Attributes::Features::Initialize)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
module ActiveModelValidations
|
29
|
-
def self.included(base)
|
30
|
-
base.send(:include, Initialize)
|
31
|
-
base.send(:include, ::Micro::Attributes::Features::ActiveModelValidations)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
module StrictInitialize
|
36
|
-
def self.included(base)
|
37
|
-
base.send(:include, Initialize)
|
38
|
-
base.send(:include, ::Micro::Attributes::Features::Initialize::Strict)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
#
|
43
|
-
# Combinations
|
44
|
-
#
|
45
|
-
module DiffAndInitialize
|
46
|
-
def self.included(base)
|
47
|
-
base.send(:include, ::Micro::Attributes)
|
48
|
-
base.send(:include, ::Micro::Attributes::Features::Initialize)
|
49
|
-
base.send(:include, ::Micro::Attributes::Features::Diff)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
module DiffAndStrictInitialize
|
54
|
-
def self.included(base)
|
55
|
-
base.send(:include, DiffAndInitialize)
|
56
|
-
base.send(:include, ::Micro::Attributes::Features::Initialize::Strict)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
module ActiveModelValidationsAndDiff
|
61
|
-
def self.included(base)
|
62
|
-
base.send(:include, ::Micro::Attributes)
|
63
|
-
base.send(:include, ::Micro::Attributes::Features::ActiveModelValidations)
|
64
|
-
base.send(:include, ::Micro::Attributes::Features::Diff)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
module ActiveModelValidationsAndInitialize
|
69
|
-
def self.included(base)
|
70
|
-
base.send(:include, ::Micro::Attributes)
|
71
|
-
base.send(:include, ::Micro::Attributes::Features::Initialize)
|
72
|
-
base.send(:include, ::Micro::Attributes::Features::ActiveModelValidations)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
module ActiveModelValidationsAndStrictInitialize
|
77
|
-
def self.included(base)
|
78
|
-
base.send(:include, ActiveModelValidationsAndInitialize)
|
79
|
-
base.send(:include, ::Micro::Attributes::Features::Initialize::Strict)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
module ActiveModelValidationsAndDiffAndInitialize
|
84
|
-
def self.included(base)
|
85
|
-
base.send(:include, ::Micro::Attributes)
|
86
|
-
base.send(:include, ::Micro::Attributes::Features::Initialize)
|
87
|
-
base.send(:include, ::Micro::Attributes::Features::ActiveModelValidations)
|
88
|
-
base.send(:include, ::Micro::Attributes::Features::Diff)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
module ActiveModelValidationsAndDiffAndStrictInitialize
|
93
|
-
def self.included(base)
|
94
|
-
base.send(:include, ActiveModelValidationsAndDiffAndInitialize)
|
95
|
-
base.send(:include, ::Micro::Attributes::Features::Initialize::Strict)
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|