sync_machine 0.2.0 → 0.3.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 +10 -27
- data/sync_machine.gemspec +0 -4
- metadata +3 -61
- data/lib/sync_machine/orm_adapter/active_record.rb +0 -20
- data/lib/sync_machine/orm_adapter/mongoid.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f35d59824e204c4e091d4858780d22960bcf8b7b
|
4
|
+
data.tar.gz: 0ef11300d2779f76e54e56e6bdf200177d30dca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f7fd84260f12a9d3111a2b487353f6c7581d9cb110b381c944d195d35f9b10f94bfec4024d796fab67706a5ac8308a0e74a6d235841f15e2004526906cafec6
|
7
|
+
data.tar.gz: 78ec45220800d4329659d67d13fa179362078af2e671018f962662872950ea07253d283f4ce58b6bfd87c6a976c46c3aacb414c77995835dde7e5ef9cadf1120
|
data/lib/sync_machine/version.rb
CHANGED
data/lib/sync_machine.rb
CHANGED
@@ -6,42 +6,25 @@ require "sync_machine/ensure_publication/deduper"
|
|
6
6
|
require "sync_machine/ensure_publication/publication_history"
|
7
7
|
require "sync_machine/ensure_publication_worker"
|
8
8
|
require "sync_machine/find_subjects_worker"
|
9
|
-
require "sync_machine/orm_adapter/active_record"
|
10
|
-
require "sync_machine/orm_adapter/mongoid"
|
11
9
|
require "sync_machine/version"
|
12
10
|
|
13
11
|
# A mini-framework for intelligently publishing complex model changes to an
|
14
12
|
# external API..
|
15
13
|
module SyncMachine
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
def self.setup_orm_adapter(orm_adapter)
|
27
|
-
self.orm_adapter = orm_adapter
|
28
|
-
orm_adapter.setup
|
14
|
+
# Force loading of all relevant classes. Should only be necessary when
|
15
|
+
# running your application in a way that it defers loading constants, i.e.,
|
16
|
+
# Rails' development or test mode.
|
17
|
+
def self.eager_load(base)
|
18
|
+
const_names = %w(
|
19
|
+
Payload FindSubjectsWorker EnsurePublicationWorker ChangeListener
|
20
|
+
)
|
21
|
+
const_names.each do |const_name|
|
22
|
+
base.const_get(const_name)
|
23
|
+
end
|
29
24
|
end
|
30
25
|
|
31
26
|
def self.extended(base)
|
32
27
|
base.mattr_accessor :subject_sym
|
33
|
-
|
34
|
-
# Force loading of all relevant classes. Should only be necessary when
|
35
|
-
# running your application in a way that it defers loading constants, i.e.,
|
36
|
-
# Rails' development or test mode.
|
37
|
-
def base.eager_load
|
38
|
-
const_names = %w(
|
39
|
-
Payload FindSubjectsWorker EnsurePublicationWorker ChangeListener
|
40
|
-
)
|
41
|
-
const_names.each do |const_name|
|
42
|
-
const_get(const_name)
|
43
|
-
end
|
44
|
-
end
|
45
28
|
end
|
46
29
|
|
47
30
|
def self.sync_module(child_const)
|
data/sync_machine.gemspec
CHANGED
@@ -41,11 +41,7 @@ Gem::Specification.new do |spec|
|
|
41
41
|
|
42
42
|
spec.add_development_dependency "bundler", "~> 2.0"
|
43
43
|
spec.add_development_dependency "factory_bot"
|
44
|
-
spec.add_development_dependency "fhwang-wisper-mongoid"
|
45
|
-
spec.add_development_dependency "mongoid"
|
46
44
|
spec.add_development_dependency "rake", "~> 10.0"
|
47
45
|
spec.add_development_dependency "rspec", "~> 3.0"
|
48
46
|
spec.add_development_dependency "rspec_junit_formatter"
|
49
|
-
spec.add_development_dependency "sqlite3"
|
50
|
-
spec.add_development_dependency "wisper-activerecord"
|
51
47
|
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.3.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-
|
11
|
+
date: 2019-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -80,34 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: fhwang-wisper-mongoid
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: mongoid
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
83
|
- !ruby/object:Gem::Dependency
|
112
84
|
name: rake
|
113
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,34 +122,6 @@ dependencies:
|
|
150
122
|
- - ">="
|
151
123
|
- !ruby/object:Gem::Version
|
152
124
|
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: sqlite3
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: wisper-activerecord
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - ">="
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
174
|
-
type: :development
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - ">="
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
181
125
|
description: A mini-framework for intelligently publishing complex model changes to
|
182
126
|
an external API.
|
183
127
|
email:
|
@@ -207,8 +151,6 @@ files:
|
|
207
151
|
- lib/sync_machine/ensure_publication/publication_history.rb
|
208
152
|
- lib/sync_machine/ensure_publication_worker.rb
|
209
153
|
- lib/sync_machine/find_subjects_worker.rb
|
210
|
-
- lib/sync_machine/orm_adapter/active_record.rb
|
211
|
-
- lib/sync_machine/orm_adapter/mongoid.rb
|
212
154
|
- lib/sync_machine/version.rb
|
213
155
|
- sync_machine.gemspec
|
214
156
|
homepage: https://github.com/fhwang/sync_machine
|
@@ -233,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
175
|
version: '0'
|
234
176
|
requirements: []
|
235
177
|
rubyforge_project:
|
236
|
-
rubygems_version: 2.
|
178
|
+
rubygems_version: 2.6.14
|
237
179
|
signing_key:
|
238
180
|
specification_version: 4
|
239
181
|
summary: A mini-framework for intelligently publishing complex model changes to an
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module SyncMachine
|
2
|
-
module OrmAdapter
|
3
|
-
# Adapt SyncMachine for use with ActiveRecord-based applications.
|
4
|
-
module ActiveRecord
|
5
|
-
def self.setup
|
6
|
-
require "active_record"
|
7
|
-
require "wisper/active_record"
|
8
|
-
Wisper::ActiveRecord.extend_all
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.change_listener_changed_keys(record)
|
12
|
-
record.previous_changes.keys
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.record_id_for_job(record_id)
|
16
|
-
record_id
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module SyncMachine
|
2
|
-
module OrmAdapter
|
3
|
-
# Adapt SyncMachine for use with Mongoid-based applications.
|
4
|
-
module Mongoid
|
5
|
-
def self.setup
|
6
|
-
require "mongoid"
|
7
|
-
require "wisper/mongoid"
|
8
|
-
Wisper::Mongoid.extend_all
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.change_listener_changed_keys(record)
|
12
|
-
record.changes.keys
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.record_id_for_job(record_id)
|
16
|
-
record_id.to_s
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|