collab 0.1.2 → 0.1.7

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: a013e8f3a8b9d0f207190ad866745dd008a6c3920419128270e850c7e17db029
4
- data.tar.gz: 54a7d5b787d2295f8aa60530ac38b6e3a433b4067dedb02223e7ca3874dabf2a
3
+ metadata.gz: a0a566794428295f9b9ff7c624b1c6f936804bc071756766f340df9637e16938
4
+ data.tar.gz: 0ccfbe46ff5f6273bfc14aac4d9e22e21a7d20e0a23b4acdfa63ef8968ea0ee7
5
5
  SHA512:
6
- metadata.gz: c8f573deab8a0738a93f7680d7f3ad65af29f45c832365ef98702166456a5036e445766d7abc5b6784b925be6c4b0e0e31db7f2dfdf5144a2fa9af943b06a758
7
- data.tar.gz: a59241f5a3c9511cb5fdd3e6644cfe23be09c4db2072c95c0f9e2ad7fdce5986ae51f6993dc72c74bc533282123d671786ef49a9ba6f08de0baa406bd84b0cd5
6
+ metadata.gz: cd20428b6337a7f7609825d01369b3ac0374c17e72eafb81d3ed6239f01ca7e8061ca4f620e7e0278f279ca2ffbe0608a8fc3612f77de2e733470f09456a3e0c
7
+ data.tar.gz: cc80222ba503f5b2605f77e81615397527fea9865d4b599657bd95226b4eda8bca1979347c2ddbdd6ddbe0ffcea098613b12fddd00c2b745755fc2f23f0e7ab5
@@ -1,13 +1,13 @@
1
- require "collab/config"
2
1
  require "collab/railtie"
3
2
 
4
3
  module Collab
5
- def config
4
+ def self.config
6
5
  @config ||= Collab::Config.new
7
6
  return @config unless block_given?
8
7
  yield @config
9
8
  end
10
9
 
10
+ autoload "Config", "collab/config"
11
11
  autoload "Bridge", "collab/bridge"
12
12
  autoload "HasCollaborativeDocument", "collab/has_collaborative_document"
13
13
 
@@ -31,24 +31,24 @@ module Collab
31
31
  @current ||= new
32
32
  end
33
33
 
34
- def call(name, data = nil, schemaName:)
35
- req = {name: name, data: data, schemaPackage: ::Collab.config.schema_package, schemaName: schemaName}
34
+ def call(name, data = nil, schema_name:)
35
+ req = {name: name, data: data, schemaPackage: ::Collab.config.schema_package, schemaName: schema_name}
36
36
  @node.puts(JSON.generate(req))
37
37
  res = JSON.parse(@node.gets)
38
38
  raise ::Collab::Bridge::JSRuntimeError.new(res["error"]) if res["error"]
39
39
  res["result"]
40
40
  end
41
41
 
42
- def apply_transaction(document, transaction, schemaName:)
43
- call("applyTransaction", {doc: document, data: transaction}, schemaName: schemaName)
42
+ def apply_transaction(document, transaction, schema_name:)
43
+ call("applyTransaction", {doc: document, data: transaction}, schema_name: schemaName)
44
44
  end
45
45
 
46
- def html_to_document(html, schemaName:)
47
- call("htmlToDoc", html, schemaName: schemaName)
46
+ def html_to_document(html, schema_name:)
47
+ call("htmlToDoc", html, schema_name: schema_name)
48
48
  end
49
49
 
50
- def document_to_html(document, schemaName:)
51
- call("docToHtml", document, schemaName: schemaName)
50
+ def document_to_html(document, schema_name:)
51
+ call("docToHtml", document, schema_name: schema_name)
52
52
  end
53
53
  end
54
54
  end
@@ -1,3 +1,3 @@
1
1
  module Collab
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.7'
3
3
  end
@@ -17,7 +17,7 @@ class CreateCollabTables < ActiveRecord::Migration[6.0]
17
17
  end
18
18
 
19
19
  create_table :collab_document_transactions, id: false do |t|
20
- t.references :document, null: false, foreign_key: {to_table: :collaborative_documents}, type: :uuid, index: false
20
+ t.references :document, null: false, foreign_key: {to_table: :collab_documents}, type: :uuid, index: false
21
21
 
22
22
  t.jsonb :steps, array: true, null: false
23
23
  t.integer :document_version, null: false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: collab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Aubin