disposable 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/Gemfile +3 -1
- data/Gemfile_builder_test.rb +6 -0
- data/README.md +4 -0
- data/Rakefile +8 -2
- data/disposable.gemspec +1 -2
- data/lib/disposable/twin/builder.rb +1 -0
- data/lib/disposable/twin/property/unnest.rb +4 -3
- data/lib/disposable/twin.rb +3 -4
- data/lib/disposable/version.rb +1 -1
- data/test/test_helper.rb +1 -1
- data/test/twin/builder_test.rb +4 -0
- metadata +7 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed1ac63bf425a0d6b32c6657b05391b2855c60f17313dbb5f0474db7031797d9
|
4
|
+
data.tar.gz: 768a3c634709bd4cdbab6fe6dc8c0a9203c9e98e41e66c923eba85eaf7f59c9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15c35ed92488b90304978ff44c029b4058eee7de078cb62cda44b7f25a076dc9b04bddef1d98a3b071fa7f16c2c7aaff2b3c1d49c24f1c4549bdf8c21c12c1c0
|
7
|
+
data.tar.gz: 4d3818b186417407e00510ddc8704f9e5e79f50c922427f2e73ac2c82ffe24a4dcfd663e005bc9ea7acd288171000cacac78722c625c94190ec1f83e34958b90
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# 0.6.0
|
2
|
+
|
3
|
+
* Remove `uber` gem.
|
4
|
+
* Remove `declarative-builder` dependency and make it optional. Add `gem "declarative-builder"` to your `Gemfile` should you need this feature.
|
5
|
+
|
1
6
|
# 0.5.0
|
2
7
|
|
3
8
|
* Upgrade `representable` to replace `Declarative::Option` with `Representable::Option` in order to support ruby-3 style of keyword arguments.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -640,3 +640,7 @@ Note that this will internally add a `parent` property.
|
|
640
640
|
|
641
641
|
* [Reform](https://github.com/apotonick/reform) forms are based on twins and add a little bit of form decoration on top. Every nested form is a twin.
|
642
642
|
* [Trailblazer](https://github.com/apotonick/trailblazer) uses twins as decorators and callbacks in operations to structure business logic.
|
643
|
+
|
644
|
+
## Development
|
645
|
+
|
646
|
+
* `rake test` runs all tests without `builder_test.rb`. For the latter, run `BUNDLE_GEMFILE=Gemfile_builder_test.rb bundle exec rake test_builder`
|
data/Rakefile
CHANGED
@@ -4,6 +4,12 @@ require "rake/testtask"
|
|
4
4
|
task :default => [:test]
|
5
5
|
Rake::TestTask.new(:test) do |test|
|
6
6
|
test.libs << 'test'
|
7
|
-
test.test_files = FileList['test/**/*_test.rb']
|
7
|
+
test.test_files = FileList['test/**/*_test.rb'] - ["test/twin/builder_test.rb"]
|
8
8
|
test.verbose = true
|
9
|
-
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Rake::TestTask.new(:test_builder) do |test|
|
12
|
+
test.libs << 'test'
|
13
|
+
test.test_files = FileList["test/twin/builder_test.rb"]
|
14
|
+
test.verbose = true
|
15
|
+
end
|
data/disposable.gemspec
CHANGED
@@ -16,9 +16,8 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test)/})
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency "uber", "< 0.2.0"
|
20
19
|
spec.add_dependency "declarative", ">= 0.0.9", "< 1.0.0"
|
21
|
-
spec.add_dependency "declarative-builder"
|
20
|
+
# spec.add_dependency "declarative-builder" #, ">= 0.2.0"
|
22
21
|
spec.add_dependency "representable", ">= 3.1.1", "< 3.2.0"
|
23
22
|
|
24
23
|
spec.add_development_dependency "bundler"#, "~> 1.3"
|
@@ -1,10 +1,11 @@
|
|
1
|
-
require "
|
1
|
+
require "forwardable"
|
2
2
|
|
3
3
|
module Disposable::Twin::Property
|
4
4
|
module Unnest
|
5
|
+
extend Forwardable
|
5
6
|
# TODO: test that nested properties options are "unnested", too, e.g. populator.
|
6
7
|
def self.included(includer)
|
7
|
-
includer.send(:include,
|
8
|
+
includer.send(:include, Forwardable)
|
8
9
|
end
|
9
10
|
|
10
11
|
def unnest(name, options)
|
@@ -15,7 +16,7 @@ module Disposable::Twin::Property
|
|
15
16
|
options = options.merge(virtual: true, _inherited: true, private_name: nil)
|
16
17
|
|
17
18
|
property(name, options)
|
18
|
-
|
19
|
+
def_delegators from, name, "#{name}="
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
data/lib/disposable/twin.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require "uber/inheritable_attr"
|
2
1
|
require "declarative/schema"
|
3
2
|
require "representable/decorator"
|
4
3
|
|
@@ -53,8 +52,8 @@ module Disposable
|
|
53
52
|
end
|
54
53
|
end
|
55
54
|
|
56
|
-
def collection(name, options
|
57
|
-
property(name, options.merge(collection: true), &block)
|
55
|
+
def collection(name, **options, &block)
|
56
|
+
property(name, **options.merge(collection: true), &block)
|
58
57
|
end
|
59
58
|
|
60
59
|
require "disposable/twin/property/unnest"
|
@@ -140,7 +139,7 @@ require "disposable/twin/definitions"
|
|
140
139
|
require "disposable/twin/collection"
|
141
140
|
require "disposable/twin/sync"
|
142
141
|
require "disposable/twin/save"
|
143
|
-
require "disposable/twin/builder"
|
142
|
+
# require "disposable/twin/builder"
|
144
143
|
require "disposable/twin/changed"
|
145
144
|
require "disposable/twin/property_processor"
|
146
145
|
require "disposable/twin/persisted"
|
data/lib/disposable/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
data/test/twin/builder_test.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: disposable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: uber
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "<"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.0
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "<"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.0
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: declarative
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,20 +30,6 @@ dependencies:
|
|
44
30
|
- - "<"
|
45
31
|
- !ruby/object:Gem::Version
|
46
32
|
version: 1.0.0
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: declarative-builder
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 0.2.0
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 0.2.0
|
61
33
|
- !ruby/object:Gem::Dependency
|
62
34
|
name: representable
|
63
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,6 +131,7 @@ files:
|
|
159
131
|
- ".gitignore"
|
160
132
|
- CHANGES.md
|
161
133
|
- Gemfile
|
134
|
+
- Gemfile_builder_test.rb
|
162
135
|
- LICENSE.txt
|
163
136
|
- README.md
|
164
137
|
- Rakefile
|
@@ -230,7 +203,7 @@ homepage: https://github.com/apotonick/disposable
|
|
230
203
|
licenses:
|
231
204
|
- MIT
|
232
205
|
metadata: {}
|
233
|
-
post_install_message:
|
206
|
+
post_install_message:
|
234
207
|
rdoc_options: []
|
235
208
|
require_paths:
|
236
209
|
- lib
|
@@ -245,8 +218,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
218
|
- !ruby/object:Gem::Version
|
246
219
|
version: '0'
|
247
220
|
requirements: []
|
248
|
-
rubygems_version: 3.
|
249
|
-
signing_key:
|
221
|
+
rubygems_version: 3.2.3
|
222
|
+
signing_key:
|
250
223
|
specification_version: 4
|
251
224
|
summary: Decorators on top of your ORM layer with change tracking, collection semantics
|
252
225
|
and nesting.
|