ffi-yajl 0.1.5-universal-java → 0.1.6-universal-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/Rakefile +3 -1
- data/ext/ffi_yajl/ext/parser/parser.c +2 -0
- data/lib/ffi_yajl/ext.rb +15 -4
- data/lib/ffi_yajl/version.rb +1 -1
- data/spec/ffi_yajl/json_gem_spec.rb +4 -4
- metadata +22 -22
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NGMwNTUzOGE5NTEyYWZiMTY1NjhjNTU3NTI2MmQzYTU0M2ViMzQ4Mw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a087288e893750057d1e1e492e693dc4fd1d8e9d
|
4
|
+
data.tar.gz: b477f818062421da4df0a059b355d48522c1e94b
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
MmFiNzQyZTQ1MzU1YTQ4ZjY4MmRhYTc3MjZhYWMzNjM2OGNiOTNhZjNlYTdl
|
11
|
-
NjkzM2U3NzNmYmE4MmI0OGI2MTJiZDA5MzE5ZmI3ZjZhY2Q5MWM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OTUwYzlmZDQ2NDMwNWUzOWYwOTNkYzMwNmM0M2IwYjRmMTk3NjAxZTk2NjUx
|
14
|
-
OWY4OTIxODU5ZjI0MWFkNzk1ODI2NWQxNzViMDNiZDE4ZGFmNjNiZTI1MGRl
|
15
|
-
MDY1NTFlZWUxODVkNGNkMjVmY2U4ZDU0NTI0NDY3ZmM3YTg5NTE=
|
6
|
+
metadata.gz: b614c4a9214e03d8744c446fcbec59b57e7e3a08f88724918d0e9bd35eba1542ae76444d93d6189f67ad9ff718a3ad2c35746d70cb41ae3bfa00ecd5a000031c
|
7
|
+
data.tar.gz: 250b143ad9111b33b792fae5ac909c3d0c771026615af1024a61f3476ad155150160027983cfc02e133fba2c31bcfa29fe90918a59e7c964e6b3e754b50e4197
|
data/Rakefile
CHANGED
@@ -57,7 +57,9 @@ end
|
|
57
57
|
desc "Run all specs against both extensions"
|
58
58
|
task :spec do
|
59
59
|
Rake::Task["spec:ffi"].invoke
|
60
|
-
|
60
|
+
if !defined?(RUBY_ENGINE) || RUBY_ENGINE !~ /jruby/
|
61
|
+
Rake::Task["spec:ext"].invoke
|
62
|
+
end
|
61
63
|
end
|
62
64
|
|
63
65
|
namespace :spec do
|
@@ -170,6 +170,8 @@ static VALUE mParser_do_yajl_parse(VALUE self, VALUE str, VALUE opts) {
|
|
170
170
|
/* hack to avoid garbage collection */
|
171
171
|
rb_ivar_set(self, rb_intern("stack"), ctx.stack);
|
172
172
|
rb_ivar_set(self, rb_intern("key_stack"), ctx.key_stack);
|
173
|
+
rb_ivar_set(self, rb_intern("finished"), ctx.stack);
|
174
|
+
rb_ivar_set(self, rb_intern("key"), ctx.stack);
|
173
175
|
|
174
176
|
hand = yajl_alloc(&callbacks, NULL, &ctx);
|
175
177
|
if ((stat = yajl_parse(hand, (unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str))) != yajl_status_ok) {
|
data/lib/ffi_yajl/ext.rb
CHANGED
@@ -2,10 +2,13 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
require 'ffi_yajl/encoder'
|
4
4
|
require 'ffi_yajl/parser'
|
5
|
-
require 'dl'
|
6
5
|
require 'ffi'
|
7
6
|
require 'libyajl2'
|
8
|
-
|
7
|
+
begin
|
8
|
+
require 'fiddle'
|
9
|
+
rescue LoadError
|
10
|
+
require 'dl'
|
11
|
+
end
|
9
12
|
|
10
13
|
module FFI_Yajl
|
11
14
|
class Parser
|
@@ -13,7 +16,11 @@ module FFI_Yajl
|
|
13
16
|
libname = ::FFI.map_library_name("yajl")
|
14
17
|
libpath = File.expand_path(File.join(Libyajl2.opt_path, libname))
|
15
18
|
libpath.gsub!(/dylib/, 'bundle')
|
16
|
-
|
19
|
+
if defined?(Fiddle)
|
20
|
+
::Fiddle.dlopen(libpath)
|
21
|
+
else
|
22
|
+
::DL.dlopen(libpath)
|
23
|
+
end
|
17
24
|
require 'ffi_yajl/ext/parser'
|
18
25
|
include FFI_Yajl::Ext::Parser
|
19
26
|
end
|
@@ -23,7 +30,11 @@ module FFI_Yajl
|
|
23
30
|
libname = ::FFI.map_library_name("yajl")
|
24
31
|
libpath = File.expand_path(File.join(Libyajl2.opt_path, libname))
|
25
32
|
libpath.gsub!(/dylib/, 'bundle')
|
26
|
-
|
33
|
+
if defined?(Fiddle)
|
34
|
+
::Fiddle.dlopen(libpath)
|
35
|
+
else
|
36
|
+
::DL.dlopen(libpath)
|
37
|
+
end
|
27
38
|
require 'ffi_yajl/ext/encoder'
|
28
39
|
include FFI_Yajl::Ext::Encoder
|
29
40
|
end
|
data/lib/ffi_yajl/version.rb
CHANGED
@@ -94,7 +94,7 @@ describe "JSON Gem Compat API" do
|
|
94
94
|
end
|
95
95
|
|
96
96
|
it "changing the default_options should change the behavior to true" do
|
97
|
-
|
97
|
+
skip("implement symbolize keys")
|
98
98
|
JSON.default_options[:symbolize_keys] = true
|
99
99
|
expect(JSON.parse('{"foo": 1234}')).to eq( :foo => 1234 )
|
100
100
|
end
|
@@ -109,19 +109,19 @@ describe "JSON Gem Compat API" do
|
|
109
109
|
end
|
110
110
|
|
111
111
|
it "changing the default_options should change the behavior to true" do
|
112
|
-
|
112
|
+
skip("implement symbolize keys")
|
113
113
|
JSON.default_options[:symbolize_names] = true
|
114
114
|
expect(JSON.parse('{"foo": 1234}')).to eq( :foo => 1234 )
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
118
|
it "should support passing symbolize_names to JSON.parse" do
|
119
|
-
|
119
|
+
skip("implement symbolize keys")
|
120
120
|
expect(JSON.parse('{"foo": 1234}', :symbolize_names => true)).to eq( :foo => 1234 )
|
121
121
|
end
|
122
122
|
|
123
123
|
it "should support passing symbolize_keys to JSON.parse" do
|
124
|
-
|
124
|
+
skip("implement symbolize keys")
|
125
125
|
expect(JSON.parse('{"foo": 1234}', :symbolize_keys => true)).to eq( :foo => 1234 )
|
126
126
|
end
|
127
127
|
|
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-yajl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: universal-java
|
6
6
|
authors:
|
7
7
|
- Lamont Granquist
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05
|
11
|
+
date: 2014-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '10.1'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '10.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.99'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2.
|
40
|
+
version: '2.99'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.9'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.9'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake-compiler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.8.3
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.8.3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mime-types
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.16'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.16'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: ffi
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1.
|
89
|
+
version: '1.5'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '1.
|
96
|
+
version: '1.5'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: libyajl2
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description: Ruby FFI wrapper around YAJL 2.x
|
@@ -169,12 +169,12 @@ require_paths:
|
|
169
169
|
- lib
|
170
170
|
required_ruby_version: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
|
-
- -
|
172
|
+
- - ">="
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
|
-
- -
|
177
|
+
- - ">="
|
178
178
|
- !ruby/object:Gem::Version
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|