sync_machine 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/sync_machine/version.rb +1 -1
- data/lib/sync_machine.rb +5 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e8f915bfedcd7574bb9914b6ec0ae326f11c23ccf76593802cfe30290ef443e4
|
4
|
+
data.tar.gz: 4d87008448a205b0e231b11a8386f44a757533de95657b682966c9d94668b17f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c01e4a2ccb436bf1538c287f6c9a54464fbaefb5b6416fa6441ab0b5556137c9c9fff4ec8229a00383a4527fd0b71b5210915f7be1052083b0d5a8d46e57ead2
|
7
|
+
data.tar.gz: 4b810e9338f11d0e554c3d20717b4dde9dd3a400613149dd2ed25b9f89c4505118f912e2ac79d286f23e38ad848962d768191bce5a9cee927c9f1c3208be96d1
|
data/lib/sync_machine/version.rb
CHANGED
data/lib/sync_machine.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "active_support/core_ext/class"
|
2
2
|
require "active_support/core_ext/string"
|
3
|
+
require "active_support/hash_with_indifferent_access"
|
3
4
|
require "sync_machine/change_listener"
|
4
5
|
require "sync_machine/ensure_publication"
|
5
6
|
require "sync_machine/ensure_publication/deduper"
|
@@ -25,17 +26,19 @@ module SyncMachine
|
|
25
26
|
|
26
27
|
def self.extended(base)
|
27
28
|
base.mattr_accessor :subject_sym
|
29
|
+
base.mattr_accessor :subject_opts
|
28
30
|
end
|
29
31
|
|
30
32
|
def self.sync_module(child_const)
|
31
33
|
child_const.name.split(/::/)[0..-2].join('::').constantize
|
32
34
|
end
|
33
35
|
|
34
|
-
def subject(subject_sym)
|
36
|
+
def subject(subject_sym, opts = {})
|
35
37
|
self.subject_sym = subject_sym
|
38
|
+
self.subject_opts = ActiveSupport::HashWithIndifferentAccess.new(opts)
|
36
39
|
end
|
37
40
|
|
38
41
|
def subject_class
|
39
|
-
subject_sym.to_s.camelize.constantize
|
42
|
+
(subject_opts[:class_name] || subject_sym.to_s.camelize).constantize
|
40
43
|
end
|
41
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sync_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francis Hwang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -174,8 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
- !ruby/object:Gem::Version
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
|
-
|
178
|
-
rubygems_version: 2.6.14
|
177
|
+
rubygems_version: 3.0.6
|
179
178
|
signing_key:
|
180
179
|
specification_version: 4
|
181
180
|
summary: A mini-framework for intelligently publishing complex model changes to an
|