Skip to content

Commit

Permalink
prepping for 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Newton committed Dec 8, 2017
1 parent 4428a01 commit 8dae67b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ which can be found [here](https://raw.githubusercontent.com/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://raw.githubusercontent.com/arineng/jcr/07/draft-newton-json-content-rules.txt)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/jcr/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

module JCR

VERSION = "0.7.0"
VERSION = "0.8.0"

end

0 comments on commit 8dae67b

Please sign in to comment.