yamlscript 0.1.65 → 0.1.66
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +4 -0
- data/ReadMe.md +45 -20
- data/lib/yamlscript/version.rb +1 -1
- data/lib/yamlscript.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4898a2bea185c4fa8ae98c0fdcf7feeeea91c364d8f05f53223a91d0e2220154
|
4
|
+
data.tar.gz: e01d3805540211046aa6e7a03a41fdb152e404e33786b8c156a1f863507819ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b0019ed6ceb0d12b9f2944146ed68bec7f4f2cabaff8fc7c51ad0bc764e4254ece1b10d2def1f6880a4852ba4f83e946cee0d63ad4320cbeb0807f1d181d247
|
7
|
+
data.tar.gz: 0e100b1565aa7d0697656c00ee4f56d7a5c97f1a71bf3ef3fca598f833574cfcdc04ceb84326481f0466c210d4faa1f96e02c2f43f8d0c030acf267b8e08fbd2
|
data/ChangeLog.md
CHANGED
data/ReadMe.md
CHANGED
@@ -3,37 +3,52 @@
|
|
3
3
|
YAMLScript
|
4
4
|
==========
|
5
5
|
|
6
|
-
|
6
|
+
Add Logic to Your YAML Files
|
7
7
|
|
8
8
|
|
9
9
|
## Synopsis
|
10
10
|
|
11
|
+
Load `file.yaml` with YAMLScript:
|
11
12
|
```yaml
|
12
|
-
|
13
|
+
!yamlscript/v0/
|
14
|
+
|
15
|
+
=>:
|
16
|
+
names =: curl(
|
17
|
+
"https://raw.githubusercontent.com/dominictarr/" +
|
18
|
+
"random-name/master/first-names.json")
|
19
|
+
.json/load()
|
20
|
+
|
21
|
+
name:: names.rand-nth()
|
22
|
+
aka:: names.rand-nth()
|
23
|
+
age:: 6 * 7
|
24
|
+
color: yellow
|
25
|
+
```
|
13
26
|
|
14
|
-
|
15
|
-
|
27
|
+
and get:
|
28
|
+
```json
|
29
|
+
{
|
30
|
+
"name": "Anthea",
|
31
|
+
"aka": "Patrizia",
|
32
|
+
"age": 42,
|
33
|
+
"color": "yellow"
|
34
|
+
}
|
16
35
|
```
|
17
36
|
|
18
37
|
|
19
38
|
## Description
|
20
39
|
|
21
|
-
YAMLScript is a functional programming language with a
|
40
|
+
[YAMLScript](https://yamlscript.org) is a functional programming language with a
|
41
|
+
clean YAML syntax.
|
22
42
|
|
23
|
-
YAMLScript can be used for
|
43
|
+
YAMLScript can be used for enhancing ordinary [YAML](https://yaml.org) files
|
44
|
+
with functional operations, such as:
|
24
45
|
|
25
|
-
*
|
26
|
-
|
27
|
-
|
28
|
-
* Data transforms including ones defined by you
|
29
|
-
* Writing new programs and applications
|
30
|
-
* Run with `ys file.ys`
|
31
|
-
* Or compile to binary executable with `ys -C file.ys`
|
32
|
-
* Writing reusable shared libraries
|
33
|
-
* High level code instead of C
|
34
|
-
* Bindable to almost any programming language
|
46
|
+
* Import parts of other YAML files to any node
|
47
|
+
* String interpolation including function calls
|
48
|
+
* Data transforms including ones defined by you
|
35
49
|
|
36
|
-
YAMLScript should be a drop-in replacement for your YAML
|
50
|
+
This YAMLScript library should be a drop-in replacement for your current YAML
|
51
|
+
loader!
|
37
52
|
|
38
53
|
Most existing YAML files are already valid YAMLScript files.
|
39
54
|
This means that YAMLScript works as a normal YAML loader, but can also evaluate
|
@@ -53,6 +68,14 @@ CLI binary, `ys`, to run:
|
|
53
68
|
|
54
69
|
```text
|
55
70
|
$ ys --compile file.ys
|
71
|
+
(def names
|
72
|
+
(_-> (curl (+_ "https://raw.githubusercontent.com/dominictarr/"
|
73
|
+
"random-name/master/first-names.json"))
|
74
|
+
(list json/load)))
|
75
|
+
{"age" (*_ 6 7),
|
76
|
+
"aka" (_-> names (list rand-nth)),
|
77
|
+
"color" "yellow",
|
78
|
+
"name" (_-> names (list rand-nth))}
|
56
79
|
```
|
57
80
|
|
58
81
|
|
@@ -120,9 +143,11 @@ See https://github.com/yaml/yamlscript?#installing-yamlscript for more info.
|
|
120
143
|
|
121
144
|
## See Also
|
122
145
|
|
123
|
-
* [
|
124
|
-
* [
|
125
|
-
* [
|
146
|
+
* [YAMLScript Web Site](https://yamlscript.org)
|
147
|
+
* [YAMLScript Blog](https://yamlscript.org/blog)
|
148
|
+
* [YAMLScript Source Code](https://github.com/yaml/yamlscript)
|
149
|
+
* [YAMLScript Samples](https://github.com/yaml/yamlscript/tree/main/sample)
|
150
|
+
* [YAMLScript Programs](https://rosettacode.org/wiki/Category:YAMLScript)
|
126
151
|
* [YAML](https://yaml.org)
|
127
152
|
* [Clojure](https://clojure.org)
|
128
153
|
|
data/lib/yamlscript/version.rb
CHANGED
data/lib/yamlscript.rb
CHANGED
@@ -16,7 +16,7 @@ class YAMLScript
|
|
16
16
|
# This value is automatically updated by 'make bump'.
|
17
17
|
# The version number is used to find the correct shared library file.
|
18
18
|
# We currently only support binding to an exact version of libyamlscript.
|
19
|
-
YAMLSCRIPT_VERSION = '0.1.
|
19
|
+
YAMLSCRIPT_VERSION = '0.1.66'
|
20
20
|
|
21
21
|
# A low-level interface to the native library
|
22
22
|
module LibYAMLScript
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yamlscript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.66
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ingy döt Net
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-07-
|
12
|
+
date: 2024-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|