mrml 1.6.2 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/mrml/Cargo.toml +1 -1
- data/ext/mrml/src/lib.rs +11 -10
- data/lib/mrml/version.rb +1 -1
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab517623a7d5cefb91f246792903bfd18b252d9f505185c74999b67cf2fd6fbc
|
4
|
+
data.tar.gz: 29cfb88c89624e7282a68caf336d40edd77fb352fbcc16cc047a80c51967bae3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2e5e62946349185b4653eb36b0c935a8eb916eabf2bb56030be2db78c172e603e41a6e9707ec84667db968ec12bc5c88776f2e736f2f1b014eb6a89278ff2d4
|
7
|
+
data.tar.gz: 646cd02765c532fb0a87bc0405b8a0babec360d8174abc8ec20d642631853dba46e0dcf8843725d4accd7312972c18d233ae100af725db8c2a7521b95d805a93
|
data/ext/mrml/Cargo.toml
CHANGED
data/ext/mrml/src/lib.rs
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
use magnus::{
|
2
|
-
|
3
|
-
prelude::*, gc::register_mark_object, memoize,
|
2
|
+
function, method, prelude::*, value::Lazy, Ruby,
|
4
3
|
Error, ExceptionClass, RModule
|
5
4
|
};
|
6
5
|
|
@@ -8,12 +7,14 @@ use mrml::mjml::Mjml;
|
|
8
7
|
use mrml::prelude::print::Printable;
|
9
8
|
use mrml::prelude::render::RenderOptions;
|
10
9
|
|
10
|
+
static MODULE: Lazy<RModule> =
|
11
|
+
Lazy::new(|ruby| ruby.class_object().const_get("MRML").unwrap());
|
12
|
+
|
13
|
+
static ERROR: Lazy<ExceptionClass> =
|
14
|
+
Lazy::new(|ruby| ruby.get_inner(&MODULE).const_get("Error").unwrap());
|
15
|
+
|
11
16
|
fn mrml_error() -> ExceptionClass {
|
12
|
-
|
13
|
-
let ex = class::object().const_get::<_, RModule>("MRML").unwrap().const_get("Error").unwrap();
|
14
|
-
register_mark_object(ex);
|
15
|
-
ex
|
16
|
-
})
|
17
|
+
Ruby::get().unwrap().get_inner(&ERROR)
|
17
18
|
}
|
18
19
|
|
19
20
|
macro_rules! error {
|
@@ -76,9 +77,9 @@ impl Clone for Template {
|
|
76
77
|
}
|
77
78
|
|
78
79
|
#[magnus::init]
|
79
|
-
fn init() -> Result<(), Error> {
|
80
|
-
let module = define_module("MRML")?;
|
81
|
-
let class = module.define_class("Template",
|
80
|
+
fn init(ruby: &Ruby) -> Result<(), Error> {
|
81
|
+
let module = ruby.define_module("MRML")?;
|
82
|
+
let class = module.define_class("Template", ruby.class_object())?;
|
82
83
|
|
83
84
|
class.define_singleton_method("new", function!(Template::new, 1))?;
|
84
85
|
class.define_singleton_method("from_json", function!(Template::from_json, 1))?;
|
data/lib/mrml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mrml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonian Guveli
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-15 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rb_sys
|
@@ -88,7 +87,6 @@ homepage: https://github.com/hardpixel/mrml-ruby
|
|
88
87
|
licenses:
|
89
88
|
- MIT
|
90
89
|
metadata: {}
|
91
|
-
post_install_message:
|
92
90
|
rdoc_options: []
|
93
91
|
require_paths:
|
94
92
|
- lib
|
@@ -96,15 +94,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
94
|
requirements:
|
97
95
|
- - ">="
|
98
96
|
- !ruby/object:Gem::Version
|
99
|
-
version: '2.
|
97
|
+
version: '2.7'
|
100
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
99
|
requirements:
|
102
100
|
- - ">="
|
103
101
|
- !ruby/object:Gem::Version
|
104
102
|
version: '0'
|
105
103
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
107
|
-
signing_key:
|
104
|
+
rubygems_version: 3.6.2
|
108
105
|
specification_version: 4
|
109
106
|
summary: Ruby wrapper for MRML Rust
|
110
107
|
test_files: []
|