-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
160 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "yrb" | ||
version = "0.5.5" | ||
version = "0.5.6" | ||
authors = ["Hannes Moser <[email protected]>"] | ||
edition = "2021" | ||
homepage = "https://github.com/y-crdt/yrb" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use magnus::{IntoValue, RHash, Value}; | ||
|
||
unsafe impl Send for YDiff {} | ||
|
||
#[magnus::wrap(class = "Y::Diff")] | ||
pub(crate) struct YDiff { | ||
pub(crate) ydiff_insert: Value, | ||
pub(crate) ydiff_attrs: Option<RHash>, | ||
} | ||
|
||
impl YDiff { | ||
pub(crate) fn ydiff_insert(&self) -> Value { | ||
self.ydiff_insert | ||
} | ||
|
||
pub(crate) fn ydiff_attrs(&self) -> Option<Value> { | ||
self.ydiff_attrs.as_ref().map(|value| value.into_value()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# frozen_string_literal: true | ||
|
||
module Y | ||
# A representation of an uniformly-formatted chunk of rich context stored by | ||
# Text or XmlText. It contains a value (which could be a string, embedded | ||
# object or another shared type) with optional formatting attributes wrapping | ||
# around this chunk. | ||
class Diff | ||
# @return [Object] | ||
def insert | ||
ydiff_insert | ||
end | ||
|
||
# @return [Hash] | ||
def attrs | ||
ydiff_attrs | ||
end | ||
|
||
# Convert the diff to a Hash representation | ||
# | ||
# @return [Hash] | ||
def to_h | ||
{ | ||
insert: ydiff_insert, | ||
attrs: ydiff_attrs | ||
} | ||
end | ||
|
||
# @!method ydiff_insert() | ||
# Returns string representation of text | ||
# | ||
# @return [Object] | ||
|
||
# @!method ydiff_attrs() | ||
# | ||
# @return [Hash] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Y | ||
VERSION = "0.5.5" | ||
VERSION = "0.5.6" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters