yamlscript 0.1.63 → 0.1.66

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: 3da6f600df76247fb3fcd7602f1fcc163da3e96fc87a1ec64c8c95745134dcb9
4
- data.tar.gz: ba628d1011eac23136d83af8b8d1dcd8a3fe456f14302d349ce1d36591a47722
3
+ metadata.gz: 4898a2bea185c4fa8ae98c0fdcf7feeeea91c364d8f05f53223a91d0e2220154
4
+ data.tar.gz: e01d3805540211046aa6e7a03a41fdb152e404e33786b8c156a1f863507819ea
5
5
  SHA512:
6
- metadata.gz: 92f9822e4327d475e6553fdf23a75f41cb1b2bcba4fcdc8e4c5d0036780d8b95ab26ad71071f34318cd47eda019aa9474665d60c8ed1dc48f6eba788149fa263
7
- data.tar.gz: 894cce3e9a6be5793ddbf738ab204c58cc1a5630f8f2c4c60986c41cab02a2b86d292b23da113edd53cc4539aac0fbc87a182fe72b706d2e672a3da6c961ac57
6
+ metadata.gz: 0b0019ed6ceb0d12b9f2944146ed68bec7f4f2cabaff8fc7c51ad0bc764e4254ece1b10d2def1f6880a4852ba4f83e946cee0d63ad4320cbeb0807f1d181d247
7
+ data.tar.gz: 0e100b1565aa7d0697656c00ee4f56d7a5c97f1a71bf3ef3fca598f833574cfcdc04ceb84326481f0466c210d4faa1f96e02c2f43f8d0c030acf267b8e08fbd2
data/ChangeLog.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [0.1.66] - 2024-07-11
2
+
3
+ - libyamlscript 0.1.66
4
+
5
+ ## [0.1.65] - 2024-07-06
6
+
7
+ - libyamlscript 0.1.65
8
+
9
+ ## [0.1.64] - 2024-07-04
10
+
11
+ - libyamlscript 0.1.64
12
+
1
13
  ## [0.1.63] - 2024-06-19
2
14
 
3
15
  - libyamlscript 0.1.63
data/Makefile CHANGED
@@ -9,8 +9,13 @@ RAKE_CMDS := \
9
9
  release \
10
10
  test \
11
11
 
12
+
12
13
  #------------------------------------------------------------------------------
13
14
 
15
+ build:: build-doc
16
+
17
+ build-doc:: ReadMe.md
18
+
14
19
  ifdef RUBY
15
20
  update:
16
21
  bundle install
data/ReadMe.md CHANGED
@@ -1,37 +1,54 @@
1
+ <!-- DO NOT EDIT — THIS FILE WAS GENERATED -->
2
+
1
3
  YAMLScript
2
4
  ==========
3
5
 
4
- Program in YAML
6
+ Add Logic to Your YAML Files
5
7
 
6
8
 
7
9
  ## Synopsis
8
10
 
11
+ Load `file.yaml` with YAMLScript:
9
12
  ```yaml
10
- #!/usr/bin/env ys-0
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
+ ```
11
26
 
12
- defn main(name='world'):
13
- say: "Hello, $name!"
27
+ and get:
28
+ ```json
29
+ {
30
+ "name": "Anthea",
31
+ "aka": "Patrizia",
32
+ "age": 42,
33
+ "color": "yellow"
34
+ }
14
35
  ```
15
36
 
16
37
 
17
38
  ## Description
18
39
 
19
- YAMLScript is a functional programming language with a stylized YAML syntax.
40
+ [YAMLScript](https://yamlscript.org) is a functional programming language with a
41
+ clean YAML syntax.
20
42
 
21
- YAMLScript can be used for:
43
+ YAMLScript can be used for enhancing ordinary [YAML](https://yaml.org) files
44
+ with functional operations, such as:
22
45
 
23
- * Writing new programs and applications
24
- * Run with `ys file.ys`
25
- * Or compile to binary executable with `ys -C file.ys`
26
- * Enhancing ordinary YAML files with new functional magics
27
- * Import parts of other YAML files to any node
28
- * String interpolation including function calls
29
- * Any other functionality you can dream up!
30
- * Writing reusable shared libraries
31
- * High level code instead of C
32
- * 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
33
49
 
34
- YAMLScript should be a drop-in replacement for your YAML loader!
50
+ This YAMLScript library should be a drop-in replacement for your current YAML
51
+ loader!
35
52
 
36
53
  Most existing YAML files are already valid YAMLScript files.
37
54
  This means that YAMLScript works as a normal YAML loader, but can also evaluate
@@ -47,10 +64,18 @@ YAMLScript is compiled to a native shared library (`libyamlscript.so`) that can
47
64
  be used by any programming language that can load shared libraries.
48
65
 
49
66
  To see the Clojure code that YAMLScript compiles to, you can use the YAMLScript
50
- command line utility, `ys`, to run:
67
+ CLI binary, `ys`, to run:
51
68
 
52
69
  ```text
53
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))}
54
79
  ```
55
80
 
56
81
 
@@ -118,15 +143,18 @@ See https://github.com/yaml/yamlscript?#installing-yamlscript for more info.
118
143
 
119
144
  ## See Also
120
145
 
121
- * [The YAMLScript Web Site](https://yamlscript.org)
122
- * [The YAMLScript Blog](https://yamlscript.org/blog)
123
- * [The YAMLScript Source Code](https://github.com/yaml/yamlscript)
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)
124
151
  * [YAML](https://yaml.org)
125
152
  * [Clojure](https://clojure.org)
126
153
 
127
154
 
128
155
  ## Authors
129
156
 
157
+
130
158
  * [Ingy döt Net](https://github.com/ingydotnet)
131
159
  * [Delon R.Newman](https://github.com/delonnewman)
132
160
 
data/doc/authors.md ADDED
@@ -0,0 +1,2 @@
1
+ * [Ingy döt Net](https://github.com/ingydotnet)
2
+ * [Delon R.Newman](https://github.com/delonnewman)
data/doc/readme.md ADDED
@@ -0,0 +1,60 @@
1
+ ## Ruby Usage
2
+
3
+ File `prog.rb`:
4
+
5
+ ```ruby
6
+ require 'yamlscript'
7
+ input = IO.read('file.ys')
8
+ ys = YAMLScript.new
9
+ data = ys.load(input)
10
+ puts data
11
+ ```
12
+
13
+ File `file.ys`:
14
+
15
+ ```yaml
16
+ !yamlscript/v0
17
+
18
+ name =: "World"
19
+
20
+ =>::
21
+ foo: [1, 2, ! inc(41)]
22
+ bar:: load("other.yaml")
23
+ baz:: "Hello, $name!"
24
+ ```
25
+
26
+ File `other.yaml`:
27
+
28
+ ```yaml
29
+ oh: Hello
30
+ ```
31
+
32
+ Run:
33
+
34
+ ```text
35
+ $ ruby prog.rb
36
+ {"foo"=>[1, 2, 42], "bar"=>{"oh"=>"Hello"}, "baz"=>"Hello, World!"}
37
+ ```
38
+
39
+
40
+ ## Installation
41
+
42
+ You can install this module like any other Ruby module:
43
+
44
+ ```bash
45
+ $ gem install yamlscript
46
+ ```
47
+
48
+ but you will need to have a system install of `libyamlscript.so`.
49
+
50
+ One simple way to do that is with:
51
+
52
+ ```bash
53
+ $ curl https://yamlscript.org/install | bash
54
+ ```
55
+
56
+ > Note: The above command will install the latest version of the YAMLScript
57
+ command line utility, `ys`, and the shared library, `libyamlscript.so`, into
58
+ `~/local/bin` and `~/.local/lib` respectively.
59
+
60
+ See https://github.com/yaml/yamlscript?#installing-yamlscript for more info.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class YAMLScript
4
- VERSION = "0.1.63"
4
+ VERSION = "0.1.66"
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.63'
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.63
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-06-19 00:00:00.000000000 Z
12
+ date: 2024-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -39,6 +39,8 @@ files:
39
39
  - Makefile
40
40
  - Rakefile
41
41
  - ReadMe.md
42
+ - doc/authors.md
43
+ - doc/readme.md
42
44
  - lib/yamlscript.rb
43
45
  - lib/yamlscript/version.rb
44
46
  - yamlscript.gemspec