disposable 0.6.1 → 0.6.2

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: e381c394b04f502f9af8ba27192e898d4e1f1214e85e441b50182f5f353e1137
4
- data.tar.gz: 4a6b6a0e270c0229f5bed96d51d2b4a41bd1a66bd2b80293a61e1cab74803d52
3
+ metadata.gz: 503eaa80c2c7e5c2808e22cfff709fa359fc3c582b8db5c7917800c406ec55db
4
+ data.tar.gz: 28b2091c2f06ff81e5ee2bbed56a496b91421753afd97782f3a2e3f298dbc53b
5
5
  SHA512:
6
- metadata.gz: dfeeff838ca34e37a5741cb7ac7829a7be52248b8b5a8fe16c7d7dbef32e13dffe7d543e668bc1cfb674daeeb75d7d144bab1b5caf15d892b4a427b1dedf7e44
7
- data.tar.gz: 154949ab53a0508659db1d47acc9b9f797870724d554c2935fb92764e6156308ab00c5d5ec33629b8f3c37204c5fda4cb2bae879b5f87cd3b6d879889bf39ecb
6
+ metadata.gz: 9ddecb0c8eaa4d66162d059c23fb2f495658fd67e5bc35aaf568cdf39bb9d21b4816703577a732daac330e279876b06cfec6a624eeb7c7a6da724d764e224c27
7
+ data.tar.gz: 9728842db88f5794ccf1e4729801d28badf5389cabdd0bda11c5391283ab41317275a5fe0aefa3cb259e2b63026de5174aba51e38bf6a87b06c968b0e50a6c22
data/CHANGES.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.6.2
2
+
3
+ * Remove `Forwardable` from `Unnest` and refrain from including it into the `Twin` class.
4
+ This may overwrite the same-named `ActiveSupport::delegate` method and breaks things.
5
+ Instead, do manual delegation and plan for 2023 to allow using `Forwardable.delegate(target, what, where)`.
6
+
7
+
1
8
  # 0.6.1
2
9
 
3
10
  * Remove `**options` argument from `#property` as it's inconsistent with underlying gems.
data/Gemfile CHANGED
@@ -7,6 +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", '~> 1.4' # => , ENV.fetch('ACTIVERECORD', '5.2').to_f >= 6 ? '~> 1.4' : '~> 1.3.0'
11
11
 
12
12
  # gem "declarative-builder"
@@ -1,12 +1,6 @@
1
- require "forwardable"
2
-
3
1
  module Disposable::Twin::Property
4
2
  module Unnest
5
- extend Forwardable
6
3
  # TODO: test that nested properties options are "unnested", too, e.g. populator.
7
- def self.included(includer)
8
- includer.send(:include, Forwardable)
9
- end
10
4
 
11
5
  def unnest(name, options)
12
6
  from = options.delete(:from)
@@ -16,7 +10,15 @@ module Disposable::Twin::Property
16
10
  options = options.merge(virtual: true, _inherited: true, private_name: nil)
17
11
 
18
12
  property(name, options)
19
- def_delegators from, name, "#{name}="
13
+ # def_delegators from, name, "#{name}=" # FIXME: this overwrites ActiveSupport#delegate in some cases.
14
+
15
+ define_method name do
16
+ send(from).send(name) # TODO: fix Forwardable in Ruby.
17
+ end
18
+
19
+ define_method "#{name}=" do |value|
20
+ send(from).send("#{name}=", value)
21
+ end
20
22
  end
21
23
  end
22
24
  end
@@ -28,6 +28,10 @@ module Disposable
28
28
  Definition::Each.new(self.class.definitions) # TODO: change this interface.
29
29
  end
30
30
 
31
+ def self.schema
32
+ Definition::Each.new(definitions)
33
+ end
34
+
31
35
  class << self
32
36
  def default_nested_class
33
37
  Twin
@@ -1,3 +1,3 @@
1
1
  module Disposable
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disposable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-20 00:00:00.000000000 Z
11
+ date: 2021-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: declarative
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []
221
- rubygems_version: 3.0.8
221
+ rubygems_version: 3.2.3
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: Decorators on top of your ORM layer with change tracking, collection semantics