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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: d74a6108d033784c23a0dbcbf0212523dbb8498b55b867d630272806f726ae19
4
- data.tar.gz: 18b5753d9abff76d0dec3c5d98e5b0660deeb45ae525eb4db3aea25741a33f60
2
+ SHA1:
3
+ metadata.gz: f35d59824e204c4e091d4858780d22960bcf8b7b
4
+ data.tar.gz: 0ef11300d2779f76e54e56e6bdf200177d30dca1
5
5
  SHA512:
6
- metadata.gz: 1c7100fd78a1809760743413f3024779243b1bb6d2d2963b1ad074b92e46cf1f196f0ab9b446fd2a7179bfe36ee0bfefdfd42ff82feccb8e97ca6091b7063ca9
7
- data.tar.gz: c09a284f84e695dcb6a8935d1ca8510589e5094f235da6c011d14c7293aca9629990c0c92897ccba08f7d538114490a6fbcb703e1c56dcb707789348faadaef8
6
+ metadata.gz: 2f7fd84260f12a9d3111a2b487353f6c7581d9cb110b381c944d195d35f9b10f94bfec4024d796fab67706a5ac8308a0e74a6d235841f15e2004526906cafec6
7
+ data.tar.gz: 78ec45220800d4329659d67d13fa179362078af2e671018f962662872950ea07253d283f4ce58b6bfd87c6a976c46c3aacb414c77995835dde7e5ef9cadf1120
@@ -1,3 +1,3 @@
1
1
  module SyncMachine
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
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
- mattr_accessor :orm_adapter
17
-
18
- def self.use_active_record
19
- setup_orm_adapter(OrmAdapter::ActiveRecord)
20
- end
21
-
22
- def self.use_mongoid
23
- setup_orm_adapter(OrmAdapter::Mongoid)
24
- end
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.2.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-04-08 00:00:00.000000000 Z
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.7.8
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