Skip to content

Commit 8dae67b

Browse files
author
Andy Newton
committed
prepping for 0.8.0
1 parent 4428a01 commit 8dae67b

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ os:
55
rvm:
66
- 2.1.3
77
- 2.3.4
8-
- 2.4
9-
- jruby-9.1
8+
- 2.4.1
9+
- jruby-9.1.9.0
1010
matrix:
1111
exclude:
1212
- rvm: 2.1.3

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ which can be found [here](https://raw.githubusercontent.com/arineng/jcr/09/draft
121121
* Fixes to ABNF in multi-line directives
122122
* Much better CLI and programmatic validation failure information and structures
123123
* Fixes to print errors when the JCR fails to parse
124+
* 0.8.0 - Adds the --process-parts command line option
124125

125126
The current version of the JCR specification can be found
126127
[here](https://raw.githubusercontent.com/arineng/jcr/07/draft-newton-json-content-rules.txt)
@@ -179,6 +180,7 @@ Options
179180
-r FILE file containing ruleset
180181
-R STRING string containing ruleset. Should probably be quoted
181182
--test-jcr parse and test the JCR only
183+
--process-parts creates smaller files for specification writing
182184
-S STRING name of root rule. All roots will be tried if none is specified
183185
-o FILE file containing overide ruleset (option can be repeated)
184186
-O STRING string containing overide rule (option can be repeated)
@@ -193,7 +195,7 @@ Return codes:
193195
2 = fall through bad condition
194196
3 = unsuccessful evaluation of JSON
195197
196-
JCR Version 0.7.0
198+
JCR Version 0.8.0
197199
```
198200

199201
## Usage as a Library
@@ -216,6 +218,30 @@ The `callback.rb` demonstrates the usage of custom code for evaluation of rules.
216218
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.
217219
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.
218220

221+
## Using the `--process-parts` Option
222+
223+
The `--process-parts` option extracts parts of a JCR file into multiple files based
224+
on comments in the file. It can also create a new file without the
225+
comments. This is useful for JCR going into specification documents
226+
where it is nice to break the JCR up for illustrative purposes in
227+
the specification but to also have one JCR file for programmatic
228+
testing purposes.
229+
230+
The file parts are extracted using the comments
231+
232+
; start_part FILENAME
233+
234+
and
235+
236+
; end_part
237+
238+
The comments must also be the only thing present on the line
239+
though leading whitespace is allowed if desired.
240+
241+
To get a new file with all parts but these comments, use this
242+
243+
; all_parts FILENAME
244+
219245
## Building
220246

221247
Use bundler to install all the dependencies.

lib/jcr/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
module JCR
1717

18-
VERSION = "0.7.0"
18+
VERSION = "0.8.0"
1919

2020
end

0 commit comments

Comments
 (0)