json-stream-path 0.0.2 → 0.0.3

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.
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Json::Stream::Path::VERSION
9
9
  spec.authors = ["Manojs"]
10
10
  spec.email = ["manojs.nitt@gmail.com"]
11
- spec.description = %q{A streaming JSON parser (generates SAX-like events) and JSON Path like implementation to parse small amount of data in a large JSON file.}
11
+ spec.description = %q{A streaming JSON parser (generates SAX-like events) and "JSON Path" like implementation to parse small amount of data in a large JSON file.}
12
12
  spec.summary = %q{A parser best suited for huge JSON documents that don't fit in memory and to parse small amount of data in a large JSON file.}
13
13
  spec.homepage = "https://github.com/bethink/json-stream-path"
14
14
  spec.license = "MIT"
@@ -5,4 +5,3 @@ require 'json/stream/buffer'
5
5
  require 'json/stream/builder'
6
6
  require 'json/stream/parser'
7
7
  require 'json/stream/j_path_tree'
8
- require 'json/stream/version'
@@ -202,7 +202,7 @@ module JSON
202
202
  #notify_end_object
203
203
  #notify_end_document
204
204
  #end_container(:object)
205
- puts "========== #{@stack.inspect} ========="
205
+ #puts "========== #{@stack.inspect} ========="
206
206
  #print ch
207
207
  #break
208
208
  end
@@ -1,7 +1,7 @@
1
1
  module Json
2
2
  module Stream
3
3
  module Path
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -34,54 +34,54 @@ class StreamJPathTest < Test::Unit::TestCase
34
34
  }
35
35
  end
36
36
 
37
- #def test_parsing_without_jpath
38
- # stream = File.open('test/stream_example.json')
39
- # @parser = JSON::Stream::Parser.new
40
- # result = @parser.parse(stream)
41
- # assert_equal(@hash, result)
42
- #end
43
- #
44
- #def test_parsing_with_empty_jpath
45
- # stream = File.open('test/stream_example.json')
46
- # @parser = JSON::Stream::Parser.new
47
- # result = @parser.parse(stream)
48
- # assert_equal(@hash, result)
49
- #end
50
- #
51
- #def test_parsing_with_empty_jpath
52
- # stream = File.open('test/stream_example.json')
53
- # @parser = JSON::Stream::Parser.new
54
- # result = @parser.parse(stream, '')
55
- # assert_equal(@hash, result)
56
- #end
57
- #
58
- #def test_parsing_whole
59
- # stream = File.open('test/stream_example.json')
60
- # @parser = JSON::Stream::Parser.new
61
- # result = @parser.parse(stream, '/')
62
- # assert_equal(@hash, result)
63
- #end
64
- #
65
- #def test_parsing_root
66
- # stream = File.open('test/stream_example.json')
67
- # @parser = JSON::Stream::Parser.new
68
- # result = @parser.parse(stream, '/root')
69
- # assert_equal(@hash['root'], result)
70
- #end
71
- #
72
- #def test_parsing_root_one
73
- # stream = File.open('test/stream_example.json')
74
- # @parser = JSON::Stream::Parser.new
75
- # result = @parser.parse(stream, '/root/one')
76
- # assert_equal(@hash['root']['one'], result)
77
- #end
78
- #
79
- #def test_parsing_root_two
80
- # stream = File.open('test/stream_example.json')
81
- # @parser = JSON::Stream::Parser.new
82
- # result = @parser.parse(stream, '/root/two')
83
- # assert_equal(@hash['root']['two'], result)
84
- #end
37
+ def test_parsing_without_jpath
38
+ stream = File.open('test/stream_example.json')
39
+ @parser = JSON::Stream::Parser.new
40
+ result = @parser.parse(stream)
41
+ assert_equal(@hash, result)
42
+ end
43
+
44
+ def test_parsing_with_empty_jpath
45
+ stream = File.open('test/stream_example.json')
46
+ @parser = JSON::Stream::Parser.new
47
+ result = @parser.parse(stream)
48
+ assert_equal(@hash, result)
49
+ end
50
+
51
+ def test_parsing_with_empty_jpath
52
+ stream = File.open('test/stream_example.json')
53
+ @parser = JSON::Stream::Parser.new
54
+ result = @parser.parse(stream, '')
55
+ assert_equal(@hash, result)
56
+ end
57
+
58
+ def test_parsing_whole
59
+ stream = File.open('test/stream_example.json')
60
+ @parser = JSON::Stream::Parser.new
61
+ result = @parser.parse(stream, '/')
62
+ assert_equal(@hash, result)
63
+ end
64
+
65
+ def test_parsing_root
66
+ stream = File.open('test/stream_example.json')
67
+ @parser = JSON::Stream::Parser.new
68
+ result = @parser.parse(stream, '/root')
69
+ assert_equal(@hash['root'], result)
70
+ end
71
+
72
+ def test_parsing_root_one
73
+ stream = File.open('test/stream_example.json')
74
+ @parser = JSON::Stream::Parser.new
75
+ result = @parser.parse(stream, '/root/one')
76
+ assert_equal(@hash['root']['one'], result)
77
+ end
78
+
79
+ def test_parsing_root_two
80
+ stream = File.open('test/stream_example.json')
81
+ @parser = JSON::Stream::Parser.new
82
+ result = @parser.parse(stream, '/root/two')
83
+ assert_equal(@hash['root']['two'], result)
84
+ end
85
85
 
86
86
  def test_parsing_root_three
87
87
  stream = File.open('test/stream_example.json')
@@ -90,25 +90,25 @@ class StreamJPathTest < Test::Unit::TestCase
90
90
  assert_equal(@hash['root']['three'], result)
91
91
  end
92
92
 
93
- #def test_parsing_root_three1
94
- # stream = File.open('test/stream_example.json')
95
- # @parser = JSON::Stream::Parser.new
96
- # result = @parser.parse(stream, '/root/three/three1')
97
- # assert_equal(@hash['root']['three']['three1'], result)
98
- #end
99
- #
100
- #def test_parsing_root_three2
101
- # stream = File.open('test/stream_example.json')
102
- # @parser = JSON::Stream::Parser.new
103
- # hash = @parser.parse(stream, '/root/three/three2')
104
- # assert_equal(@hash['root']['three']['three2'], hash)
105
- #end
106
- #
107
- #def test_parsing_root_
108
- # stream = File.open('test/stream_example.json')
109
- # @parser = JSON::Stream::Parser.new
110
- # hash = @parser.parse(stream, '/sibling')
111
- # assert_equal(@hash['sibling'], hash)
112
- #end
93
+ def test_parsing_root_three1
94
+ stream = File.open('test/stream_example.json')
95
+ @parser = JSON::Stream::Parser.new
96
+ result = @parser.parse(stream, '/root/three/three1')
97
+ assert_equal(@hash['root']['three']['three1'], result)
98
+ end
99
+
100
+ def test_parsing_root_three2
101
+ stream = File.open('test/stream_example.json')
102
+ @parser = JSON::Stream::Parser.new
103
+ hash = @parser.parse(stream, '/root/three/three2')
104
+ assert_equal(@hash['root']['three']['three2'], hash)
105
+ end
106
+
107
+ def test_parsing_root_
108
+ stream = File.open('test/stream_example.json')
109
+ @parser = JSON::Stream::Parser.new
110
+ hash = @parser.parse(stream, '/sibling')
111
+ assert_equal(@hash['sibling'], hash)
112
+ end
113
113
 
114
114
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-stream-path
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -59,7 +59,7 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- description: A streaming JSON parser (generates SAX-like events) and JSON Path like
62
+ description: A streaming JSON parser (generates SAX-like events) and "JSON Path" like
63
63
  implementation to parse small amount of data in a large JSON file.
64
64
  email:
65
65
  - manojs.nitt@gmail.com
@@ -68,15 +68,6 @@ extensions: []
68
68
  extra_rdoc_files: []
69
69
  files:
70
70
  - .gitignore
71
- - .idea/.name
72
- - .idea/.rakeTasks
73
- - .idea/encodings.xml
74
- - .idea/json-stream-path.iml
75
- - .idea/misc.xml
76
- - .idea/modules.xml
77
- - .idea/scopes/scope_settings.xml
78
- - .idea/vcs.xml
79
- - .idea/workspace.xml
80
71
  - Gemfile
81
72
  - LICENSE
82
73
  - README.md