yamlscript 0.1.65 → 0.1.67

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: 7d7bf29855335f3bcf402174261766965ed5fe973d8ae146f61309e67b122a62
4
- data.tar.gz: d1823f514603647e7572ba71d7ad43f4f4828a7d9af158ba85fe350a6d85ddbf
3
+ metadata.gz: '0882f28f507724e4423834e89d19e74aaf8e1c2bf5d5bd8b3b800f12c54088f9'
4
+ data.tar.gz: 68162847a5259cc137f59f0542a18b1f9f580d5438da5a9ad6de1b6fbd91a5fb
5
5
  SHA512:
6
- metadata.gz: a2e6f2ef909d2d2041d1f2e82815d1cb7225ae2c81c92bbbf36df2c74229197dcfc83c8fa94903b5d5c6a2724391f3efb4e4c9571b2db837944d1d8c10ca711d
7
- data.tar.gz: 8e581fa11f646d6f56dbac7cab3f2556e660796318e863226ef880925ad1f56648d3f6d12214d7836a11ff37ca8d86cb082ef3f4af92dfa44c9777076b6690ba
6
+ metadata.gz: 601b7202c6555f91558f5e2603c7d62f17eb2bc8092c2818adb4efcb59298d3e24120315c906ea1a3ece4d1da55464e2e040e27fa9f6982538c5983cab86d4b8
7
+ data.tar.gz: 3b3b6ce700936675fde16c7e19d31a74b806310cb86cbcb5d5c1981d63baa82dc745ef3c6ff3bdfcd3d359b7f5b6a317c1e88915a6da3dbcdbe7b9895a8c38f4
data/ChangeLog.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.1.67] - 2024-07-16
2
+
3
+ - libyamlscript 0.1.67
4
+
5
+ ## [0.1.66] - 2024-07-11
6
+
7
+ - libyamlscript 0.1.66
8
+
1
9
  ## [0.1.65] - 2024-07-06
2
10
 
3
11
  - libyamlscript 0.1.65
data/ReadMe.md CHANGED
@@ -3,37 +3,58 @@
3
3
  YAMLScript
4
4
  ==========
5
5
 
6
- Program in YAML
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
- #!/usr/bin/env ys-0
13
+ !yamlscript/v0/
14
+
15
+ =>:
16
+ names-url =:
17
+ ("https://raw.githubusercontent.com/dominictarr/" +
18
+ "random-name/master/first-names.json")
19
+
20
+ name-list =: &first-names json/load(curl(names-url))
21
+
22
+ # Data object with literal keys and generated values:
23
+ name:: rand-nth(*first-names)
24
+ aka:: name-list.rand-nth()
25
+ age:: &num 2 * 3 * 7
26
+ color:: &hue qw(red green blue yellow)
27
+ .shuffle()
28
+ .first()
29
+ title:: "$(*num) shades of $(*hue)."
30
+ ```
13
31
 
14
- defn main(name='world'):
15
- say: "Hello, $name!"
32
+ and get:
33
+ ```json
34
+ {
35
+ "name": "Dolores",
36
+ "aka": "Anita",
37
+ "age": 42,
38
+ "color": "green",
39
+ "title": "42 shades of green."
40
+ }
16
41
  ```
17
42
 
18
43
 
19
44
  ## Description
20
45
 
21
- YAMLScript is a functional programming language with a stylized YAML syntax.
46
+ [YAMLScript](https://yamlscript.org) is a functional programming language with a
47
+ clean YAML syntax.
22
48
 
23
- YAMLScript can be used for:
49
+ YAMLScript can be used for enhancing ordinary [YAML](https://yaml.org) files
50
+ with functional operations, such as:
24
51
 
25
- * Enhancing ordinary YAML files with functional operations
26
- * Import parts of other YAML files to any node
27
- * String interpolation including function calls
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
52
+ * Import (parts of) other YAML files to any node
53
+ * String interpolation including function calls
54
+ * Data transforms including ones defined by you
35
55
 
36
- YAMLScript should be a drop-in replacement for your YAML loader!
56
+ This YAMLScript library should be a drop-in replacement for your current YAML
57
+ loader!
37
58
 
38
59
  Most existing YAML files are already valid YAMLScript files.
39
60
  This means that YAMLScript works as a normal YAML loader, but can also evaluate
@@ -49,10 +70,19 @@ YAMLScript is compiled to a native shared library (`libyamlscript.so`) that can
49
70
  be used by any programming language that can load shared libraries.
50
71
 
51
72
  To see the Clojure code that YAMLScript compiles to, you can use the YAMLScript
52
- CLI binary, `ys`, to run:
73
+ CLI binary `ys` to run:
53
74
 
54
75
  ```text
55
76
  $ ys --compile file.ys
77
+ (def names-url
78
+ (+_ "https://raw.githubusercontent.com/dominictarr/"
79
+ "random-name/master/first-names.json"))
80
+ (def name-list (_& 'first-names (json/load (curl names-url))))
81
+ {"age" (_& 'num (*_ 2 3 7)),
82
+ "aka" (_-> name-list (list rand-nth)),
83
+ "color" (_& 'hue (_-> (qw red green blue yellow) (list shuffle) (list first))),
84
+ "name" (rand-nth (_** 'first-names)),
85
+ "title" (str (_** 'num) " shades of " (_** 'hue) ".")}
56
86
  ```
57
87
 
58
88
 
@@ -120,9 +150,11 @@ See https://github.com/yaml/yamlscript?#installing-yamlscript for more info.
120
150
 
121
151
  ## See Also
122
152
 
123
- * [The YAMLScript Web Site](https://yamlscript.org)
124
- * [The YAMLScript Blog](https://yamlscript.org/blog)
125
- * [The YAMLScript Source Code](https://github.com/yaml/yamlscript)
153
+ * [YAMLScript Web Site](https://yamlscript.org)
154
+ * [YAMLScript Blog](https://yamlscript.org/blog)
155
+ * [YAMLScript Source Code](https://github.com/yaml/yamlscript)
156
+ * [YAMLScript Samples](https://github.com/yaml/yamlscript/tree/main/sample)
157
+ * [YAMLScript Programs](https://rosettacode.org/wiki/Category:YAMLScript)
126
158
  * [YAML](https://yaml.org)
127
159
  * [Clojure](https://clojure.org)
128
160
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class YAMLScript
4
- VERSION = "0.1.65"
4
+ VERSION = "0.1.67"
5
5
  end
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.65'
19
+ YAMLSCRIPT_VERSION = '0.1.67'
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.65
4
+ version: 0.1.67
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-06 00:00:00.000000000 Z
12
+ date: 2024-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest