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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ee5b2f01534b1e0d6ce0390c3d7b082fcc9cf5ccbaea0bd554dcbb19d092e51
4
- data.tar.gz: b905d21be9d1c94809b9de661698e4880a5a77d532473d7eacff000bca15befe
3
+ metadata.gz: ed1ac63bf425a0d6b32c6657b05391b2855c60f17313dbb5f0474db7031797d9
4
+ data.tar.gz: 768a3c634709bd4cdbab6fe6dc8c0a9203c9e98e41e66c923eba85eaf7f59c9f
5
5
  SHA512:
6
- metadata.gz: e6a09f8afd4c405cd9e54f0581622bfdce3b4e5df0e5e958db01cb57a9d035acbb01ad67fb32cbe3ddb6f9dbc94155d08617ef8f77b686aafe0aa367bb887598
7
- data.tar.gz: 555906bb352543b9f123cb891f8bfdb58ce98e9888a8b9f12333170cef13b56768c665272727d9f472f545a88f24b0d4561aea261acba18221b9aea31c8b52ea
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
@@ -7,4 +7,6 @@ gem "minitest-line"
7
7
  gem gem_name, dependency
8
8
  end
9
9
 
10
- gem "sqlite3", ENV.fetch('ACTIVERECORD', '5.2').to_f >= 6 ? '~> 1.4' : '~> 1.3.0'
10
+ gem "sqlite3"#, ENV.fetch('ACTIVERECORD', '5.2').to_f >= 6 ? '~> 1.4' : '~> 1.3.0'
11
+
12
+ # gem "declarative-builder"
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+ gemspec
3
+ gem "minitest-line"
4
+ gem "sqlite3"
5
+
6
+ gem "declarative-builder", "0.2.0"
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", "~> 0.2.0"
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,3 +1,4 @@
1
+ gem "declarative-builder", "0.2.0"
1
2
  require "declarative/builder"
2
3
 
3
4
  module Disposable
@@ -1,10 +1,11 @@
1
- require "uber/delegates"
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, Uber::Delegates)
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
- delegates from, name, "#{name}="
19
+ def_delegators from, name, "#{name}="
19
20
  end
20
21
  end
21
22
  end
@@ -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={}, &block)
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"
@@ -1,3 +1,3 @@
1
1
  module Disposable
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
data/test/test_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require "disposable"
2
2
  require "minitest/autorun"
3
- require "representable/debug"
3
+ # require "representable/debug"
4
4
  # require "pp"
5
5
  require "declarative/testing"
6
6
 
@@ -1,5 +1,9 @@
1
+ # BUNDLE_GEMFILE=Gemfile_builder_test.rb be rake test_builder
2
+
1
3
  require "test_helper"
2
4
 
5
+ require "disposable/twin/builder"
6
+
3
7
  class BuilderTest < MiniTest::Spec
4
8
  module Model
5
9
  Song = Struct.new(:id, :title)
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.5.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-04-18 00:00:00.000000000 Z
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.0.8
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.