sync_machine 1.1.0 → 1.1.1

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: a87f8dc11ee9675808f703b22cbe674c17d1ed0e05896eb2b061c2a85062f5e9
4
- data.tar.gz: f21649d91d260a5c4499544881e14e615d9e657e6f776ef331e408021117c600
3
+ metadata.gz: 382d073ea7c61af6da6f38ca3a9c014e4913a7b5fd381b6a84e5f0403edacca8
4
+ data.tar.gz: 67e6f4008630a67ae804f9530f9905fcdd78137e991369f1f43412386dd2074b
5
5
  SHA512:
6
- metadata.gz: 9ed147b8be624b64816c1e9837265a05f2aa4322a82e7bfa75873199d24ab63a27ed133fbc6d3bcb51c625479a31a698b73a0eae43c1a09bfd222067c8d368b7
7
- data.tar.gz: 4634324884852210076115e04707590a2dda67d083d968fc5c45eb793370b8ff458c442e697ebdd5f4d14b3e8a03d3eaa1d6643e5a8a8ee8cae721fdbf3febe7
6
+ metadata.gz: eb69f9a240373ca62e4817c8f5c15c2dfafc14a1e46211dc254608cb031e423104e1ba2ee382e660543cc9414b63cdd49e2293502f5e6bc7434d8a706bbbf2bc
7
+ data.tar.gz: bcd1474c68ebb58a04169bdd26ae940268cb289968db9855a58e81b15607fae69f364040503d04cda10e03f4d5de8d23a51f4ca1b8d20450878460224d2c42d3
@@ -3,12 +3,11 @@ require "active_support/core_ext/string"
3
3
  require "active_support/hash_with_indifferent_access"
4
4
  require "sync_machine/change_listener"
5
5
  require "sync_machine/ensure_publication"
6
- require "sync_machine/ensure_publication/deduper"
7
- require "sync_machine/ensure_publication/publication_history"
8
6
  require "sync_machine/ensure_publication_worker"
9
7
  require "sync_machine/find_subjects_worker"
10
8
  require "sync_machine/orm_adapters"
11
9
  require "sync_machine/version"
10
+ require "sync_machine/railtie" if defined?(Rails::Railtie)
12
11
 
13
12
  # A mini-framework for intelligently publishing complex model changes to an
14
13
  # external API..
@@ -9,7 +9,6 @@ module SyncMachine
9
9
  class ChangeListener
10
10
  def self.inherited(base)
11
11
  base.cattr_accessor :model_syms
12
- base.subscribe
13
12
  end
14
13
 
15
14
  def self.listen_to_models(*model_syms)
@@ -1,3 +1,6 @@
1
+ require "sync_machine/ensure_publication/deduper"
2
+ require "sync_machine/ensure_publication/publication_history"
3
+
1
4
  module SyncMachine
2
5
  # Orchestrate logic around a change notification and whether to publish a new
3
6
  # document to the service.
@@ -1,8 +1,3 @@
1
- Bundler.require(:default)
2
-
3
- require "sync_machine/orm_adapters/active_record_adapter" if Module.const_defined?(:ActiveRecord)
4
- require "sync_machine/orm_adapters/mongoid_adapter" if Module.const_defined?(:Mongoid)
5
-
6
1
  module SyncMachine
7
2
  # Adapt generic SyncMachine functionality to a specific ORM.
8
3
  module OrmAdapters
@@ -0,0 +1,11 @@
1
+ module SyncMachine
2
+ # Initialize SyncMachine inside a Rails application.
3
+ class Railtie < Rails::Railtie
4
+ initializer :sync_machine do
5
+ Module.const_defined?(:ActiveRecord) && \
6
+ require("sync_machine/orm_adapters/active_record_adapter")
7
+ Module.const_defined?(:Mongoid) && \
8
+ require("sync_machine/orm_adapters/mongoid_adapter")
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module SyncMachine
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.1.1".freeze
3
3
  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: 1.1.0
4
+ version: 1.1.1
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-14 00:00:00.000000000 Z
11
+ date: 2019-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -235,6 +235,7 @@ files:
235
235
  - lib/sync_machine/orm_adapters.rb
236
236
  - lib/sync_machine/orm_adapters/active_record_adapter.rb
237
237
  - lib/sync_machine/orm_adapters/mongoid_adapter.rb
238
+ - lib/sync_machine/railtie.rb
238
239
  - lib/sync_machine/version.rb
239
240
  - sync_machine.gemspec
240
241
  homepage: https://github.com/fhwang/sync_machine