collab 0.1.4 → 0.1.9

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: 4bba7230630da1fbf893ea7010418234856b64c5e8baab36304f2d8acad6d66b
4
- data.tar.gz: f835b2c238d783f9b5e864f69a961678e75f3d08c295ed8e0fc93cf2f820ef9f
3
+ metadata.gz: 7d18b58e0a43c89ef45deb94871423015a54a755cd565ef86e9025bf5ca50e7a
4
+ data.tar.gz: 805a04e74c43e4d2deb0514be61ccce650d2952bac9538f1d1d9721ef9e71678
5
5
  SHA512:
6
- metadata.gz: c838625434341542fc8d4942033a562c96f33277c231eff5261ab42f446b8ad9b1a38773d00d2cf1b1610be6a1b1117d7f23036a336685e2a83c13264e4c3c4c
7
- data.tar.gz: '092f0ece5235a77d3a43074a5c56cee20455c5370470e60c89d9270cfffe97f6afcde443281c1a24c2655efaa34bfc42060a306c33bfa13e783e75d8f6ce5bad'
6
+ metadata.gz: bd446fb6609196d039e53f18387f95da8fbc416a96b2e3e59a18ada3468bcf88957cb1b77b7e49debe0bb4691acc5182a952c9abeceab9e69a07528e8977ba54
7
+ data.tar.gz: da896456dce781c41236d76cc914cb21c27e565ba269e0093d8de8d5f05e0a08685af6674a5791753cd94a8499b9274efb8a21bd790b139f4b337975d3fdd475
@@ -23,7 +23,7 @@ module Collab
23
23
 
24
24
  def initialize
25
25
  @node = Dir.chdir(Rails.root) do
26
- IO.popen(["node", "-e", %q{"require('rails-collab-server')"}], "r+")
26
+ IO.popen(["node", "-e", "require('rails-collab-server')"], "r+")
27
27
  end
28
28
  end
29
29
 
@@ -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: schema_name)
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
@@ -29,8 +29,6 @@ module Collab
29
29
  end
30
30
 
31
31
  def from_html(html)
32
- raise "cannot override a persisted document" if self.persisted?
33
-
34
32
  self.document = ::Collab::Bridge.current.html_to_document(html, schema_name: schema_name)
35
33
  end
36
34
 
@@ -1,3 +1,3 @@
1
1
  module Collab
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.9'
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.4
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Aubin