y-rb 0.1.4.beta.1-x86_64-linux → 0.1.5-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/yrb/Cargo.toml +3 -3
- data/ext/yrb/extconf.rb +1 -5
- data/ext/yrb/src/yxml_element.rs +9 -4
- data/lib/2.7/yrb.so +0 -0
- data/lib/3.0/yrb.so +0 -0
- data/lib/3.1/yrb.so +0 -0
- data/lib/y/version.rb +1 -1
- data/lib/y/xml.rb +31 -10
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c07ce13370b91db45ac10921aa6d4f274ad4292821c3cf847aea8ef273219cb9
|
4
|
+
data.tar.gz: f8320c8a7ffcd76d15d25308e288f046e5b816fabe41b38bc051ad94137aea32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d30313184a1a443e9fe0e888794451e838b18b95b517bfb061a1d00d7026fbf64225c2e831a58aed2385f14a120f3c77559cf0ac5bcd1bdaa533cb1184ee2a2e
|
7
|
+
data.tar.gz: 3438c451fa183f6dd7e06b1205fdd5281b987d3b544aeec7688a3cd9769d3924b1ed4a6412a13af10741a24517d062171349e089c845a87f30f8bd3e80486778
|
data/ext/yrb/Cargo.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[package]
|
2
2
|
name = "yrb"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.5"
|
4
4
|
authors = ["Hannes Moser <box@hannesmoser.at>", "Hannes Moser <hmoser@gitlab.com>"]
|
5
5
|
edition = "2021"
|
6
6
|
homepage = "https://github.com/y-crdt/yrb"
|
@@ -8,11 +8,11 @@ repository = "https://github.com/y-crdt/yrb"
|
|
8
8
|
|
9
9
|
[dependencies]
|
10
10
|
lib0 = "0.12.0" # must match yrs version
|
11
|
-
magnus = { git = "https://github.com/matsadler/magnus" } # waiting for release with full rb-sys backend
|
11
|
+
magnus = { git = "https://github.com/matsadler/magnus", rev = "cc852bfa31992d882d42509b1165eb5f67f9dc2c" } # waiting for release with full rb-sys backend
|
12
12
|
yrs = "0.12.0"
|
13
13
|
|
14
14
|
[dev-dependencies]
|
15
|
-
magnus = { git = "https://github.com/matsadler/magnus", features = ["embed"] } # waiting for release with full rb-sys backend
|
15
|
+
magnus = { git = "https://github.com/matsadler/magnus", rev = "cc852bfa31992d882d42509b1165eb5f67f9dc2c", features = ["embed"] } # waiting for release with full rb-sys backend
|
16
16
|
|
17
17
|
[lib]
|
18
18
|
name = "yrb"
|
data/ext/yrb/extconf.rb
CHANGED
data/ext/yrb/src/yxml_element.rs
CHANGED
@@ -49,21 +49,26 @@ impl YXmlElement {
|
|
49
49
|
transaction: &YTransaction,
|
50
50
|
index: u32,
|
51
51
|
name: String
|
52
|
-
) {
|
53
|
-
self.0.borrow_mut().insert_elem(
|
52
|
+
) -> YXmlElement {
|
53
|
+
let element = self.0.borrow_mut().insert_elem(
|
54
54
|
&mut *transaction.0.borrow_mut(),
|
55
55
|
index,
|
56
56
|
name
|
57
57
|
);
|
58
|
+
|
59
|
+
YXmlElement(RefCell::from(element))
|
58
60
|
}
|
59
61
|
pub(crate) fn yxml_element_insert_text(
|
60
62
|
&self,
|
61
63
|
transaction: &YTransaction,
|
62
64
|
index: u32
|
63
|
-
) {
|
64
|
-
self
|
65
|
+
) -> YXmlText {
|
66
|
+
let text = self
|
67
|
+
.0
|
65
68
|
.borrow_mut()
|
66
69
|
.insert_text(&mut *transaction.0.borrow_mut(), index);
|
70
|
+
|
71
|
+
YXmlText(RefCell::from(text))
|
67
72
|
}
|
68
73
|
pub(crate) fn yxml_element_next_sibling(&self) -> Option<Value> {
|
69
74
|
self.0.borrow().next_sibling().map(|item| match item {
|
data/lib/2.7/yrb.so
CHANGED
Binary file
|
data/lib/3.0/yrb.so
CHANGED
Binary file
|
data/lib/3.1/yrb.so
CHANGED
Binary file
|
data/lib/y/version.rb
CHANGED
data/lib/y/xml.rb
CHANGED
@@ -33,7 +33,9 @@ module Y
|
|
33
33
|
# @param [Integer] index
|
34
34
|
# @return [Y::XMLElement|nil]
|
35
35
|
def [](index)
|
36
|
-
yxml_element_get(index)
|
36
|
+
node = yxml_element_get(index)
|
37
|
+
node&.document = document
|
38
|
+
node
|
37
39
|
end
|
38
40
|
|
39
41
|
# Create a node at index
|
@@ -42,7 +44,9 @@ module Y
|
|
42
44
|
# @param [String] name Name of node, e.g. `<p />`
|
43
45
|
# @return [Y::XMLElement]
|
44
46
|
def []=(index, name)
|
45
|
-
yxml_element_insert_element(transaction, index, name)
|
47
|
+
node = yxml_element_insert_element(transaction, index, name)
|
48
|
+
node.document = document
|
49
|
+
node
|
46
50
|
end
|
47
51
|
|
48
52
|
# Returns first child in list or nil if no child exists
|
@@ -58,7 +62,9 @@ module Y
|
|
58
62
|
#
|
59
63
|
# @return [Y::XMLElement]
|
60
64
|
def first_child
|
61
|
-
yxml_element_first_child
|
65
|
+
child = yxml_element_first_child
|
66
|
+
child&.document = document
|
67
|
+
child
|
62
68
|
end
|
63
69
|
|
64
70
|
# Insert text into element at given index
|
@@ -70,6 +76,7 @@ module Y
|
|
70
76
|
# @return [Y::XMLText]
|
71
77
|
def insert_text(index, input = nil)
|
72
78
|
text = yxml_element_insert_text(transaction, index)
|
79
|
+
text.document = document
|
73
80
|
text << input unless input.nil?
|
74
81
|
text
|
75
82
|
end
|
@@ -78,7 +85,9 @@ module Y
|
|
78
85
|
#
|
79
86
|
# @return [Y::XMLElement|Y::XMLText|nil]
|
80
87
|
def next_sibling
|
81
|
-
yxml_element_next_sibling
|
88
|
+
node = yxml_element_next_sibling
|
89
|
+
node&.document = document
|
90
|
+
node
|
82
91
|
end
|
83
92
|
|
84
93
|
# Attach listener to get notified about changes to the element
|
@@ -108,14 +117,18 @@ module Y
|
|
108
117
|
#
|
109
118
|
# @return [Y::XMLElement|nil]
|
110
119
|
def parent
|
111
|
-
yxml_element_parent
|
120
|
+
node = yxml_element_parent
|
121
|
+
node.document = document
|
122
|
+
node
|
112
123
|
end
|
113
124
|
|
114
125
|
# Retrieve element or text adjacent (previous) to this element
|
115
126
|
#
|
116
127
|
# @return [Y::XMLElement|Y::XMLText|nil]
|
117
128
|
def prev_sibling
|
118
|
-
yxml_element_prev_sibling
|
129
|
+
node = yxml_element_prev_sibling
|
130
|
+
node&.document = document
|
131
|
+
node
|
119
132
|
end
|
120
133
|
|
121
134
|
# Creates a new child an inserts at the end of the children list
|
@@ -527,7 +540,7 @@ module Y
|
|
527
540
|
# - Hash (where the the types of key and values must be supported)
|
528
541
|
#
|
529
542
|
# @param [Integer] index
|
530
|
-
# @param [String, Float, Array, Hash] value
|
543
|
+
# @param [String, Float, Array, Hash, Boolean] value
|
531
544
|
# @param [Hash|nil] attrs
|
532
545
|
# @return [void]
|
533
546
|
def insert(index, value, attrs = nil)
|
@@ -537,6 +550,7 @@ module Y
|
|
537
550
|
yxml_text_insert_with_attrs(transaction, index, value,
|
538
551
|
attrs)
|
539
552
|
end
|
553
|
+
|
540
554
|
return nil
|
541
555
|
end
|
542
556
|
|
@@ -546,6 +560,7 @@ module Y
|
|
546
560
|
yxml_text_insert_embed_with_attrs(transaction, index, value,
|
547
561
|
attrs)
|
548
562
|
end
|
563
|
+
|
549
564
|
return nil
|
550
565
|
end
|
551
566
|
|
@@ -568,21 +583,27 @@ module Y
|
|
568
583
|
#
|
569
584
|
# @return [Y::XMLElement|Y::XMLText|nil]
|
570
585
|
def next_sibling
|
571
|
-
yxml_text_next_sibling
|
586
|
+
node = yxml_text_next_sibling
|
587
|
+
node.document = document
|
588
|
+
node
|
572
589
|
end
|
573
590
|
|
574
591
|
# Return parent XMLElement
|
575
592
|
#
|
576
593
|
# @return [Y::XMLElement|nil]
|
577
594
|
def parent
|
578
|
-
yxml_text_parent
|
595
|
+
node = yxml_text_parent
|
596
|
+
node.document = document
|
597
|
+
node
|
579
598
|
end
|
580
599
|
|
581
600
|
# Return adjacent XMLElement or XMLText node (prev)
|
582
601
|
#
|
583
602
|
# @return [Y::XMLElement|Y::XMLText|nil]
|
584
603
|
def prev_sibling
|
585
|
-
yxml_text_prev_sibling
|
604
|
+
node = yxml_text_prev_sibling
|
605
|
+
node&.document = document
|
606
|
+
node
|
586
607
|
end
|
587
608
|
|
588
609
|
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
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.5
|
5
5
|
platform: x86_64-linux
|
6
6
|
authors:
|
7
7
|
- Hannes Moser
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.9.
|
33
|
+
version: 0.9.31
|
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.9.
|
40
|
+
version: 0.9.31
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake-compiler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,9 +122,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: 3.2.dev
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
|
-
- - "
|
125
|
+
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version:
|
127
|
+
version: 3.3.21
|
128
128
|
requirements: []
|
129
129
|
rubygems_version: 3.4.0.dev
|
130
130
|
signing_key:
|