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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b0bba81d453e92fd4832f134f5fd24ef4f60eb13
4
- data.tar.gz: 538004835dbe737c7b50d92d2199fd1f34866092
2
+ SHA256:
3
+ metadata.gz: e8f915bfedcd7574bb9914b6ec0ae326f11c23ccf76593802cfe30290ef443e4
4
+ data.tar.gz: 4d87008448a205b0e231b11a8386f44a757533de95657b682966c9d94668b17f
5
5
  SHA512:
6
- metadata.gz: 6449394a6e1baa9b6f0a8eedaf9b29e028fa6f52e8fb0fc8675871e29a69773789da34a5d627398357426ef63ef8b5d5bc954ca27f6a40186cff4b0c36019210
7
- data.tar.gz: 7f1f4d31c93f85fa728402f873be52d8b7c6203fb7edffd019a223128eb395f3405dd3138b6a676b26be91507e12d362adc42795ad94eba871b2a2c2ca983da8
6
+ metadata.gz: c01e4a2ccb436bf1538c287f6c9a54464fbaefb5b6416fa6441ab0b5556137c9c9fff4ec8229a00383a4527fd0b71b5210915f7be1052083b0d5a8d46e57ead2
7
+ data.tar.gz: 4b810e9338f11d0e554c3d20717b4dde9dd3a400613149dd2ed25b9f89c4505118f912e2ac79d286f23e38ad848962d768191bce5a9cee927c9f1c3208be96d1
@@ -1,3 +1,3 @@
1
1
  module SyncMachine
2
- VERSION = "0.4.0".freeze
2
+ VERSION = "0.5.0".freeze
3
3
  end
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.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-18 00:00:00.000000000 Z
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
- rubyforge_project:
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