kdl 1.0.0.rc1 → 1.0.2

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: 1da5c7ecdbb21b75f621fbb6876fd46270c525311d9b34443ebbda8e715f6b0d
4
- data.tar.gz: c8317287f0573c91b256d28ff902e3a38bd3275b009016ce0d41c631e7321303
3
+ metadata.gz: c7fd58e017395f4ce4c67e04d8c4324c27bfe816926a41ebf0a813231cbe3eaf
4
+ data.tar.gz: 5ad57dac159e4fabe083f209cf0d0bb07735ed533859da539b0c0796b2d3dc70
5
5
  SHA512:
6
- metadata.gz: 549b4b676a95b83146647aca4dbbccf44463fbaa5cc0192dc7e0e1e8977e194bdc505c29edde3c71f5f225a22eb23ea2ba484d4a26c24cdbae152015dde99b77
7
- data.tar.gz: 13520a974cb5e28658bebd7b09fa79bb13e40cf2c12f50e0a51408fef74ab756e314f7e6758a357b0ef82afdda3cfa7604197184dad45607296ffb7469507df3
6
+ metadata.gz: 5c84ac4702188843e47041424d50e35ed19dcacbc8c9ce334a4036e6a8f2201f6d3dc420c9fbd6a5262fd42e1e387090c4ffe1575b4a7d92081a5776844e5492
7
+ data.tar.gz: 4b02a0867a5ae9cc0e698df0308d91f9fa8b41a96e14ad5efd8b51e95659e3e20196a2d1c197e9dc6e0f96710f632e0d9295342e18e069b6313eac49a5841c72
@@ -17,7 +17,7 @@ jobs:
17
17
  test:
18
18
  strategy:
19
19
  matrix:
20
- ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0, head]
20
+ ruby: [2.4, 2.5, 2.6, 2.7, 3.0, head]
21
21
 
22
22
  runs-on: ubuntu-latest
23
23
 
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  Gemfile.lock
11
11
 
12
12
  lib/kdl/kdl.tab.rb
13
+ kdl.output
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # KDL
2
2
 
3
- [![Actions Status](https://github.com/jellymann/kdl-rb/workflows/Ruby/badge.svg)](https://github.com/jellymann/kdl-rb/actions)
3
+ [![Actions Status](https://github.com/danini-the-panini/kdl-rb/workflows/Ruby/badge.svg)](https://github.com/danini-the-panini/kdl-rb/actions)
4
4
 
5
5
  This is a Ruby implementation of the [KDL Document Language](https://kdl.dev)
6
6
 
@@ -28,6 +28,20 @@ require 'kdl'
28
28
  KDL.parse_document(a_string) #=> KDL::Document
29
29
  ```
30
30
 
31
+ You can optionally provide your own type annotation handlers:
32
+
33
+ ```ruby
34
+ KDL.parse_document(a_string, type_parsers: {
35
+ 'foo' => -> (value, type) {
36
+ Foo.new(value.value, type: type)
37
+ }
38
+ })
39
+ ```
40
+
41
+ The `foo` proc will be called with instances of Value or Node with the type annotation `(foo)`.
42
+
43
+ Parsers are expected to have a `call` method that takes the Value or Node, and the type annotation itself, as arguments, and is expected to return either an instance of Value or Node (depending on the input type) or `nil` to return the original value as is. Take a look at [the built in parsers](lib/kdl/types) as a reference.
44
+
31
45
  ## Development
32
46
 
33
47
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -36,7 +50,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
36
50
 
37
51
  ## Contributing
38
52
 
39
- Bug reports and pull requests are welcome on GitHub at https://github.com/jellymann/kdl-rb.
53
+ Bug reports and pull requests are welcome on GitHub at https://github.com/danini-the-panini/kdl-rb.
40
54
 
41
55
 
42
56
  ## License
data/bin/kdl ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "kdl"
5
+
6
+ system 'bin/rake racc'
7
+
8
+ puts KDL.parse_document(ARGF.read).to_s
data/kdl.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.description = %q{Ruby implementation of the KDL Document Language Spec}
11
11
  spec.homepage = "https://kdl.dev"
12
12
  spec.license = "MIT"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
14
14
 
15
15
  spec.metadata["homepage_uri"] = spec.homepage
16
16
  spec.metadata["source_code_uri"] = "https://github.com/danini-the-panini/kdl-rb"
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
 
27
27
  spec.add_development_dependency 'racc', '~> 1.5'
28
+ spec.add_dependency 'simpleidn', '~> 0.2.1'
28
29
  end