wreq 1.3.2.3-aarch64-linux → 1.3.2.4-aarch64-linux

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4542c260dc34db62d1209ce6f1c64f339b3899d0540842b45de0b164c59d30d8
4
- data.tar.gz: 1040d9f73b3af0e5ab933949c20a0dd9e29c3af56e644b847964de6fa21d6d74
3
+ metadata.gz: 67224c50f6344735b5ad774959f59ecff5e119c971890b82d90767732966ed4b
4
+ data.tar.gz: 25b818d5c3d0be2d932542370976991135e5b2e6a216f0e6a428924aab932a01
5
5
  SHA512:
6
- metadata.gz: b2d02146ea2f98ed2f7bb4e0e6760e0f906288a550259e82061918ce680d7ecfa4c113f218b3d00e6b8058f15a7c4870ab628d48c1ca719940ab419040d079b7
7
- data.tar.gz: de638a19a58f410e023b4a2fff3dabd0c7d830eba0dded77c3ea66ddd714c2fefc49fefe6b213c83a491b5d6f73b90fc37b46df678ef159f9b4132ab997c2bf3
6
+ metadata.gz: c861c10e8e31dc82b7b274eca0ecb2c058d5fa0b90c15b54fde84bed30f0fcb53d9f59878515054ccc8c8afb10da2e12b30bdc633f5547c8a05210714fd0e4ad
7
+ data.tar.gz: 4402ca55d68a60259ff4b7f8e1d4ec71257e2167739429d3c645b19f75a2fb31fc461c6d945d303dbae0410a94882fa36699aeedd1ee1de92d9314fb76a6832f
data/Rakefile CHANGED
@@ -44,17 +44,23 @@ end
44
44
 
45
45
  desc "Run Rust tests"
46
46
  task :cargo_test do
47
- sh "cargo test"
47
+ test_env = {}
48
+ if RbConfig::CONFIG.fetch("host_os").start_with?("linux")
49
+ # Embedded Ruby tests need the active Ruby's shared library at startup.
50
+ test_env["LD_LIBRARY_PATH"] = [RbConfig::CONFIG.fetch("libdir"), ENV["LD_LIBRARY_PATH"]]
51
+ .compact.reject(&:empty?).join(File::PATH_SEPARATOR)
52
+ end
53
+ sh test_env, "cargo", "test", "--workspace", "--locked"
48
54
  end
49
55
 
50
56
  desc "Format Rust code"
51
57
  task :fmt do
52
- sh "cargo fmt"
58
+ sh "cargo fmt --all"
53
59
  end
54
60
 
55
61
  desc "Run Clippy linter"
56
62
  task :lint do
57
- sh "cargo clippy -- -D warnings"
63
+ sh "cargo clippy --workspace --locked -- -D warnings"
58
64
  end
59
65
 
60
66
  desc "Build native gem for platform (e.g., rake 'native[x86_64-linux]')"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.2.3
1
+ 1.3.2.4
data/crates/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Local Rust dependencies
2
2
 
3
+ - [`serde_magnus`](serde-magnus/) is based on OneSignal's `serde_magnus`. The root package uses it as a path dependency and workspace member so it shares the lockfile and runs in `bundle exec rake test`.
3
4
  - [`wreq-util`](wreq-util/) is a local copy of [0x676e67/wreq-util](https://github.com/0x676e67/wreq-util). The root [`Cargo.toml`](../Cargo.toml) resolves it from `crates/wreq-util` through `[patch.crates-io]`.
4
5
 
5
6
  When building or testing `wreq-util` on its own, use the Git dependency patches from the root manifest of the same branch. Cargo does not inherit those patches from the parent package.
@@ -0,0 +1,19 @@
1
+ Copyright 2022 George Claghorn
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,147 @@
1
+ # `serde_magnus`
2
+
3
+ `serde_magnus` converts between Rust and Ruby data structures using [Serde] and [Magnus].
4
+
5
+ [Serde]: https://github.com/serde-rs/serde
6
+ [Magnus]: https://github.com/matsadler/magnus
7
+
8
+ ## Local maintenance
9
+
10
+ This crate is based on [OneSignal's serde_magnus 0.11.0 source][upstream]. It
11
+ uses the same Magnus 0.9 series and Rust 1.98 minimum as `wreq-ruby`.
12
+
13
+ ### Local patches
14
+
15
+ - `src/de/` and `src/ser/` preserve arbitrary-size JSON integers in both
16
+ directions and support typed `i128` and `u128`. JSON input validates object keys,
17
+ finite floats, and container depth. The precision tests also cover the
18
+ private number token shared with `serde_json`.
19
+ - `src/options.rs` validates option names before converting values and attaches
20
+ the failing field path to Ruby exceptions.
21
+ - `src/error.rs` carries Serde errors until the conversion entry point can use
22
+ its Ruby handle. The deserializer and map serializer check iteration and map
23
+ state.
24
+
25
+ To sync, diff this directory against the pinned source tree, reapply the local
26
+ changes to the new upstream commit, and update the pin below. Run
27
+ `cargo test --locked -p serde_magnus` and `bundle exec rake test` from the
28
+ repository root. The Ruby tests in `test/json_precision_test.rb` and
29
+ `test/option_validation_test.rb` exercise the request, response, and option
30
+ entry points.
31
+
32
+ [upstream]: https://github.com/OneSignal/serde-magnus/tree/b84e35d03af9f84edf32e29c1fc022b4411ba9b9
33
+
34
+ ## Upstream documentation
35
+
36
+ * [API documentation](https://docs.rs/serde_magnus)
37
+ * [Releases/changelog](https://github.com/OneSignal/serde-magnus/releases)
38
+ * [`serde_magnus` on crates.io](https://crates.io/crates/serde_magnus)
39
+
40
+ ## Usage
41
+
42
+ The [`serde_magnus::serialize`] function converts from a Rust type implementing the
43
+ [`serde::Serialize`] trait into a Ruby equivalent.
44
+
45
+ ```rust
46
+ use serde::{Serialize, Deserialize};
47
+ use magnus::{eval, Ruby, Value};
48
+ use serde_magnus::serialize;
49
+
50
+ #[derive(Serialize, Deserialize, PartialEq, Debug)]
51
+ struct Post {
52
+ title: String,
53
+ content: String,
54
+ author: Author,
55
+ tags: Vec<String>
56
+ }
57
+
58
+ #[derive(Serialize, Deserialize, PartialEq, Debug)]
59
+ struct Author {
60
+ name: String,
61
+ email_address: String
62
+ }
63
+
64
+ let post = Post {
65
+ title: "Spring carnival planning update".into(),
66
+ content: "Here's what's new.".into(),
67
+ author: Author {
68
+ name: "Martha".into(),
69
+ email_address: "martha@example.com".into()
70
+ },
71
+ tags: vec![
72
+ "carnival".into(),
73
+ "update".into()
74
+ ]
75
+ };
76
+
77
+ let ruby = Ruby::get().unwrap();
78
+ let post: Value = serialize(&ruby, &post)?;
79
+
80
+ assert!(eval!(
81
+ &ruby,
82
+ r#"
83
+ post == {
84
+ title: "Spring carnival planning update",
85
+ content: "Here's what's new.",
86
+ author: {
87
+ name: "Martha",
88
+ email_address: "martha@example.com"
89
+ },
90
+ tags: ["carnival", "update"]
91
+ }
92
+ "#,
93
+ post
94
+ )?);
95
+ ```
96
+
97
+ [`serde_magnus::deserialize`] converts from a Ruby value to a Rust type implementing
98
+ [`serde::Deserialize`].
99
+
100
+ ```rust
101
+ use magnus::{RHash, Ruby};
102
+ use serde_magnus::deserialize;
103
+
104
+ let ruby = Ruby::get().unwrap();
105
+ let post: RHash = eval!(&ruby, r#"
106
+ {
107
+ title: "Spring carnival planning update",
108
+ content: "Here's what's new.",
109
+ author: {
110
+ name: "Martha",
111
+ email_address: "martha@example.com"
112
+ },
113
+ tags: ["carnival", "update"]
114
+ }
115
+ "#)?;
116
+
117
+ let post: Post = deserialize(&ruby, post)?;
118
+
119
+ assert_eq!(
120
+ Post {
121
+ title: "Spring carnival planning update".into(),
122
+ content: "Here's what's new.".into(),
123
+ author: Author {
124
+ name: "Martha".into(),
125
+ email_address: "martha@example.com".into(),
126
+ },
127
+ tags: vec![
128
+ "carnival".into(),
129
+ "update".into()
130
+ ]
131
+ },
132
+ post
133
+ );
134
+ ```
135
+
136
+ [`serde_magnus::serialize`]: https://docs.rs/serde_magnus/latest/serde_magnus/fn.serialize.html
137
+ [`serde::Serialize`]: https://docs.rs/serde/latest/serde/trait.Serialize.html
138
+ [`serde_magnus::deserialize`]: https://docs.rs/serde_magnus/latest/serde_magnus/fn.deserialize.html
139
+ [`serde::Deserialize`]: https://docs.rs/serde/latest/serde/trait.Deserialize.html
140
+
141
+ ## Requirements
142
+
143
+ The local crate shares the Rust and Ruby requirements of `wreq-ruby`.
144
+
145
+ ## License
146
+
147
+ `serde_magnus` is released under the terms of the MIT License. See `LICENSE` for details.
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wreq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2.3
4
+ version: 1.3.2.4
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - SearchApi
@@ -26,6 +26,8 @@ files:
26
26
  - Rakefile
27
27
  - VERSION
28
28
  - crates/README.md
29
+ - crates/serde-magnus/LICENSE
30
+ - crates/serde-magnus/README.md
29
31
  - crates/wreq-util/.github/FUNDING.yml
30
32
  - crates/wreq-util/.github/ISSUE_TEMPLATE/bug_report.md
31
33
  - crates/wreq-util/.github/ISSUE_TEMPLATE/custom.md