rustybars 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +19 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Cargo.lock +554 -0
- data/Cargo.toml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +46 -0
- data/Rakefile +24 -0
- data/ext/rustybars/Cargo.toml +16 -0
- data/ext/rustybars/extconf.rb +6 -0
- data/ext/rustybars/src/lib.rs +61 -0
- data/lib/rustybars/version.rb +5 -0
- data/lib/rustybars.rb +7 -0
- data/sig/rustybars.rbs +4 -0
- metadata +59 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f34536d19f923f2625096c6b85003537d092391a1eeafa1e6283f65a1dc6dd23
|
4
|
+
data.tar.gz: 683daf39c120af31423e5b52e07b56445a3f229e02968ab415fb04870096c4d0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1d0ae87975147695c3a8225aab2a0dde00b2145ea44841a883ffbf6f7abaeb11d2857d50a8c61d76d3b339c3755dd8c2f6e36fd864c534264952fe720b553b08
|
7
|
+
data.tar.gz: fc05de56674987d9b60025e6163c236662cb75390d61e16cf9a871151735340fc572d84ac120ae34f8e52b0c847e67c3fbe4977edd8569ebdbafcbdc7a37510a
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 3.0
|
3
|
+
|
4
|
+
Style/StringLiterals:
|
5
|
+
Enabled: true
|
6
|
+
EnforcedStyle: double_quotes
|
7
|
+
|
8
|
+
Style/StringLiteralsInInterpolation:
|
9
|
+
Enabled: true
|
10
|
+
EnforcedStyle: double_quotes
|
11
|
+
|
12
|
+
Layout/LineLength:
|
13
|
+
Max: 120
|
14
|
+
|
15
|
+
Style/Documentation:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Metrics/BlockLength:
|
19
|
+
Enabled: false
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at andriy.yanko@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Cargo.lock
ADDED
@@ -0,0 +1,554 @@
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
2
|
+
# It is not intended for manual editing.
|
3
|
+
version = 3
|
4
|
+
|
5
|
+
[[package]]
|
6
|
+
name = "aho-corasick"
|
7
|
+
version = "1.1.2"
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
9
|
+
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
|
10
|
+
dependencies = [
|
11
|
+
"memchr",
|
12
|
+
]
|
13
|
+
|
14
|
+
[[package]]
|
15
|
+
name = "bindgen"
|
16
|
+
version = "0.69.2"
|
17
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
18
|
+
checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d"
|
19
|
+
dependencies = [
|
20
|
+
"bitflags",
|
21
|
+
"cexpr",
|
22
|
+
"clang-sys",
|
23
|
+
"lazy_static",
|
24
|
+
"lazycell",
|
25
|
+
"peeking_take_while",
|
26
|
+
"proc-macro2",
|
27
|
+
"quote",
|
28
|
+
"regex",
|
29
|
+
"rustc-hash",
|
30
|
+
"shlex",
|
31
|
+
"syn",
|
32
|
+
]
|
33
|
+
|
34
|
+
[[package]]
|
35
|
+
name = "bitflags"
|
36
|
+
version = "2.4.2"
|
37
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
38
|
+
checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
|
39
|
+
|
40
|
+
[[package]]
|
41
|
+
name = "block-buffer"
|
42
|
+
version = "0.10.4"
|
43
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
44
|
+
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
45
|
+
dependencies = [
|
46
|
+
"generic-array",
|
47
|
+
]
|
48
|
+
|
49
|
+
[[package]]
|
50
|
+
name = "cexpr"
|
51
|
+
version = "0.6.0"
|
52
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
53
|
+
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
|
54
|
+
dependencies = [
|
55
|
+
"nom",
|
56
|
+
]
|
57
|
+
|
58
|
+
[[package]]
|
59
|
+
name = "cfg-if"
|
60
|
+
version = "1.0.0"
|
61
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
62
|
+
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
63
|
+
|
64
|
+
[[package]]
|
65
|
+
name = "clang-sys"
|
66
|
+
version = "1.7.0"
|
67
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
68
|
+
checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1"
|
69
|
+
dependencies = [
|
70
|
+
"glob",
|
71
|
+
"libc",
|
72
|
+
"libloading",
|
73
|
+
]
|
74
|
+
|
75
|
+
[[package]]
|
76
|
+
name = "cpufeatures"
|
77
|
+
version = "0.2.12"
|
78
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
79
|
+
checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
|
80
|
+
dependencies = [
|
81
|
+
"libc",
|
82
|
+
]
|
83
|
+
|
84
|
+
[[package]]
|
85
|
+
name = "crypto-common"
|
86
|
+
version = "0.1.6"
|
87
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
88
|
+
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
|
89
|
+
dependencies = [
|
90
|
+
"generic-array",
|
91
|
+
"typenum",
|
92
|
+
]
|
93
|
+
|
94
|
+
[[package]]
|
95
|
+
name = "digest"
|
96
|
+
version = "0.10.7"
|
97
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
98
|
+
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
99
|
+
dependencies = [
|
100
|
+
"block-buffer",
|
101
|
+
"crypto-common",
|
102
|
+
]
|
103
|
+
|
104
|
+
[[package]]
|
105
|
+
name = "generic-array"
|
106
|
+
version = "0.14.7"
|
107
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
108
|
+
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
109
|
+
dependencies = [
|
110
|
+
"typenum",
|
111
|
+
"version_check",
|
112
|
+
]
|
113
|
+
|
114
|
+
[[package]]
|
115
|
+
name = "glob"
|
116
|
+
version = "0.3.1"
|
117
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
118
|
+
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
119
|
+
|
120
|
+
[[package]]
|
121
|
+
name = "handlebars"
|
122
|
+
version = "5.1.1"
|
123
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
124
|
+
checksum = "c73166c591e67fb4bf9bc04011b4e35f12e89fe8d676193aa263df065955a379"
|
125
|
+
dependencies = [
|
126
|
+
"log",
|
127
|
+
"pest",
|
128
|
+
"pest_derive",
|
129
|
+
"serde",
|
130
|
+
"serde_json",
|
131
|
+
"thiserror",
|
132
|
+
]
|
133
|
+
|
134
|
+
[[package]]
|
135
|
+
name = "itoa"
|
136
|
+
version = "1.0.10"
|
137
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
138
|
+
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
|
139
|
+
|
140
|
+
[[package]]
|
141
|
+
name = "lazy_static"
|
142
|
+
version = "1.4.0"
|
143
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
144
|
+
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
145
|
+
|
146
|
+
[[package]]
|
147
|
+
name = "lazycell"
|
148
|
+
version = "1.3.0"
|
149
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
150
|
+
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
151
|
+
|
152
|
+
[[package]]
|
153
|
+
name = "libc"
|
154
|
+
version = "0.2.152"
|
155
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
156
|
+
checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
|
157
|
+
|
158
|
+
[[package]]
|
159
|
+
name = "libloading"
|
160
|
+
version = "0.8.1"
|
161
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
162
|
+
checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161"
|
163
|
+
dependencies = [
|
164
|
+
"cfg-if",
|
165
|
+
"windows-sys",
|
166
|
+
]
|
167
|
+
|
168
|
+
[[package]]
|
169
|
+
name = "log"
|
170
|
+
version = "0.4.20"
|
171
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
172
|
+
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
|
173
|
+
|
174
|
+
[[package]]
|
175
|
+
name = "magnus"
|
176
|
+
version = "0.6.2"
|
177
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
178
|
+
checksum = "4778544796676e8428e9c622460ebf284bea52d8b10db3aeb449d8b5e61b3a13"
|
179
|
+
dependencies = [
|
180
|
+
"magnus-macros",
|
181
|
+
"rb-sys",
|
182
|
+
"rb-sys-env",
|
183
|
+
"seq-macro",
|
184
|
+
]
|
185
|
+
|
186
|
+
[[package]]
|
187
|
+
name = "magnus-macros"
|
188
|
+
version = "0.6.0"
|
189
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
190
|
+
checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
|
191
|
+
dependencies = [
|
192
|
+
"proc-macro2",
|
193
|
+
"quote",
|
194
|
+
"syn",
|
195
|
+
]
|
196
|
+
|
197
|
+
[[package]]
|
198
|
+
name = "memchr"
|
199
|
+
version = "2.7.1"
|
200
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
201
|
+
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
|
202
|
+
|
203
|
+
[[package]]
|
204
|
+
name = "minimal-lexical"
|
205
|
+
version = "0.2.1"
|
206
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
207
|
+
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
208
|
+
|
209
|
+
[[package]]
|
210
|
+
name = "nom"
|
211
|
+
version = "7.1.3"
|
212
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
213
|
+
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
|
214
|
+
dependencies = [
|
215
|
+
"memchr",
|
216
|
+
"minimal-lexical",
|
217
|
+
]
|
218
|
+
|
219
|
+
[[package]]
|
220
|
+
name = "once_cell"
|
221
|
+
version = "1.19.0"
|
222
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
223
|
+
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
224
|
+
|
225
|
+
[[package]]
|
226
|
+
name = "peeking_take_while"
|
227
|
+
version = "0.1.2"
|
228
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
229
|
+
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
|
230
|
+
|
231
|
+
[[package]]
|
232
|
+
name = "pest"
|
233
|
+
version = "2.7.6"
|
234
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
235
|
+
checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06"
|
236
|
+
dependencies = [
|
237
|
+
"memchr",
|
238
|
+
"thiserror",
|
239
|
+
"ucd-trie",
|
240
|
+
]
|
241
|
+
|
242
|
+
[[package]]
|
243
|
+
name = "pest_derive"
|
244
|
+
version = "2.7.6"
|
245
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
246
|
+
checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde"
|
247
|
+
dependencies = [
|
248
|
+
"pest",
|
249
|
+
"pest_generator",
|
250
|
+
]
|
251
|
+
|
252
|
+
[[package]]
|
253
|
+
name = "pest_generator"
|
254
|
+
version = "2.7.6"
|
255
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
256
|
+
checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275"
|
257
|
+
dependencies = [
|
258
|
+
"pest",
|
259
|
+
"pest_meta",
|
260
|
+
"proc-macro2",
|
261
|
+
"quote",
|
262
|
+
"syn",
|
263
|
+
]
|
264
|
+
|
265
|
+
[[package]]
|
266
|
+
name = "pest_meta"
|
267
|
+
version = "2.7.6"
|
268
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
269
|
+
checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d"
|
270
|
+
dependencies = [
|
271
|
+
"once_cell",
|
272
|
+
"pest",
|
273
|
+
"sha2",
|
274
|
+
]
|
275
|
+
|
276
|
+
[[package]]
|
277
|
+
name = "proc-macro2"
|
278
|
+
version = "1.0.76"
|
279
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
280
|
+
checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
|
281
|
+
dependencies = [
|
282
|
+
"unicode-ident",
|
283
|
+
]
|
284
|
+
|
285
|
+
[[package]]
|
286
|
+
name = "quote"
|
287
|
+
version = "1.0.35"
|
288
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
289
|
+
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
290
|
+
dependencies = [
|
291
|
+
"proc-macro2",
|
292
|
+
]
|
293
|
+
|
294
|
+
[[package]]
|
295
|
+
name = "rb-sys"
|
296
|
+
version = "0.9.86"
|
297
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
298
|
+
checksum = "7285f2a7b92f58ab198e3fd59a71d2861478f9c4642f41e83582385818941697"
|
299
|
+
dependencies = [
|
300
|
+
"rb-sys-build",
|
301
|
+
]
|
302
|
+
|
303
|
+
[[package]]
|
304
|
+
name = "rb-sys-build"
|
305
|
+
version = "0.9.86"
|
306
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
307
|
+
checksum = "71583945f94dabb6c0dfa63f1b71e929c1901e1e288ef3739ab8bed3b7069550"
|
308
|
+
dependencies = [
|
309
|
+
"bindgen",
|
310
|
+
"lazy_static",
|
311
|
+
"proc-macro2",
|
312
|
+
"quote",
|
313
|
+
"regex",
|
314
|
+
"shell-words",
|
315
|
+
"syn",
|
316
|
+
]
|
317
|
+
|
318
|
+
[[package]]
|
319
|
+
name = "rb-sys-env"
|
320
|
+
version = "0.1.2"
|
321
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
322
|
+
checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
|
323
|
+
|
324
|
+
[[package]]
|
325
|
+
name = "regex"
|
326
|
+
version = "1.10.2"
|
327
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
328
|
+
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
|
329
|
+
dependencies = [
|
330
|
+
"aho-corasick",
|
331
|
+
"memchr",
|
332
|
+
"regex-automata",
|
333
|
+
"regex-syntax",
|
334
|
+
]
|
335
|
+
|
336
|
+
[[package]]
|
337
|
+
name = "regex-automata"
|
338
|
+
version = "0.4.3"
|
339
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
340
|
+
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
|
341
|
+
dependencies = [
|
342
|
+
"aho-corasick",
|
343
|
+
"memchr",
|
344
|
+
"regex-syntax",
|
345
|
+
]
|
346
|
+
|
347
|
+
[[package]]
|
348
|
+
name = "regex-syntax"
|
349
|
+
version = "0.8.2"
|
350
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
351
|
+
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
352
|
+
|
353
|
+
[[package]]
|
354
|
+
name = "rustc-hash"
|
355
|
+
version = "1.1.0"
|
356
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
357
|
+
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
358
|
+
|
359
|
+
[[package]]
|
360
|
+
name = "rustybars"
|
361
|
+
version = "0.1.0"
|
362
|
+
dependencies = [
|
363
|
+
"handlebars",
|
364
|
+
"magnus",
|
365
|
+
"serde",
|
366
|
+
"serde_json",
|
367
|
+
]
|
368
|
+
|
369
|
+
[[package]]
|
370
|
+
name = "ryu"
|
371
|
+
version = "1.0.16"
|
372
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
373
|
+
checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
|
374
|
+
|
375
|
+
[[package]]
|
376
|
+
name = "seq-macro"
|
377
|
+
version = "0.3.5"
|
378
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
379
|
+
checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4"
|
380
|
+
|
381
|
+
[[package]]
|
382
|
+
name = "serde"
|
383
|
+
version = "1.0.195"
|
384
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
385
|
+
checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
|
386
|
+
dependencies = [
|
387
|
+
"serde_derive",
|
388
|
+
]
|
389
|
+
|
390
|
+
[[package]]
|
391
|
+
name = "serde_derive"
|
392
|
+
version = "1.0.195"
|
393
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
394
|
+
checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
|
395
|
+
dependencies = [
|
396
|
+
"proc-macro2",
|
397
|
+
"quote",
|
398
|
+
"syn",
|
399
|
+
]
|
400
|
+
|
401
|
+
[[package]]
|
402
|
+
name = "serde_json"
|
403
|
+
version = "1.0.111"
|
404
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
405
|
+
checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
|
406
|
+
dependencies = [
|
407
|
+
"itoa",
|
408
|
+
"ryu",
|
409
|
+
"serde",
|
410
|
+
]
|
411
|
+
|
412
|
+
[[package]]
|
413
|
+
name = "sha2"
|
414
|
+
version = "0.10.8"
|
415
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
416
|
+
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
|
417
|
+
dependencies = [
|
418
|
+
"cfg-if",
|
419
|
+
"cpufeatures",
|
420
|
+
"digest",
|
421
|
+
]
|
422
|
+
|
423
|
+
[[package]]
|
424
|
+
name = "shell-words"
|
425
|
+
version = "1.1.0"
|
426
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
427
|
+
checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
|
428
|
+
|
429
|
+
[[package]]
|
430
|
+
name = "shlex"
|
431
|
+
version = "1.2.0"
|
432
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
433
|
+
checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380"
|
434
|
+
|
435
|
+
[[package]]
|
436
|
+
name = "syn"
|
437
|
+
version = "2.0.48"
|
438
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
439
|
+
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
|
440
|
+
dependencies = [
|
441
|
+
"proc-macro2",
|
442
|
+
"quote",
|
443
|
+
"unicode-ident",
|
444
|
+
]
|
445
|
+
|
446
|
+
[[package]]
|
447
|
+
name = "thiserror"
|
448
|
+
version = "1.0.56"
|
449
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
450
|
+
checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
|
451
|
+
dependencies = [
|
452
|
+
"thiserror-impl",
|
453
|
+
]
|
454
|
+
|
455
|
+
[[package]]
|
456
|
+
name = "thiserror-impl"
|
457
|
+
version = "1.0.56"
|
458
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
459
|
+
checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
|
460
|
+
dependencies = [
|
461
|
+
"proc-macro2",
|
462
|
+
"quote",
|
463
|
+
"syn",
|
464
|
+
]
|
465
|
+
|
466
|
+
[[package]]
|
467
|
+
name = "typenum"
|
468
|
+
version = "1.17.0"
|
469
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
470
|
+
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
471
|
+
|
472
|
+
[[package]]
|
473
|
+
name = "ucd-trie"
|
474
|
+
version = "0.1.6"
|
475
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
476
|
+
checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
|
477
|
+
|
478
|
+
[[package]]
|
479
|
+
name = "unicode-ident"
|
480
|
+
version = "1.0.12"
|
481
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
482
|
+
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
483
|
+
|
484
|
+
[[package]]
|
485
|
+
name = "version_check"
|
486
|
+
version = "0.9.4"
|
487
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
488
|
+
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
489
|
+
|
490
|
+
[[package]]
|
491
|
+
name = "windows-sys"
|
492
|
+
version = "0.48.0"
|
493
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
494
|
+
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
|
495
|
+
dependencies = [
|
496
|
+
"windows-targets",
|
497
|
+
]
|
498
|
+
|
499
|
+
[[package]]
|
500
|
+
name = "windows-targets"
|
501
|
+
version = "0.48.5"
|
502
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
503
|
+
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
|
504
|
+
dependencies = [
|
505
|
+
"windows_aarch64_gnullvm",
|
506
|
+
"windows_aarch64_msvc",
|
507
|
+
"windows_i686_gnu",
|
508
|
+
"windows_i686_msvc",
|
509
|
+
"windows_x86_64_gnu",
|
510
|
+
"windows_x86_64_gnullvm",
|
511
|
+
"windows_x86_64_msvc",
|
512
|
+
]
|
513
|
+
|
514
|
+
[[package]]
|
515
|
+
name = "windows_aarch64_gnullvm"
|
516
|
+
version = "0.48.5"
|
517
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
518
|
+
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
519
|
+
|
520
|
+
[[package]]
|
521
|
+
name = "windows_aarch64_msvc"
|
522
|
+
version = "0.48.5"
|
523
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
524
|
+
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
525
|
+
|
526
|
+
[[package]]
|
527
|
+
name = "windows_i686_gnu"
|
528
|
+
version = "0.48.5"
|
529
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
530
|
+
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
531
|
+
|
532
|
+
[[package]]
|
533
|
+
name = "windows_i686_msvc"
|
534
|
+
version = "0.48.5"
|
535
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
536
|
+
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
537
|
+
|
538
|
+
[[package]]
|
539
|
+
name = "windows_x86_64_gnu"
|
540
|
+
version = "0.48.5"
|
541
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
542
|
+
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
543
|
+
|
544
|
+
[[package]]
|
545
|
+
name = "windows_x86_64_gnullvm"
|
546
|
+
version = "0.48.5"
|
547
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
548
|
+
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
549
|
+
|
550
|
+
[[package]]
|
551
|
+
name = "windows_x86_64_msvc"
|
552
|
+
version = "0.48.5"
|
553
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
554
|
+
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
data/Cargo.toml
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Andriy Yanko
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# Rustybars
|
2
|
+
|
3
|
+
Ruby binding to [handlebars-rust](https://github.com/sunng87/handlebars-rust)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install the gem and add to the application's Gemfile by executing:
|
8
|
+
|
9
|
+
$ bundle add rustybars
|
10
|
+
|
11
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
12
|
+
|
13
|
+
$ gem install rustybars
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
|
19
|
+
Rustybars.render('Hello {{name}}!', {name: 'John Doe'}.to_json)
|
20
|
+
|
21
|
+
```
|
22
|
+
|
23
|
+
## Development
|
24
|
+
|
25
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
26
|
+
|
27
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
28
|
+
|
29
|
+
## Cross compilation
|
30
|
+
|
31
|
+
```sh
|
32
|
+
bundle exec rb-sys-dock -p arm64-darwin --ruby-versions 3.2 --build
|
33
|
+
bundle exec rb-sys-dock -p x86_64-linux --ruby-versions 3.2 --build
|
34
|
+
```
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ayanko/rustybars. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ayanko/rustybars/blob/master/CODE_OF_CONDUCT.md).
|
39
|
+
|
40
|
+
## License
|
41
|
+
|
42
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
43
|
+
|
44
|
+
## Code of Conduct
|
45
|
+
|
46
|
+
Everyone interacting in the Rustybars project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ayanko/rustybars/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
|
8
|
+
require "rubocop/rake_task"
|
9
|
+
|
10
|
+
RuboCop::RakeTask.new
|
11
|
+
|
12
|
+
require "rb_sys/extensiontask"
|
13
|
+
|
14
|
+
task build: :compile
|
15
|
+
|
16
|
+
GEMSPEC = Gem::Specification.load("rustybars.gemspec")
|
17
|
+
|
18
|
+
RbSys::ExtensionTask.new("rustybars", GEMSPEC) do |ext|
|
19
|
+
ext.lib_dir = "lib/rustybars"
|
20
|
+
ext.cross_compile = true
|
21
|
+
ext.cross_platform = %w[x86_64-linux x86_64-darwin arm64-darwin aarch64-linux]
|
22
|
+
end
|
23
|
+
|
24
|
+
task default: %i[compile spec rubocop]
|
@@ -0,0 +1,16 @@
|
|
1
|
+
[package]
|
2
|
+
name = "rustybars"
|
3
|
+
version = "0.1.0"
|
4
|
+
edition = "2021"
|
5
|
+
authors = ["Andriy Yanko <andriy.yanko@gmail.com>"]
|
6
|
+
license = "MIT"
|
7
|
+
publish = false
|
8
|
+
|
9
|
+
[lib]
|
10
|
+
crate-type = ["cdylib"]
|
11
|
+
|
12
|
+
[dependencies]
|
13
|
+
magnus = { version = "0.6.2" }
|
14
|
+
serde = { version = "1.0", features = ["derive"] }
|
15
|
+
serde_json = "1.0"
|
16
|
+
handlebars = '5.0.0'
|
@@ -0,0 +1,61 @@
|
|
1
|
+
use magnus::{function, exception, prelude::*, value::Lazy, Error, Ruby, RModule};
|
2
|
+
use handlebars::Handlebars;
|
3
|
+
use serde_json;
|
4
|
+
|
5
|
+
|
6
|
+
static RUSTYBARS: Lazy<RModule> = Lazy::new(|ruby| {
|
7
|
+
ruby
|
8
|
+
.define_module("Rustybars")
|
9
|
+
.unwrap()
|
10
|
+
});
|
11
|
+
|
12
|
+
static RUSTYBARS_ERROR: Lazy<exception::ExceptionClass> = Lazy::new(|ruby| {
|
13
|
+
ruby
|
14
|
+
.get_inner(&RUSTYBARS)
|
15
|
+
.define_error("Error", ruby.exception_standard_error())
|
16
|
+
.unwrap()
|
17
|
+
});
|
18
|
+
|
19
|
+
static RUSTYBARS_DATA_ERROR: Lazy<exception::ExceptionClass> = Lazy::new(|ruby| {
|
20
|
+
ruby
|
21
|
+
.get_inner(&RUSTYBARS)
|
22
|
+
.define_error("DataError", ruby.get_inner(&RUSTYBARS_ERROR))
|
23
|
+
.unwrap()
|
24
|
+
});
|
25
|
+
|
26
|
+
static RUSTYBARS_TEMPLATE_ERROR: Lazy<exception::ExceptionClass> = Lazy::new(|ruby| {
|
27
|
+
ruby
|
28
|
+
.get_inner(&RUSTYBARS)
|
29
|
+
.define_error("TemplateError", ruby.get_inner(&RUSTYBARS_ERROR))
|
30
|
+
.unwrap()
|
31
|
+
});
|
32
|
+
|
33
|
+
|
34
|
+
fn render(ruby: &Ruby, template: String, data: String) -> Result<String, Error> {
|
35
|
+
let variables: serde_json::Value = serde_json::from_str(&data).map_err(|e| {
|
36
|
+
Error::new(
|
37
|
+
ruby.get_inner(&RUSTYBARS_DATA_ERROR),
|
38
|
+
e.to_string(),
|
39
|
+
)
|
40
|
+
})?;
|
41
|
+
|
42
|
+
let hbs = Handlebars::new();
|
43
|
+
hbs.render_template(&template, &variables).map_err(|e| {
|
44
|
+
Error::new(
|
45
|
+
ruby.get_inner(&RUSTYBARS_TEMPLATE_ERROR),
|
46
|
+
e.to_string()
|
47
|
+
)
|
48
|
+
})
|
49
|
+
}
|
50
|
+
|
51
|
+
#[magnus::init]
|
52
|
+
fn init(ruby: &Ruby) -> Result<(), Error> {
|
53
|
+
Lazy::force(&RUSTYBARS_DATA_ERROR, ruby);
|
54
|
+
Lazy::force(&RUSTYBARS_TEMPLATE_ERROR, ruby);
|
55
|
+
|
56
|
+
ruby
|
57
|
+
.get_inner(&RUSTYBARS)
|
58
|
+
.define_singleton_method("render", function!(render, 2))?;
|
59
|
+
|
60
|
+
Ok(())
|
61
|
+
}
|
data/lib/rustybars.rb
ADDED
data/sig/rustybars.rbs
ADDED
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rustybars
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andriy Yanko
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-01-18 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- andriy.yanko@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions:
|
18
|
+
- ext/rustybars/Cargo.toml
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- ".rspec"
|
22
|
+
- ".rubocop.yml"
|
23
|
+
- CHANGELOG.md
|
24
|
+
- CODE_OF_CONDUCT.md
|
25
|
+
- Cargo.lock
|
26
|
+
- Cargo.toml
|
27
|
+
- LICENSE.txt
|
28
|
+
- README.md
|
29
|
+
- Rakefile
|
30
|
+
- ext/rustybars/Cargo.toml
|
31
|
+
- ext/rustybars/extconf.rb
|
32
|
+
- ext/rustybars/src/lib.rs
|
33
|
+
- lib/rustybars.rb
|
34
|
+
- lib/rustybars/version.rb
|
35
|
+
- sig/rustybars.rbs
|
36
|
+
homepage: https://github.com/ayanko/rustybars
|
37
|
+
licenses:
|
38
|
+
- MIT
|
39
|
+
metadata: {}
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 3.0.0
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 3.3.11
|
54
|
+
requirements: []
|
55
|
+
rubygems_version: 3.5.4
|
56
|
+
signing_key:
|
57
|
+
specification_version: 4
|
58
|
+
summary: Ruby binding for handlebars-rust
|
59
|
+
test_files: []
|