jiffy 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +27 -28
  5. data/Rakefile +17 -0
  6. data/bin/jiffy +28 -3
  7. data/jiffy.gemspec +15 -66
  8. data/lib/jiffy.rb +27 -27
  9. data/lib/jiffy/array_mimicking_io.rb +1 -1
  10. data/lib/jiffy/outputter.rb +85 -0
  11. data/lib/jiffy/outputters/json.rb +35 -0
  12. data/lib/jiffy/outputters/ruby.rb +35 -0
  13. data/lib/jiffy/parser.rb +17 -0
  14. data/lib/jiffy/parsers/json.rb +18 -42
  15. data/lib/jiffy/parsers/json.rl +10 -22
  16. data/lib/jiffy/parsers/json_array.rb +22 -29
  17. data/lib/jiffy/parsers/json_array.rl +11 -12
  18. data/lib/jiffy/parsers/json_float.rb +39 -21
  19. data/lib/jiffy/parsers/json_float.rl +15 -7
  20. data/lib/jiffy/parsers/json_object.rb +30 -49
  21. data/lib/jiffy/parsers/json_object.rl +13 -20
  22. data/lib/jiffy/parsers/json_string.rb +70 -27
  23. data/lib/jiffy/parsers/json_string.rl +21 -6
  24. data/lib/jiffy/parsers/json_value.rb +33 -52
  25. data/lib/jiffy/parsers/json_value.rl +15 -34
  26. data/lib/jiffy/version.rb +1 -1
  27. data/test/jiffy_test.rb +261 -34
  28. data/test/outputter_test.rb +155 -0
  29. data/test/outputters/json_test.rb +22 -0
  30. metadata +9 -60
  31. data/lib/jiffy/json_outputter.rb +0 -62
  32. data/test/negative-examples/hexadecimal.json +0 -3
  33. data/test/negative-examples/infinity-value.json +0 -3
  34. data/test/negative-examples/leading-comma.json +0 -3
  35. data/test/negative-examples/leading-zero.json +0 -3
  36. data/test/negative-examples/line-break.json +0 -4
  37. data/test/negative-examples/missing-colon.json +0 -3
  38. data/test/negative-examples/nan-value,json +0 -3
  39. data/test/negative-examples/positive-float.json +0 -3
  40. data/test/negative-examples/positive-integer.json +0 -3
  41. data/test/negative-examples/single-quote.json +0 -3
  42. data/test/negative-examples/string-as-root.json +0 -1
  43. data/test/negative-examples/tab-character.json +0 -3
  44. data/test/negative-examples/trailing-array-seperator.json +0 -3
  45. data/test/negative-examples/trailing-object-seperator.json +0 -3
  46. data/test/negative-examples/true-as-root.json +0 -1
  47. data/test/negative-examples/unclosed-array.json +0 -2
  48. data/test/negative-examples/unclosed-object.json +0 -2
  49. data/test/positive-examples/array-as-root.json +0 -3
  50. data/test/positive-examples/array-nested-inside-array.json +0 -5
  51. data/test/positive-examples/array-nested-inside-object.json +0 -5
  52. data/test/positive-examples/false-value.json +0 -3
  53. data/test/positive-examples/null-value.json +0 -3
  54. data/test/positive-examples/number-1.json +0 -3
  55. data/test/positive-examples/number-10.json +0 -3
  56. data/test/positive-examples/number-11.json +0 -3
  57. data/test/positive-examples/number-12.json +0 -3
  58. data/test/positive-examples/number-13.json +0 -3
  59. data/test/positive-examples/number-14.json +0 -3
  60. data/test/positive-examples/number-15.json +0 -3
  61. data/test/positive-examples/number-16.json +0 -3
  62. data/test/positive-examples/number-17.json +0 -3
  63. data/test/positive-examples/number-18.json +0 -3
  64. data/test/positive-examples/number-19.json +0 -3
  65. data/test/positive-examples/number-2.json +0 -3
  66. data/test/positive-examples/number-20.json +0 -3
  67. data/test/positive-examples/number-3.json +0 -3
  68. data/test/positive-examples/number-4.json +0 -3
  69. data/test/positive-examples/number-5.json +0 -3
  70. data/test/positive-examples/number-6.json +0 -3
  71. data/test/positive-examples/number-7.json +0 -3
  72. data/test/positive-examples/number-8.json +0 -3
  73. data/test/positive-examples/number-9.json +0 -3
  74. data/test/positive-examples/object-as-root.json +0 -3
  75. data/test/positive-examples/object-nested-inside-array.json +0 -5
  76. data/test/positive-examples/object-nested-inside-object.json +0 -5
  77. data/test/positive-examples/seperated-array-values.json +0 -4
  78. data/test/positive-examples/seperated-object-properties.json +0 -4
  79. data/test/positive-examples/string-backspace.json +0 -3
  80. data/test/positive-examples/string-carriage-return.json +0 -3
  81. data/test/positive-examples/string-formfeed.json +0 -3
  82. data/test/positive-examples/string-horizontal-tab.json +0 -3
  83. data/test/positive-examples/string-newline.json +0 -3
  84. data/test/positive-examples/string-quotation.json +0 -3
  85. data/test/positive-examples/string-reverse-solidus.json +0 -3
  86. data/test/positive-examples/string-solidus.json +0 -3
  87. data/test/positive-examples/string-trivial.json +0 -3
  88. data/test/positive-examples/string-unicode.json +0 -3
  89. data/test/positive-examples/true-value.json +0 -3
@@ -1,3 +0,0 @@
1
- [
2
- null
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 100
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 1.123E-10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -100
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -100e10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -100E10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -100e-10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -100E-10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -1.123
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -1.123e10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -1.123E10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -1.123e-10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 100e10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- -1.123E-10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 100E10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 100e-10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 100E-10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 1.123
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 1.123e10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 1.123E10
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- 1.123e-10
3
- ]
@@ -1,3 +0,0 @@
1
- {
2
-
3
- }
@@ -1,5 +0,0 @@
1
- {
2
- "": {
3
-
4
- }
5
- }
@@ -1,4 +0,0 @@
1
- [
2
- "",
3
- ""
4
- ]
@@ -1,4 +0,0 @@
1
- {
2
- "": "",
3
- "": ""
4
- }
@@ -1,3 +0,0 @@
1
- [
2
- "\b"
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- "\r"
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- "\f"
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- "\t"
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- "\n"
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- "\""
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- "\\"
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- "\/"
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- "foo"
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- "\u1111"
3
- ]
@@ -1,3 +0,0 @@
1
- [
2
- true
3
- ]