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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30f6918d925abecb47ac423052c35970a3cbe68420673bd1126a77ff315dfd3c
4
- data.tar.gz: 154d4401a4a3144105d21cda57bf4968405dff21a17175aabc113eb854a24fca
3
+ metadata.gz: ab517623a7d5cefb91f246792903bfd18b252d9f505185c74999b67cf2fd6fbc
4
+ data.tar.gz: 29cfb88c89624e7282a68caf336d40edd77fb352fbcc16cc047a80c51967bae3
5
5
  SHA512:
6
- metadata.gz: fbe57b695c224f3a9ee821e8e8b871d6c79f43f8a666278c26dfe00a8e6e0eea7b03f7e7db9835b16447656713c5b3d438ea52097dfb68c089a16bfdaa5864c0
7
- data.tar.gz: 8034f8faf02b13bcf6ae41b4d5bcff8da425ead9161720eb2b09b23cbee797440ea8bd460a66e50d2325f2365cca1fca6565e76f2321d099921aa80847648bdd
6
+ metadata.gz: e2e5e62946349185b4653eb36b0c935a8eb916eabf2bb56030be2db78c172e603e41a6e9707ec84667db968ec12bc5c88776f2e736f2f1b014eb6a89278ff2d4
7
+ data.tar.gz: 646cd02765c532fb0a87bc0405b8a0babec360d8174abc8ec20d642631853dba46e0dcf8843725d4accd7312972c18d233ae100af725db8c2a7521b95d805a93
data/ext/mrml/Cargo.toml CHANGED
@@ -6,7 +6,7 @@ edition = "2018"
6
6
 
7
7
  [dependencies]
8
8
  mrml = "4.0"
9
- magnus = "0.5"
9
+ magnus = "0.7"
10
10
 
11
11
  [dependencies.serde]
12
12
  version = "1.0"
data/ext/mrml/src/lib.rs CHANGED
@@ -1,6 +1,5 @@
1
1
  use magnus::{
2
- class, define_module, function, method,
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
- *memoize!(ExceptionClass: {
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", class::object())?;
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MRML
4
- VERSION = '1.6.2'
4
+ VERSION = '1.7.0'
5
5
  end
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.6.2
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: 2024-07-08 00:00:00.000000000 Z
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.6'
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.5.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: []