yamlscript 0.1.66 → 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: 4898a2bea185c4fa8ae98c0fdcf7feeeea91c364d8f05f53223a91d0e2220154
4
- data.tar.gz: e01d3805540211046aa6e7a03a41fdb152e404e33786b8c156a1f863507819ea
3
+ metadata.gz: '0882f28f507724e4423834e89d19e74aaf8e1c2bf5d5bd8b3b800f12c54088f9'
4
+ data.tar.gz: 68162847a5259cc137f59f0542a18b1f9f580d5438da5a9ad6de1b6fbd91a5fb
5
5
  SHA512:
6
- metadata.gz: 0b0019ed6ceb0d12b9f2944146ed68bec7f4f2cabaff8fc7c51ad0bc764e4254ece1b10d2def1f6880a4852ba4f83e946cee0d63ad4320cbeb0807f1d181d247
7
- data.tar.gz: 0e100b1565aa7d0697656c00ee4f56d7a5c97f1a71bf3ef3fca598f833574cfcdc04ceb84326481f0466c210d4faa1f96e02c2f43f8d0c030acf267b8e08fbd2
6
+ metadata.gz: 601b7202c6555f91558f5e2603c7d62f17eb2bc8092c2818adb4efcb59298d3e24120315c906ea1a3ece4d1da55464e2e040e27fa9f6982538c5983cab86d4b8
7
+ data.tar.gz: 3b3b6ce700936675fde16c7e19d31a74b806310cb86cbcb5d5c1981d63baa82dc745ef3c6ff3bdfcd3d359b7f5b6a317c1e88915a6da3dbcdbe7b9895a8c38f4
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.1.67] - 2024-07-16
2
+
3
+ - libyamlscript 0.1.67
4
+
1
5
  ## [0.1.66] - 2024-07-11
2
6
 
3
7
  - libyamlscript 0.1.66
data/ReadMe.md CHANGED
@@ -13,24 +13,30 @@ Load `file.yaml` with YAMLScript:
13
13
  !yamlscript/v0/
14
14
 
15
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
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)."
25
30
  ```
26
31
 
27
32
  and get:
28
33
  ```json
29
34
  {
30
- "name": "Anthea",
31
- "aka": "Patrizia",
35
+ "name": "Dolores",
36
+ "aka": "Anita",
32
37
  "age": 42,
33
- "color": "yellow"
38
+ "color": "green",
39
+ "title": "42 shades of green."
34
40
  }
35
41
  ```
36
42
 
@@ -43,7 +49,7 @@ clean YAML syntax.
43
49
  YAMLScript can be used for enhancing ordinary [YAML](https://yaml.org) files
44
50
  with functional operations, such as:
45
51
 
46
- * Import parts of other YAML files to any node
52
+ * Import (parts of) other YAML files to any node
47
53
  * String interpolation including function calls
48
54
  * Data transforms including ones defined by you
49
55
 
@@ -64,18 +70,19 @@ YAMLScript is compiled to a native shared library (`libyamlscript.so`) that can
64
70
  be used by any programming language that can load shared libraries.
65
71
 
66
72
  To see the Clojure code that YAMLScript compiles to, you can use the YAMLScript
67
- CLI binary, `ys`, to run:
73
+ CLI binary `ys` to run:
68
74
 
69
75
  ```text
70
76
  $ 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))}
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) ".")}
79
86
  ```
80
87
 
81
88
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class YAMLScript
4
- VERSION = "0.1.66"
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.66'
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.66
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-11 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