y-rb 0.1.3 → 0.1.4.alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/yrb/Cargo.lock +623 -0
- data/ext/yrb/Cargo.toml +17 -0
- data/ext/yrb/extconf.rb +6 -0
- data/ext/yrb/src/lib.rs +476 -0
- data/ext/yrb/src/utils.rs +36 -0
- data/ext/yrb/src/yany.rs +44 -0
- data/ext/yrb/src/yarray.rs +175 -0
- data/ext/yrb/src/yattrs.rs +48 -0
- data/ext/yrb/src/ydoc.rs +39 -0
- data/ext/yrb/src/ymap.rs +165 -0
- data/ext/yrb/src/ytext.rs +228 -0
- data/ext/yrb/src/ytransaction.rs +58 -0
- data/ext/yrb/src/yvalue.rs +235 -0
- data/ext/yrb/src/yxml_element.rs +225 -0
- data/ext/yrb/src/yxml_text.rs +154 -0
- data/lib/y/doc.rb +2 -2
- data/lib/y/text.rb +9 -7
- data/lib/y/version.rb +1 -1
- data/lib/y.rb +16 -0
- metadata +48 -50
- data/.dockerignore +0 -5
- data/.editorconfig +0 -16
- data/.rspec +0 -3
- data/.rubocop.yml +0 -23
- data/.rustfmt.toml +0 -74
- data/.yardopts +0 -2
- data/Cargo.toml +0 -29
- data/Cross.toml +0 -17
- data/Gemfile +0 -13
- data/Gemfile.lock +0 -93
- data/LICENSE.txt +0 -21
- data/README.md +0 -102
- data/Rakefile +0 -39
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/build/Dockerfile +0 -18
- data/build/build.rb +0 -105
- data/build/entrypoint.sh +0 -3
- data/docs/decisions.md +0 -64
- data/docs/examples.md +0 -16
- data/docs/release.md +0 -36
- data/ext/Rakefile +0 -9
- data/lib/y/rb.rb +0 -27
- data/src/lib.rs +0 -248
- data/src/util.rs +0 -146
- data/src/yarray.rs +0 -184
- data/src/ydoc.rs +0 -71
- data/src/ymap.rs +0 -199
- data/src/ytext.rs +0 -204
- data/src/ytransaction.rs +0 -102
- data/src/yxml.rs +0 -550
data/lib/y/text.rb
CHANGED
@@ -87,7 +87,7 @@ module Y
|
|
87
87
|
#
|
88
88
|
# text.empty? # true
|
89
89
|
#
|
90
|
-
# @return [
|
90
|
+
# @return [TrueClass,FalseClass]
|
91
91
|
def empty?
|
92
92
|
length.zero?
|
93
93
|
end
|
@@ -122,8 +122,7 @@ module Y
|
|
122
122
|
if value.is_a?(String)
|
123
123
|
ytext_insert(transaction, index, value) if attrs.nil?
|
124
124
|
unless attrs.nil?
|
125
|
-
|
126
|
-
attrs)
|
125
|
+
ytext_insert_with_attributes(transaction, index, value, attrs)
|
127
126
|
end
|
128
127
|
return nil
|
129
128
|
end
|
@@ -131,8 +130,7 @@ module Y
|
|
131
130
|
if can_insert?(value)
|
132
131
|
ytext_insert_embed(transaction, index, value) if attrs.nil?
|
133
132
|
unless attrs.nil?
|
134
|
-
|
135
|
-
attrs)
|
133
|
+
ytext_insert_embed_with_attributes(transaction, index, value, attrs)
|
136
134
|
end
|
137
135
|
return nil
|
138
136
|
end
|
@@ -279,6 +277,8 @@ module Y
|
|
279
277
|
value.is_a?(Hash)
|
280
278
|
end
|
281
279
|
|
280
|
+
# rubocop:disable Layout/LineLength
|
281
|
+
|
282
282
|
# @!method ytext_insert(transaction, index, chunk)
|
283
283
|
# Insert into text at position
|
284
284
|
#
|
@@ -295,7 +295,7 @@ module Y
|
|
295
295
|
# @param [Y::Text, Y::Array, Y::Map] content
|
296
296
|
# @return [nil]
|
297
297
|
|
298
|
-
# @!method
|
298
|
+
# @!method ytext_insert_embed_with_attributes(transaction, index, embed, attrs)
|
299
299
|
# Insert into text at position
|
300
300
|
#
|
301
301
|
# @param [Y::Transaction] transaction
|
@@ -304,7 +304,7 @@ module Y
|
|
304
304
|
# @param [Hash] attrs
|
305
305
|
# @return [nil]
|
306
306
|
|
307
|
-
# @!method
|
307
|
+
# @!method ytext_insert_with_attributes(transaction, index, chunk, attrs)
|
308
308
|
# Insert into text at position
|
309
309
|
#
|
310
310
|
# @param [Y::Transaction] transaction
|
@@ -359,6 +359,8 @@ module Y
|
|
359
359
|
# @param [Integer] subscription_id
|
360
360
|
# @return [void]
|
361
361
|
|
362
|
+
# rubocop:enable Layout/LineLength
|
363
|
+
|
362
364
|
# A reference to the current active transaction of the document this map
|
363
365
|
# belongs to.
|
364
366
|
#
|
data/lib/y/version.rb
CHANGED
data/lib/y.rb
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# load native extension
|
4
|
+
begin
|
5
|
+
ruby_version = /(\d+\.\d+)/.match(::RUBY_VERSION)
|
6
|
+
require_relative "#{ruby_version}/yrb"
|
7
|
+
rescue LoadError
|
8
|
+
require "yrb"
|
9
|
+
end
|
10
|
+
|
11
|
+
require_relative "y/array"
|
12
|
+
require_relative "y/doc"
|
13
|
+
require_relative "y/map"
|
14
|
+
require_relative "y/text"
|
15
|
+
require_relative "y/xml"
|
16
|
+
require_relative "y/transaction"
|
17
|
+
require_relative "y/version"
|
18
|
+
|
3
19
|
module Y
|
4
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: y-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4.alpha.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hannes Moser
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -25,109 +25,107 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '13.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rb_sys
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.9.30
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.9.30
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: activesupport
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
type: :
|
47
|
+
version: 6.1.6.1
|
48
|
+
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 6.1.6.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: minitar
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '0.9'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '0.9'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rake-compiler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.2.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 1.2.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake-compiler-dock
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.2.2
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.2.2
|
83
97
|
description: Ruby bindings for yrs. Yrs "wires" is a Rust port of the Yjs framework.
|
84
98
|
email:
|
85
99
|
- hmoser@gitlab.com
|
86
100
|
- box@hannesmoser.at
|
87
101
|
executables: []
|
88
102
|
extensions:
|
89
|
-
- ext/
|
103
|
+
- ext/yrb/extconf.rb
|
90
104
|
extra_rdoc_files: []
|
91
105
|
files:
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
107
|
-
- build/Dockerfile
|
108
|
-
- build/build.rb
|
109
|
-
- build/entrypoint.sh
|
110
|
-
- docs/decisions.md
|
111
|
-
- docs/examples.md
|
112
|
-
- docs/release.md
|
113
|
-
- ext/Rakefile
|
106
|
+
- ext/yrb/Cargo.lock
|
107
|
+
- ext/yrb/Cargo.toml
|
108
|
+
- ext/yrb/extconf.rb
|
109
|
+
- ext/yrb/src/lib.rs
|
110
|
+
- ext/yrb/src/utils.rs
|
111
|
+
- ext/yrb/src/yany.rs
|
112
|
+
- ext/yrb/src/yarray.rs
|
113
|
+
- ext/yrb/src/yattrs.rs
|
114
|
+
- ext/yrb/src/ydoc.rs
|
115
|
+
- ext/yrb/src/ymap.rs
|
116
|
+
- ext/yrb/src/ytext.rs
|
117
|
+
- ext/yrb/src/ytransaction.rs
|
118
|
+
- ext/yrb/src/yvalue.rs
|
119
|
+
- ext/yrb/src/yxml_element.rs
|
120
|
+
- ext/yrb/src/yxml_text.rs
|
114
121
|
- lib/y.rb
|
115
122
|
- lib/y/array.rb
|
116
123
|
- lib/y/doc.rb
|
117
124
|
- lib/y/map.rb
|
118
|
-
- lib/y/rb.rb
|
119
125
|
- lib/y/text.rb
|
120
126
|
- lib/y/transaction.rb
|
121
127
|
- lib/y/version.rb
|
122
128
|
- lib/y/xml.rb
|
123
|
-
- src/lib.rs
|
124
|
-
- src/util.rs
|
125
|
-
- src/yarray.rs
|
126
|
-
- src/ydoc.rs
|
127
|
-
- src/ymap.rs
|
128
|
-
- src/ytext.rs
|
129
|
-
- src/ytransaction.rs
|
130
|
-
- src/yxml.rs
|
131
129
|
homepage: https://github.com/y-crdt/yrb
|
132
130
|
licenses:
|
133
131
|
- MIT
|
@@ -145,12 +143,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
143
|
requirements:
|
146
144
|
- - ">="
|
147
145
|
- !ruby/object:Gem::Version
|
148
|
-
version: 2.
|
146
|
+
version: 2.7.0
|
149
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
148
|
requirements:
|
151
|
-
- - "
|
149
|
+
- - ">"
|
152
150
|
- !ruby/object:Gem::Version
|
153
|
-
version:
|
151
|
+
version: 1.3.1
|
154
152
|
requirements: []
|
155
153
|
rubygems_version: 3.2.32
|
156
154
|
signing_key:
|
data/.editorconfig
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# EditorConfig is awesome: https://EditorConfig.org
|
2
|
-
|
3
|
-
root = true
|
4
|
-
|
5
|
-
[*]
|
6
|
-
end_of_line = lf
|
7
|
-
insert_final_newline = true
|
8
|
-
charset = utf-8
|
9
|
-
|
10
|
-
[*.{rb,yml}]
|
11
|
-
indent_style = space
|
12
|
-
indent_size = 2
|
13
|
-
|
14
|
-
[*.rs]
|
15
|
-
indent_style = space
|
16
|
-
indent_size = 4
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
NewCops: enable
|
3
|
-
TargetRubyVersion: 2.6
|
4
|
-
|
5
|
-
Metrics/BlockLength:
|
6
|
-
Exclude:
|
7
|
-
- spec/y/*_spec.rb
|
8
|
-
|
9
|
-
Style/Documentation:
|
10
|
-
Enabled: false
|
11
|
-
|
12
|
-
Style/StringLiterals:
|
13
|
-
Enabled: true
|
14
|
-
EnforcedStyle: double_quotes
|
15
|
-
|
16
|
-
Style/StringLiteralsInInterpolation:
|
17
|
-
Enabled: true
|
18
|
-
EnforcedStyle: double_quotes
|
19
|
-
|
20
|
-
Layout/LineLength:
|
21
|
-
Max: 80
|
22
|
-
Exclude:
|
23
|
-
- y-rb.gemspec
|
data/.rustfmt.toml
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
max_width = 80
|
2
|
-
hard_tabs = false
|
3
|
-
tab_spaces = 4
|
4
|
-
newline_style = "Auto"
|
5
|
-
indent_style = "Block"
|
6
|
-
use_small_heuristics = "Default"
|
7
|
-
fn_call_width = 60
|
8
|
-
attr_fn_like_width = 70
|
9
|
-
struct_lit_width = 18
|
10
|
-
struct_variant_width = 35
|
11
|
-
array_width = 60
|
12
|
-
chain_width = 60
|
13
|
-
single_line_if_else_max_width = 50
|
14
|
-
wrap_comments = false
|
15
|
-
format_code_in_doc_comments = false
|
16
|
-
comment_width = 80
|
17
|
-
normalize_comments = false
|
18
|
-
normalize_doc_attributes = false
|
19
|
-
license_template_path = ""
|
20
|
-
format_strings = false
|
21
|
-
format_macro_matchers = false
|
22
|
-
format_macro_bodies = true
|
23
|
-
empty_item_single_line = true
|
24
|
-
struct_lit_single_line = true
|
25
|
-
fn_single_line = false
|
26
|
-
where_single_line = false
|
27
|
-
imports_indent = "Block"
|
28
|
-
imports_layout = "Mixed"
|
29
|
-
imports_granularity = "Preserve"
|
30
|
-
group_imports = "Preserve"
|
31
|
-
reorder_imports = true
|
32
|
-
reorder_modules = true
|
33
|
-
reorder_impl_items = false
|
34
|
-
type_punctuation_density = "Wide"
|
35
|
-
space_before_colon = false
|
36
|
-
space_after_colon = true
|
37
|
-
spaces_around_ranges = false
|
38
|
-
binop_separator = "Front"
|
39
|
-
remove_nested_parens = true
|
40
|
-
combine_control_expr = true
|
41
|
-
overflow_delimited_expr = false
|
42
|
-
struct_field_align_threshold = 0
|
43
|
-
enum_discrim_align_threshold = 0
|
44
|
-
match_arm_blocks = true
|
45
|
-
match_arm_leading_pipes = "Never"
|
46
|
-
force_multiline_blocks = false
|
47
|
-
fn_args_layout = "Tall"
|
48
|
-
brace_style = "SameLineWhere"
|
49
|
-
control_brace_style = "AlwaysSameLine"
|
50
|
-
trailing_semicolon = true
|
51
|
-
trailing_comma = "Never"
|
52
|
-
match_block_trailing_comma = false
|
53
|
-
blank_lines_upper_bound = 1
|
54
|
-
blank_lines_lower_bound = 0
|
55
|
-
edition = "2015"
|
56
|
-
version = "One"
|
57
|
-
inline_attribute_width = 0
|
58
|
-
merge_derives = true
|
59
|
-
use_try_shorthand = false
|
60
|
-
use_field_init_shorthand = false
|
61
|
-
force_explicit_abi = true
|
62
|
-
condense_wildcard_suffixes = false
|
63
|
-
color = "Auto"
|
64
|
-
unstable_features = false
|
65
|
-
disable_all_formatting = false
|
66
|
-
skip_children = false
|
67
|
-
hide_parse_errors = false
|
68
|
-
error_on_line_overflow = false
|
69
|
-
error_on_unformatted = false
|
70
|
-
report_todo = "Never"
|
71
|
-
report_fixme = "Never"
|
72
|
-
ignore = []
|
73
|
-
emit_mode = "Files"
|
74
|
-
make_backup = false
|
data/.yardopts
DELETED
data/Cargo.toml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
[package]
|
2
|
-
name = "y-rb"
|
3
|
-
version = "0.1.3"
|
4
|
-
authors = ["Hannes Moser <box@hannesmoser.at>", "Hannes Moser <hmoser@gitlab.com>"]
|
5
|
-
edition = "2021"
|
6
|
-
homepage = "https://github.com/y-crdt/yrb"
|
7
|
-
repository = "https://github.com/y-crdt/yrb"
|
8
|
-
|
9
|
-
[dependencies]
|
10
|
-
lazy_static = "1.4.0"
|
11
|
-
rutie = "0.8.4"
|
12
|
-
yrs = "0.10.1"
|
13
|
-
lib0 = "0.10.1" # must match yrs version
|
14
|
-
|
15
|
-
[target.aarch64-unknown-linux-musl.dependencies]
|
16
|
-
rutie = {version="0.8.4", features=["no-link"]}
|
17
|
-
|
18
|
-
[target.x86_64-unknown-linux-musl.dependencies]
|
19
|
-
rutie = {version="0.8.4", features=["no-link"]}
|
20
|
-
|
21
|
-
[target.aarch64-unknown-linux-gnu.dependencies]
|
22
|
-
rutie = {version="0.8.4", features=["no-link"]}
|
23
|
-
|
24
|
-
[lib]
|
25
|
-
name = "y_rb"
|
26
|
-
crate-type = ["cdylib"]
|
27
|
-
|
28
|
-
[package.metadata.thermite]
|
29
|
-
github_releases = true
|
data/Cross.toml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
[build]
|
2
|
-
|
3
|
-
[build.dockerfile]
|
4
|
-
file = "./build/Dockerfile"
|
5
|
-
|
6
|
-
[build.env]
|
7
|
-
passthrough = [
|
8
|
-
"RUBY_VERSION"
|
9
|
-
]
|
10
|
-
|
11
|
-
[target.aarch64-apple-darwin]
|
12
|
-
|
13
|
-
[target.x86_64-apple-darwin]
|
14
|
-
|
15
|
-
[target.x86_64-unknown-linux-gnu]
|
16
|
-
|
17
|
-
[target.x86_64-unknown-linux-musl]
|
data/Gemfile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in y-rb.gemspec
|
6
|
-
gemspec
|
7
|
-
|
8
|
-
gem "github-markup"
|
9
|
-
gem "redcarpet"
|
10
|
-
gem "rspec", "~> 3.11.0"
|
11
|
-
gem "rubocop", "~> 1.31"
|
12
|
-
gem "rubocop-rspec", "~> 2.12.1"
|
13
|
-
gem "yard"
|
data/Gemfile.lock
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
y-rb (0.1.3)
|
5
|
-
rake (~> 13.0)
|
6
|
-
rutie (~> 0.0.4)
|
7
|
-
thermite (~> 0)
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
activesupport (6.1.6.1)
|
13
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
-
i18n (>= 1.6, < 2)
|
15
|
-
minitest (>= 5.1)
|
16
|
-
tzinfo (~> 2.0)
|
17
|
-
zeitwerk (~> 2.3)
|
18
|
-
ast (2.4.2)
|
19
|
-
concurrent-ruby (1.1.10)
|
20
|
-
diff-lcs (1.5.0)
|
21
|
-
github-markup (4.0.1)
|
22
|
-
i18n (1.12.0)
|
23
|
-
concurrent-ruby (~> 1.0)
|
24
|
-
json (2.6.2)
|
25
|
-
minitar (0.9)
|
26
|
-
minitest (5.16.2)
|
27
|
-
parallel (1.22.1)
|
28
|
-
parser (3.1.2.0)
|
29
|
-
ast (~> 2.4.1)
|
30
|
-
rainbow (3.1.1)
|
31
|
-
rake (13.0.6)
|
32
|
-
redcarpet (3.5.1)
|
33
|
-
regexp_parser (2.5.0)
|
34
|
-
rexml (3.2.5)
|
35
|
-
rspec (3.11.0)
|
36
|
-
rspec-core (~> 3.11.0)
|
37
|
-
rspec-expectations (~> 3.11.0)
|
38
|
-
rspec-mocks (~> 3.11.0)
|
39
|
-
rspec-core (3.11.0)
|
40
|
-
rspec-support (~> 3.11.0)
|
41
|
-
rspec-expectations (3.11.0)
|
42
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
-
rspec-support (~> 3.11.0)
|
44
|
-
rspec-mocks (3.11.1)
|
45
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
-
rspec-support (~> 3.11.0)
|
47
|
-
rspec-support (3.11.0)
|
48
|
-
rubocop (1.31.2)
|
49
|
-
json (~> 2.3)
|
50
|
-
parallel (~> 1.10)
|
51
|
-
parser (>= 3.1.0.0)
|
52
|
-
rainbow (>= 2.2.2, < 4.0)
|
53
|
-
regexp_parser (>= 1.8, < 3.0)
|
54
|
-
rexml (>= 3.2.5, < 4.0)
|
55
|
-
rubocop-ast (>= 1.18.0, < 2.0)
|
56
|
-
ruby-progressbar (~> 1.7)
|
57
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
58
|
-
rubocop-ast (1.19.1)
|
59
|
-
parser (>= 3.1.1.0)
|
60
|
-
rubocop-rspec (2.12.1)
|
61
|
-
rubocop (~> 1.31)
|
62
|
-
ruby-progressbar (1.11.0)
|
63
|
-
rutie (0.0.4)
|
64
|
-
thermite (0.13.0)
|
65
|
-
minitar (~> 0.5)
|
66
|
-
rake (>= 10)
|
67
|
-
tomlrb (~> 1.2)
|
68
|
-
tomlrb (1.3.0)
|
69
|
-
tzinfo (2.0.4)
|
70
|
-
concurrent-ruby (~> 1.0)
|
71
|
-
unicode-display_width (2.2.0)
|
72
|
-
webrick (1.7.0)
|
73
|
-
yard (0.9.28)
|
74
|
-
webrick (~> 1.7.0)
|
75
|
-
zeitwerk (2.6.0)
|
76
|
-
|
77
|
-
PLATFORMS
|
78
|
-
arm64-darwin-21
|
79
|
-
x86_64-linux
|
80
|
-
|
81
|
-
DEPENDENCIES
|
82
|
-
activesupport (~> 6.1.6.1)
|
83
|
-
github-markup
|
84
|
-
minitar (~> 0.9)
|
85
|
-
redcarpet
|
86
|
-
rspec (~> 3.11.0)
|
87
|
-
rubocop (~> 1.31)
|
88
|
-
rubocop-rspec (~> 2.12.1)
|
89
|
-
y-rb!
|
90
|
-
yard
|
91
|
-
|
92
|
-
BUNDLED WITH
|
93
|
-
2.2.32
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2022 Hannes Moser <hmoser@gitlab.com>
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
# Yrb
|
2
|
-
|
3
|
-
Yrb is a Ruby binding for Y-CRDT. It provides distributed data types that enable
|
4
|
-
real-time collaboration between devices. Yrb can sync data with any other
|
5
|
-
platform that has a Y-CRDT binding, allowing for seamless cross-domain
|
6
|
-
communication.
|
7
|
-
|
8
|
-
The library is a thin wrapper around Yrs, taking advantage of the safety and
|
9
|
-
performance of Rust.
|
10
|
-
|
11
|
-
## Installation
|
12
|
-
|
13
|
-
Add this line to your application's Gemfile:
|
14
|
-
|
15
|
-
```ruby
|
16
|
-
gem 'y-rb'
|
17
|
-
```
|
18
|
-
|
19
|
-
And then execute:
|
20
|
-
|
21
|
-
$ bundle install
|
22
|
-
|
23
|
-
Or install it yourself as:
|
24
|
-
|
25
|
-
$ gem install y-rb
|
26
|
-
|
27
|
-
> **⚠ WARNING: Partial support for pre-built binaries.**
|
28
|
-
> `y-rb` comes with experimental pre-built binaries for a few platforms, but it
|
29
|
-
> is not possible to support all targets right now. Please make sure there is an
|
30
|
-
> archive that matches the OS, CPU architecture, and Ruby version. You can find
|
31
|
-
> the assets listed with each [release](https://github.com/y-crdt/yrb/releases).
|
32
|
-
>
|
33
|
-
> If the platform is not listed, you need to add the latest stable Rust + Cargo
|
34
|
-
> to your build dependencies in order for `y-rb` to install properly.
|
35
|
-
|
36
|
-
## Usage
|
37
|
-
|
38
|
-
```ruby
|
39
|
-
# creates a new document and text structure
|
40
|
-
local = Y::Doc.new
|
41
|
-
local_text = local.get_text("my text")
|
42
|
-
|
43
|
-
# add some data to the text structure
|
44
|
-
local_text.push("hello")
|
45
|
-
|
46
|
-
# create a remote document sharing the same text structure
|
47
|
-
remote = Y::Doc.new
|
48
|
-
remote_text = remote.get_text("my text")
|
49
|
-
|
50
|
-
# retrieve the current state of the remote document
|
51
|
-
remote_state = remote.state
|
52
|
-
|
53
|
-
# create an update for the remote document based on the current
|
54
|
-
# state of the remote document
|
55
|
-
update = local.diff(remote_state)
|
56
|
-
|
57
|
-
# apply update to remote document
|
58
|
-
remote.sync(update)
|
59
|
-
|
60
|
-
puts remote_text.to_s == local_text.to_s # true
|
61
|
-
```
|
62
|
-
|
63
|
-
More [examples](docs/examples.md).
|
64
|
-
|
65
|
-
## Development
|
66
|
-
|
67
|
-
Make sure you have `cargo` available (2021 edition). The gem needs the lib to
|
68
|
-
be built every time when there is a change.
|
69
|
-
|
70
|
-
```bash
|
71
|
-
cargo build --release
|
72
|
-
```
|
73
|
-
|
74
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then,
|
75
|
-
run `rake spec` to run the tests. You can also run `bin/console` for an
|
76
|
-
interactive prompt that will allow you to experiment.
|
77
|
-
|
78
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
79
|
-
To release a new version, update the version number in `version.rb`, and then
|
80
|
-
run `bundle exec rake release`, which will create a git tag for the version,
|
81
|
-
push git commits and the created tag, and push the `.gem` file to
|
82
|
-
[rubygems.org](https://rubygems.org).
|
83
|
-
|
84
|
-
## Docs
|
85
|
-
|
86
|
-
You can run `yard` locally and open the docs with:
|
87
|
-
|
88
|
-
```bash
|
89
|
-
yard server
|
90
|
-
open "http://0.0.0.0:8808/"
|
91
|
-
```
|
92
|
-
|
93
|
-
## Decision log
|
94
|
-
|
95
|
-
For this `gem`, we maintain a [decision log](docs/decisions.md). Please consult it
|
96
|
-
in case there is some ambiguity in terms of why certain implementation details
|
97
|
-
look as they are.
|
98
|
-
|
99
|
-
## License
|
100
|
-
|
101
|
-
The gem is available as open source under the terms of the
|
102
|
-
[MIT License](https://opensource.org/licenses/MIT).
|