jiffy 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -5
- data/jiffy.gemspec +1 -2
- data/lib/jiffy/outputters/json.rb +3 -3
- data/lib/jiffy/outputters/ruby.rb +3 -3
- data/lib/jiffy/version.rb +1 -1
- metadata +2 -3
- data/test/outputters/json_test.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b3967d1ee2faeeb2218c26af9eee22723e1cd52
|
4
|
+
data.tar.gz: 86164d67e67b0f76dd31d8ebf429f34f7bc6e263
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb5e5facfcee95c5b02867f226c5c4278d9ce76013ea1200cf834aba377422cb4fb882f6c53c5baf9be7fdf00613d6b1d051d8976665f6ede6652effb4168e1d
|
7
|
+
data.tar.gz: 05434ceb6574e217ac4c63497e16a8a7783183f47e199634b51f3d92a5f19112e465e739686685ed1ab6b6efa7b26634eca96b8f4b34fac9543848a6230b011d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -56,13 +56,13 @@ Jiffy.new(in: 'some.json')
|
|
56
56
|
```ruby
|
57
57
|
require 'stringio'
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
outputter = Jiffy::Outputters::Json.new(out:
|
59
|
+
i = StringIO.new('[false, true, null]')
|
60
|
+
o = StringIO.new
|
61
|
+
outputter = Jiffy::Outputters::Json.new(out: o)
|
62
62
|
|
63
|
-
Jiffy.new(in:
|
63
|
+
Jiffy.new(in: i).format(outputter: outputter)
|
64
64
|
|
65
|
-
|
65
|
+
o.string # => "[\n false,\n true,\n null\n]"
|
66
66
|
```
|
67
67
|
|
68
68
|
### Command line usage
|
@@ -95,6 +95,10 @@ Tested against the following Ruby versions.
|
|
95
95
|
|
96
96
|
## Changelog
|
97
97
|
|
98
|
+
### 1.1.1
|
99
|
+
|
100
|
+
* Fixed a bug in outputting of escape sequences.
|
101
|
+
|
98
102
|
### 1.1.0
|
99
103
|
|
100
104
|
* Fixing an issue where the first digit in numbers was tokenized to :char.
|
data/jiffy.gemspec
CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.name = 'jiffy'
|
5
5
|
s.version = Jiffy::VERSION
|
6
6
|
s.license = 'MIT'
|
7
|
-
s.date = '
|
7
|
+
s.date = '2015-06-04'
|
8
8
|
|
9
9
|
s.summary = 'A streaming-based JSON formatter in Ruby.'
|
10
10
|
s.description = 'Jiffy utilizes Ragel in order to parse and continuously format JSON data. This allows it to achieve a constant memory usage, independent of the input size.'
|
@@ -46,7 +46,6 @@ Gem::Specification.new do |s|
|
|
46
46
|
lib/jiffy/version.rb
|
47
47
|
test/jiffy_test.rb
|
48
48
|
test/outputter_test.rb
|
49
|
-
test/outputters/json_test.rb
|
50
49
|
]
|
51
50
|
|
52
51
|
s.add_development_dependency('minitest')
|
@@ -19,9 +19,9 @@ class Jiffy
|
|
19
19
|
rule :exponent, :payload => "e", :color => :cyan
|
20
20
|
rule :minus, :payload => "-", :color => :cyan
|
21
21
|
rule :plus, :payload => "+", :color => :cyan
|
22
|
-
rule :escaped_quotation_mark, :payload => "
|
23
|
-
rule :escaped_reverse_solidus, :payload => "
|
24
|
-
rule :escaped_solidus, :payload => "
|
22
|
+
rule :escaped_quotation_mark, :payload => "\\\""
|
23
|
+
rule :escaped_reverse_solidus, :payload => "\\\\"
|
24
|
+
rule :escaped_solidus, :payload => "\\/"
|
25
25
|
rule :escaped_backspace, :payload => "\\b"
|
26
26
|
rule :escaped_formfeed, :payload => "\\f"
|
27
27
|
rule :escaped_newline, :payload => "\\n"
|
@@ -19,9 +19,9 @@ class Jiffy
|
|
19
19
|
rule :exponent, :payload => "e", :color => :purple
|
20
20
|
rule :minus, :payload => "-", :color => :purple
|
21
21
|
rule :plus, :payload => "+", :color => :purple
|
22
|
-
rule :escaped_quotation_mark, :payload => "
|
23
|
-
rule :escaped_reverse_solidus, :payload => "
|
24
|
-
rule :escaped_solidus, :payload => "
|
22
|
+
rule :escaped_quotation_mark, :payload => "\\\""
|
23
|
+
rule :escaped_reverse_solidus, :payload => "\\\\"
|
24
|
+
rule :escaped_solidus, :payload => "\\/"
|
25
25
|
rule :escaped_backspace, :payload => "\\b"
|
26
26
|
rule :escaped_formfeed, :payload => "\\f"
|
27
27
|
rule :escaped_newline, :payload => "\\n"
|
data/lib/jiffy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jiffy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Amundsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -77,7 +77,6 @@ files:
|
|
77
77
|
- lib/jiffy/version.rb
|
78
78
|
- test/jiffy_test.rb
|
79
79
|
- test/outputter_test.rb
|
80
|
-
- test/outputters/json_test.rb
|
81
80
|
homepage: https://github.com/badeball/jiffy
|
82
81
|
licenses:
|
83
82
|
- MIT
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'minitest/autorun'
|
2
|
-
require 'jiffy/outputters/json'
|
3
|
-
|
4
|
-
describe Jiffy::JsonOutputter do
|
5
|
-
describe '#initialize' do
|
6
|
-
it 'should raise an error when :out does not respond to #print' do
|
7
|
-
out = Object.new
|
8
|
-
|
9
|
-
def out.respond_to?(method)
|
10
|
-
if method == :print
|
11
|
-
false
|
12
|
-
else
|
13
|
-
super
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
assert_raises ArgumentError do
|
18
|
-
Jiffy::JsonOutputter.new out: out
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|