yerba 0.0.1 → 0.1.0
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 +4 -4
- data/README.md +2 -0
- data/exe/yerba +2 -2
- data/ext/yerba/extconf.rb +54 -0
- data/lib/yerba/version.rb +1 -1
- data/lib/yerba.rb +99 -0
- data/rust/Cargo.lock +429 -0
- data/rust/Cargo.toml +32 -0
- data/rust/rustfmt.toml +2 -0
- data/rust/src/document.rs +1779 -0
- data/rust/src/error.rs +50 -0
- data/rust/src/json.rs +169 -0
- data/rust/src/lib.rs +22 -0
- data/rust/src/main.rs +856 -0
- data/rust/src/quote_style.rs +42 -0
- data/rust/src/syntax.rs +186 -0
- data/rust/src/yerbafile.rs +563 -0
- data/yerba.gemspec +8 -3
- metadata +15 -3
- data/Rakefile +0 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66b8b0728c15c2a4cc31175f059b8cd4eb95b191981f061b766db20250c59346
|
|
4
|
+
data.tar.gz: 4aa5540ec6cf715056a7efcbfc81eac8adc7fefbbee75505c02b844e8d748a6a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 103ca2c88f1c57d9e552837ef7d9461d5ac746aac95feff7c6aa361d661bc59c510ce47be290abb964352a06eaf9f877c0719b4fe8dbd97cf88d18e5f61ff177
|
|
7
|
+
data.tar.gz: f2e691936ace407d431f73036f9e9c16f30ce0b1de0ed57905a26322fd7f5341e43742bc2fb06e0ed304aa87b6050b2acf77a2cfd06fbfaeae4ce5ddbb5d80e9
|
data/README.md
CHANGED
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
**Yerba** is a lossless YAML editing tool that lets you programmatically modify YAML files while preserving their original structure, comments, and formatting.
|
|
19
19
|
|
|
20
|
+
Yerba was born out of the need to manage, validate, programmatically modify, and enforce lossless and consistent style/formatting for the YAML data files in the [RubyEvents.org](https://github.com/rubyevents/rubyevents) project.
|
|
21
|
+
|
|
20
22
|
### Command-Line Usage
|
|
21
23
|
|
|
22
24
|
Install the Yerba gem via RubyGems:
|
data/exe/yerba
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "fileutils"
|
|
4
|
+
|
|
5
|
+
rust_dir = File.expand_path("../../rust", __dir__)
|
|
6
|
+
root_dir = File.expand_path("../..", __dir__)
|
|
7
|
+
|
|
8
|
+
platform = Gem::Platform.local
|
|
9
|
+
platform_key = "#{platform.cpu}-#{platform.os}"
|
|
10
|
+
exe_directory = File.join(root_dir, "exe", platform_key)
|
|
11
|
+
exe_file = File.join(exe_directory, "yerba")
|
|
12
|
+
|
|
13
|
+
if File.executable?(exe_file)
|
|
14
|
+
puts "yerba: Precompiled binary found at #{exe_file}"
|
|
15
|
+
else
|
|
16
|
+
puts "yerba: No precompiled binary found. Compiling from Rust source..."
|
|
17
|
+
|
|
18
|
+
unless system("cargo --version > /dev/null 2>&1")
|
|
19
|
+
abort <<~MESSAGE
|
|
20
|
+
|
|
21
|
+
ERROR: Rust toolchain not found.
|
|
22
|
+
|
|
23
|
+
yerba requires a precompiled binary or the Rust toolchain to compile from source.
|
|
24
|
+
|
|
25
|
+
Install Rust: https://rustup.rs
|
|
26
|
+
|
|
27
|
+
MESSAGE
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
unless system("cd #{rust_dir} && cargo build --release")
|
|
31
|
+
abort "ERROR: Failed to compile yerba from Rust source."
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
source_binary = File.join(rust_dir, "target", "release", "yerba")
|
|
35
|
+
|
|
36
|
+
unless File.exist?(source_binary)
|
|
37
|
+
abort "ERROR: Compilation succeeded but binary not found at #{source_binary}"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
FileUtils.mkdir_p(exe_directory)
|
|
41
|
+
FileUtils.cp(source_binary, exe_file)
|
|
42
|
+
FileUtils.chmod(0o755, exe_file)
|
|
43
|
+
|
|
44
|
+
puts "yerba: Successfully compiled binary to #{exe_file}"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
File.write("Makefile", <<~MAKEFILE)
|
|
48
|
+
all:
|
|
49
|
+
\t@echo "yerba: nothing to build"
|
|
50
|
+
install:
|
|
51
|
+
\t@echo "yerba: nothing to install"
|
|
52
|
+
clean:
|
|
53
|
+
\t@echo "yerba: nothing to clean"
|
|
54
|
+
MAKEFILE
|
data/lib/yerba/version.rb
CHANGED
data/lib/yerba.rb
CHANGED
|
@@ -3,4 +3,103 @@
|
|
|
3
3
|
require_relative "yerba/version"
|
|
4
4
|
|
|
5
5
|
module Yerba
|
|
6
|
+
class UnsupportedPlatformError < StandardError; end
|
|
7
|
+
class ExecutableNotFoundError < StandardError; end
|
|
8
|
+
class CompilationError < StandardError; end
|
|
9
|
+
|
|
10
|
+
GEM_NAME = "yerba"
|
|
11
|
+
EXECUTABLE_NAME = "yerba"
|
|
12
|
+
|
|
13
|
+
NATIVE_PLATFORMS = {
|
|
14
|
+
"arm64-darwin" => "arm64-darwin",
|
|
15
|
+
"x86_64-darwin" => "x86_64-darwin",
|
|
16
|
+
"aarch64-linux" => "aarch64-linux",
|
|
17
|
+
"arm64-linux" => "aarch64-linux",
|
|
18
|
+
"x86_64-linux" => "x86_64-linux",
|
|
19
|
+
}.freeze
|
|
20
|
+
|
|
21
|
+
def self.executable(exe_path: nil)
|
|
22
|
+
if exe_path
|
|
23
|
+
return exe_path if File.executable?(exe_path)
|
|
24
|
+
|
|
25
|
+
raise ExecutableNotFoundError, "yerba executable not found at #{exe_path}"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
if ENV["YERBA_INSTALL_DIR"]
|
|
29
|
+
install_dir_exe = File.join(ENV["YERBA_INSTALL_DIR"], EXECUTABLE_NAME)
|
|
30
|
+
|
|
31
|
+
if File.executable?(install_dir_exe)
|
|
32
|
+
return install_dir_exe
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
raise ExecutableNotFoundError,
|
|
36
|
+
"yerba executable not found at #{install_dir_exe} (set by YERBA_INSTALL_DIR)"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Try platform-specific precompiled binary
|
|
40
|
+
platform = Gem::Platform.local
|
|
41
|
+
platform_key = "#{platform.cpu}-#{platform.os}"
|
|
42
|
+
|
|
43
|
+
exe_directory = NATIVE_PLATFORMS[platform_key]
|
|
44
|
+
|
|
45
|
+
if exe_directory
|
|
46
|
+
exe_file = File.expand_path(
|
|
47
|
+
File.join("..", "exe", exe_directory, EXECUTABLE_NAME),
|
|
48
|
+
__dir__
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
return exe_file if File.executable?(exe_file)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Try compiling from source if Rust source is bundled
|
|
55
|
+
compiled = compile_from_source
|
|
56
|
+
|
|
57
|
+
return compiled if compiled
|
|
58
|
+
|
|
59
|
+
if exe_directory
|
|
60
|
+
raise ExecutableNotFoundError,
|
|
61
|
+
"yerba executable not found at exe/#{exe_directory}/yerba. " \
|
|
62
|
+
"Try reinstalling the gem: gem install yerba"
|
|
63
|
+
else
|
|
64
|
+
raise UnsupportedPlatformError,
|
|
65
|
+
"yerba does not have a precompiled binary for #{platform_key}. " \
|
|
66
|
+
"Install Rust (https://rustup.rs) and reinstall the gem to compile from source, " \
|
|
67
|
+
"or set YERBA_INSTALL_DIR to use a custom binary."
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def self.compile_from_source
|
|
72
|
+
rust_dir = File.expand_path(File.join("..", "rust"), __dir__)
|
|
73
|
+
|
|
74
|
+
return nil unless File.exist?(File.join(rust_dir, "Cargo.toml"))
|
|
75
|
+
return nil unless system("cargo --version > /dev/null 2>&1")
|
|
76
|
+
|
|
77
|
+
platform = Gem::Platform.local
|
|
78
|
+
platform_key = "#{platform.cpu}-#{platform.os}"
|
|
79
|
+
exe_directory = File.join(File.expand_path(File.join("..", "exe", platform_key), __dir__))
|
|
80
|
+
exe_file = File.join(exe_directory, EXECUTABLE_NAME)
|
|
81
|
+
|
|
82
|
+
return exe_file if File.executable?(exe_file)
|
|
83
|
+
|
|
84
|
+
warn "yerba: No precompiled binary found. Compiling from source..."
|
|
85
|
+
|
|
86
|
+
FileUtils.mkdir_p(exe_directory)
|
|
87
|
+
|
|
88
|
+
unless system("cd #{rust_dir} && cargo build --release")
|
|
89
|
+
raise CompilationError, "Failed to compile yerba from source. Is Rust installed?"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
source_binary = File.join(rust_dir, "target", "release", EXECUTABLE_NAME)
|
|
93
|
+
|
|
94
|
+
unless File.exist?(source_binary)
|
|
95
|
+
raise CompilationError, "Compilation succeeded but binary not found at #{source_binary}"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
FileUtils.cp(source_binary, exe_file)
|
|
99
|
+
FileUtils.chmod(0o755, exe_file)
|
|
100
|
+
|
|
101
|
+
exe_file
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
private_class_method :compile_from_source
|
|
6
105
|
end
|
data/rust/Cargo.lock
ADDED
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "anstream"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"anstyle",
|
|
12
|
+
"anstyle-parse",
|
|
13
|
+
"anstyle-query",
|
|
14
|
+
"anstyle-wincon",
|
|
15
|
+
"colorchoice",
|
|
16
|
+
"is_terminal_polyfill",
|
|
17
|
+
"utf8parse",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[[package]]
|
|
21
|
+
name = "anstyle"
|
|
22
|
+
version = "1.0.14"
|
|
23
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
24
|
+
checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
|
|
25
|
+
|
|
26
|
+
[[package]]
|
|
27
|
+
name = "anstyle-parse"
|
|
28
|
+
version = "1.0.0"
|
|
29
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
30
|
+
checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
|
|
31
|
+
dependencies = [
|
|
32
|
+
"utf8parse",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "anstyle-query"
|
|
37
|
+
version = "1.1.5"
|
|
38
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
+
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
|
40
|
+
dependencies = [
|
|
41
|
+
"windows-sys",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[[package]]
|
|
45
|
+
name = "anstyle-wincon"
|
|
46
|
+
version = "3.0.11"
|
|
47
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
|
+
checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
|
|
49
|
+
dependencies = [
|
|
50
|
+
"anstyle",
|
|
51
|
+
"once_cell_polyfill",
|
|
52
|
+
"windows-sys",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[[package]]
|
|
56
|
+
name = "clap"
|
|
57
|
+
version = "4.6.1"
|
|
58
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
59
|
+
checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51"
|
|
60
|
+
dependencies = [
|
|
61
|
+
"clap_builder",
|
|
62
|
+
"clap_derive",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[[package]]
|
|
66
|
+
name = "clap_builder"
|
|
67
|
+
version = "4.6.0"
|
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
69
|
+
checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f"
|
|
70
|
+
dependencies = [
|
|
71
|
+
"anstream",
|
|
72
|
+
"anstyle",
|
|
73
|
+
"clap_lex",
|
|
74
|
+
"strsim",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[[package]]
|
|
78
|
+
name = "clap_derive"
|
|
79
|
+
version = "4.6.1"
|
|
80
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
81
|
+
checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9"
|
|
82
|
+
dependencies = [
|
|
83
|
+
"heck",
|
|
84
|
+
"proc-macro2",
|
|
85
|
+
"quote",
|
|
86
|
+
"syn",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
[[package]]
|
|
90
|
+
name = "clap_lex"
|
|
91
|
+
version = "1.1.0"
|
|
92
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
93
|
+
checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
|
|
94
|
+
|
|
95
|
+
[[package]]
|
|
96
|
+
name = "colorchoice"
|
|
97
|
+
version = "1.0.5"
|
|
98
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
99
|
+
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
|
100
|
+
|
|
101
|
+
[[package]]
|
|
102
|
+
name = "countme"
|
|
103
|
+
version = "3.0.1"
|
|
104
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
105
|
+
checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636"
|
|
106
|
+
|
|
107
|
+
[[package]]
|
|
108
|
+
name = "crossbeam-deque"
|
|
109
|
+
version = "0.8.6"
|
|
110
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
111
|
+
checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
|
|
112
|
+
dependencies = [
|
|
113
|
+
"crossbeam-epoch",
|
|
114
|
+
"crossbeam-utils",
|
|
115
|
+
]
|
|
116
|
+
|
|
117
|
+
[[package]]
|
|
118
|
+
name = "crossbeam-epoch"
|
|
119
|
+
version = "0.9.18"
|
|
120
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
121
|
+
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
|
|
122
|
+
dependencies = [
|
|
123
|
+
"crossbeam-utils",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "crossbeam-utils"
|
|
128
|
+
version = "0.8.21"
|
|
129
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
+
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
131
|
+
|
|
132
|
+
[[package]]
|
|
133
|
+
name = "either"
|
|
134
|
+
version = "1.15.0"
|
|
135
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
136
|
+
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
|
|
137
|
+
|
|
138
|
+
[[package]]
|
|
139
|
+
name = "equivalent"
|
|
140
|
+
version = "1.0.2"
|
|
141
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
142
|
+
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
143
|
+
|
|
144
|
+
[[package]]
|
|
145
|
+
name = "glob"
|
|
146
|
+
version = "0.3.3"
|
|
147
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
148
|
+
checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
|
|
149
|
+
|
|
150
|
+
[[package]]
|
|
151
|
+
name = "hashbrown"
|
|
152
|
+
version = "0.14.5"
|
|
153
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
154
|
+
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
|
|
155
|
+
|
|
156
|
+
[[package]]
|
|
157
|
+
name = "hashbrown"
|
|
158
|
+
version = "0.17.0"
|
|
159
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
160
|
+
checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51"
|
|
161
|
+
|
|
162
|
+
[[package]]
|
|
163
|
+
name = "heck"
|
|
164
|
+
version = "0.5.0"
|
|
165
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
166
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
167
|
+
|
|
168
|
+
[[package]]
|
|
169
|
+
name = "indexmap"
|
|
170
|
+
version = "2.14.0"
|
|
171
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
172
|
+
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
|
|
173
|
+
dependencies = [
|
|
174
|
+
"equivalent",
|
|
175
|
+
"hashbrown 0.17.0",
|
|
176
|
+
]
|
|
177
|
+
|
|
178
|
+
[[package]]
|
|
179
|
+
name = "indoc"
|
|
180
|
+
version = "2.0.7"
|
|
181
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
182
|
+
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
|
183
|
+
dependencies = [
|
|
184
|
+
"rustversion",
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
[[package]]
|
|
188
|
+
name = "is_terminal_polyfill"
|
|
189
|
+
version = "1.70.2"
|
|
190
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
191
|
+
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
|
192
|
+
|
|
193
|
+
[[package]]
|
|
194
|
+
name = "itoa"
|
|
195
|
+
version = "1.0.18"
|
|
196
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
197
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
198
|
+
|
|
199
|
+
[[package]]
|
|
200
|
+
name = "memchr"
|
|
201
|
+
version = "2.8.0"
|
|
202
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
203
|
+
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
|
204
|
+
|
|
205
|
+
[[package]]
|
|
206
|
+
name = "once_cell_polyfill"
|
|
207
|
+
version = "1.70.2"
|
|
208
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
209
|
+
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
|
210
|
+
|
|
211
|
+
[[package]]
|
|
212
|
+
name = "proc-macro2"
|
|
213
|
+
version = "1.0.106"
|
|
214
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
215
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
216
|
+
dependencies = [
|
|
217
|
+
"unicode-ident",
|
|
218
|
+
]
|
|
219
|
+
|
|
220
|
+
[[package]]
|
|
221
|
+
name = "quote"
|
|
222
|
+
version = "1.0.45"
|
|
223
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
224
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
225
|
+
dependencies = [
|
|
226
|
+
"proc-macro2",
|
|
227
|
+
]
|
|
228
|
+
|
|
229
|
+
[[package]]
|
|
230
|
+
name = "rayon"
|
|
231
|
+
version = "1.12.0"
|
|
232
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
233
|
+
checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
|
|
234
|
+
dependencies = [
|
|
235
|
+
"either",
|
|
236
|
+
"rayon-core",
|
|
237
|
+
]
|
|
238
|
+
|
|
239
|
+
[[package]]
|
|
240
|
+
name = "rayon-core"
|
|
241
|
+
version = "1.13.0"
|
|
242
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
243
|
+
checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
|
|
244
|
+
dependencies = [
|
|
245
|
+
"crossbeam-deque",
|
|
246
|
+
"crossbeam-utils",
|
|
247
|
+
]
|
|
248
|
+
|
|
249
|
+
[[package]]
|
|
250
|
+
name = "rowan"
|
|
251
|
+
version = "0.16.1"
|
|
252
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
253
|
+
checksum = "417a3a9f582e349834051b8a10c8d71ca88da4211e4093528e36b9845f6b5f21"
|
|
254
|
+
dependencies = [
|
|
255
|
+
"countme",
|
|
256
|
+
"hashbrown 0.14.5",
|
|
257
|
+
"rustc-hash",
|
|
258
|
+
"text-size",
|
|
259
|
+
]
|
|
260
|
+
|
|
261
|
+
[[package]]
|
|
262
|
+
name = "rustc-hash"
|
|
263
|
+
version = "1.1.0"
|
|
264
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
265
|
+
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
|
266
|
+
|
|
267
|
+
[[package]]
|
|
268
|
+
name = "rustversion"
|
|
269
|
+
version = "1.0.22"
|
|
270
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
271
|
+
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
|
272
|
+
|
|
273
|
+
[[package]]
|
|
274
|
+
name = "ryu"
|
|
275
|
+
version = "1.0.23"
|
|
276
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
277
|
+
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
|
|
278
|
+
|
|
279
|
+
[[package]]
|
|
280
|
+
name = "serde"
|
|
281
|
+
version = "1.0.228"
|
|
282
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
283
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
284
|
+
dependencies = [
|
|
285
|
+
"serde_core",
|
|
286
|
+
"serde_derive",
|
|
287
|
+
]
|
|
288
|
+
|
|
289
|
+
[[package]]
|
|
290
|
+
name = "serde_core"
|
|
291
|
+
version = "1.0.228"
|
|
292
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
293
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
294
|
+
dependencies = [
|
|
295
|
+
"serde_derive",
|
|
296
|
+
]
|
|
297
|
+
|
|
298
|
+
[[package]]
|
|
299
|
+
name = "serde_derive"
|
|
300
|
+
version = "1.0.228"
|
|
301
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
302
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
303
|
+
dependencies = [
|
|
304
|
+
"proc-macro2",
|
|
305
|
+
"quote",
|
|
306
|
+
"syn",
|
|
307
|
+
]
|
|
308
|
+
|
|
309
|
+
[[package]]
|
|
310
|
+
name = "serde_json"
|
|
311
|
+
version = "1.0.149"
|
|
312
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
313
|
+
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
|
314
|
+
dependencies = [
|
|
315
|
+
"itoa",
|
|
316
|
+
"memchr",
|
|
317
|
+
"serde",
|
|
318
|
+
"serde_core",
|
|
319
|
+
"zmij",
|
|
320
|
+
]
|
|
321
|
+
|
|
322
|
+
[[package]]
|
|
323
|
+
name = "serde_yaml"
|
|
324
|
+
version = "0.9.34+deprecated"
|
|
325
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
326
|
+
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
|
|
327
|
+
dependencies = [
|
|
328
|
+
"indexmap",
|
|
329
|
+
"itoa",
|
|
330
|
+
"ryu",
|
|
331
|
+
"serde",
|
|
332
|
+
"unsafe-libyaml",
|
|
333
|
+
]
|
|
334
|
+
|
|
335
|
+
[[package]]
|
|
336
|
+
name = "strsim"
|
|
337
|
+
version = "0.11.1"
|
|
338
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
339
|
+
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
|
340
|
+
|
|
341
|
+
[[package]]
|
|
342
|
+
name = "syn"
|
|
343
|
+
version = "2.0.117"
|
|
344
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
345
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
346
|
+
dependencies = [
|
|
347
|
+
"proc-macro2",
|
|
348
|
+
"quote",
|
|
349
|
+
"unicode-ident",
|
|
350
|
+
]
|
|
351
|
+
|
|
352
|
+
[[package]]
|
|
353
|
+
name = "text-size"
|
|
354
|
+
version = "1.1.1"
|
|
355
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
356
|
+
checksum = "f18aa187839b2bdb1ad2fa35ead8c4c2976b64e4363c386d45ac0f7ee85c9233"
|
|
357
|
+
|
|
358
|
+
[[package]]
|
|
359
|
+
name = "unicode-ident"
|
|
360
|
+
version = "1.0.24"
|
|
361
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
362
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
363
|
+
|
|
364
|
+
[[package]]
|
|
365
|
+
name = "unsafe-libyaml"
|
|
366
|
+
version = "0.2.11"
|
|
367
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
368
|
+
checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
|
|
369
|
+
|
|
370
|
+
[[package]]
|
|
371
|
+
name = "utf8parse"
|
|
372
|
+
version = "0.2.2"
|
|
373
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
374
|
+
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
|
375
|
+
|
|
376
|
+
[[package]]
|
|
377
|
+
name = "windows-link"
|
|
378
|
+
version = "0.2.1"
|
|
379
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
380
|
+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
|
381
|
+
|
|
382
|
+
[[package]]
|
|
383
|
+
name = "windows-sys"
|
|
384
|
+
version = "0.61.2"
|
|
385
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
386
|
+
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
|
387
|
+
dependencies = [
|
|
388
|
+
"windows-link",
|
|
389
|
+
]
|
|
390
|
+
|
|
391
|
+
[[package]]
|
|
392
|
+
name = "winnow"
|
|
393
|
+
version = "0.7.15"
|
|
394
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
395
|
+
checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"
|
|
396
|
+
dependencies = [
|
|
397
|
+
"memchr",
|
|
398
|
+
]
|
|
399
|
+
|
|
400
|
+
[[package]]
|
|
401
|
+
name = "yaml_parser"
|
|
402
|
+
version = "0.3.0"
|
|
403
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
404
|
+
checksum = "71ebb04c72edf699612d543f6c421142527b85ac180156017fa26be49dc0762f"
|
|
405
|
+
dependencies = [
|
|
406
|
+
"rowan",
|
|
407
|
+
"winnow",
|
|
408
|
+
]
|
|
409
|
+
|
|
410
|
+
[[package]]
|
|
411
|
+
name = "yerba"
|
|
412
|
+
version = "0.1.0"
|
|
413
|
+
dependencies = [
|
|
414
|
+
"clap",
|
|
415
|
+
"glob",
|
|
416
|
+
"indoc",
|
|
417
|
+
"rayon",
|
|
418
|
+
"rowan",
|
|
419
|
+
"serde",
|
|
420
|
+
"serde_json",
|
|
421
|
+
"serde_yaml",
|
|
422
|
+
"yaml_parser",
|
|
423
|
+
]
|
|
424
|
+
|
|
425
|
+
[[package]]
|
|
426
|
+
name = "zmij"
|
|
427
|
+
version = "1.0.21"
|
|
428
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
429
|
+
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
data/rust/Cargo.toml
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "yerba"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
authors = ["Marco Roth <marco.roth@intergga.ch>"]
|
|
6
|
+
description = "YAML Editing and Refactoring with Better Accuracy"
|
|
7
|
+
readme = "../README.md"
|
|
8
|
+
license = "MIT"
|
|
9
|
+
repository = "https://github.com/marcoroth/yerba"
|
|
10
|
+
keywords = ["yaml", "editing", "refactoring", "lossless", "cli"]
|
|
11
|
+
categories = ["parser-implementations", "development-tools"]
|
|
12
|
+
|
|
13
|
+
[lib]
|
|
14
|
+
name = "yerba"
|
|
15
|
+
path = "src/lib.rs"
|
|
16
|
+
|
|
17
|
+
[[bin]]
|
|
18
|
+
name = "yerba"
|
|
19
|
+
path = "src/main.rs"
|
|
20
|
+
|
|
21
|
+
[dependencies]
|
|
22
|
+
yaml_parser = "0.3"
|
|
23
|
+
rowan = "0.16"
|
|
24
|
+
glob = "0.3"
|
|
25
|
+
serde = { version = "1", features = ["derive"] }
|
|
26
|
+
serde_yaml = "0.9"
|
|
27
|
+
serde_json = "1"
|
|
28
|
+
clap = { version = "4", features = ["derive"] }
|
|
29
|
+
indoc = "2"
|
|
30
|
+
rayon = "1"
|
|
31
|
+
|
|
32
|
+
[dev-dependencies]
|
data/rust/rustfmt.toml
ADDED