ffi-yajl 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -0
- data/ext/ffi_yajl/ext/encoder/extconf.rb +2 -2
- data/ext/ffi_yajl/ext/parser/extconf.rb +2 -2
- data/lib/ffi_yajl/ext.rb +11 -4
- data/lib/ffi_yajl/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3ce1385d8ff7b48416b9ae7b57157be1b0211c4
|
4
|
+
data.tar.gz: 461f634749b19eafbbc770e869e79e85a4d7a73b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3268713c039518262d00724a1d50a828359463a279494ca50b797472bc754c0181ad867051743ca778e65d2b9ef609d4deed10f24308183263633910bcb7afe9
|
7
|
+
data.tar.gz: 7b7655a1cb1d46b4ab13202ad33f9b08dcae4b14eb9d6b52319e685daf753d9ebe9efb18144b34535b031016389993f9d7e4e02301ebaa33c2550719cb12cd47
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
|
9
9
|
|
10
10
|
# pick up the vendored libyajl2 out of the libyajl2 gem
|
11
11
|
$CFLAGS = "-I#{Libyajl2.include_path} -L#{Libyajl2.opt_path} #{$CFLAGS}"
|
12
|
-
$LDFLAGS = "-L#{Libyajl2.opt_path} #{$
|
12
|
+
$LDFLAGS = "-L#{Libyajl2.opt_path} #{$LDFLAGS}"
|
13
13
|
|
14
14
|
puts $CFLAGS
|
15
15
|
puts $LDFLAGS
|
@@ -22,7 +22,7 @@ if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc|clang/
|
|
22
22
|
$CFLAGS << " -Wall"
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
#$LDFLAGS << " -lyajl"
|
26
26
|
|
27
27
|
dir_config 'encoder'
|
28
28
|
|
@@ -9,7 +9,7 @@ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
|
9
9
|
|
10
10
|
# pick up the vendored libyajl2 out of the libyajl2 gem
|
11
11
|
$CFLAGS = "-I#{Libyajl2.include_path} -L#{Libyajl2.opt_path} #{$CFLAGS}"
|
12
|
-
$LDFLAGS = "-L#{Libyajl2.opt_path} #{$
|
12
|
+
$LDFLAGS = "-L#{Libyajl2.opt_path} #{$LDFLAGS}"
|
13
13
|
|
14
14
|
puts $CFLAGS
|
15
15
|
puts $LDFLAGS
|
@@ -22,7 +22,7 @@ if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc|clang/
|
|
22
22
|
$CFLAGS << " -Wall"
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
#$LDFLAGS << " -lyajl"
|
26
26
|
|
27
27
|
dir_config 'parser'
|
28
28
|
|
data/lib/ffi_yajl/ext.rb
CHANGED
@@ -2,19 +2,26 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
require 'ffi_yajl/encoder'
|
4
4
|
require 'ffi_yajl/parser'
|
5
|
+
require 'dl'
|
6
|
+
require 'ffi'
|
7
|
+
require 'libyajl2'
|
5
8
|
|
6
|
-
#unless RUBY_VERSION.to_f >= 1.9
|
7
|
-
# # segfaults on ruby 1.8 and this is an exceedingly low priority to fix, use ffi instead
|
8
|
-
# raise NotImplementedError, "The C-extension is disabled on Ruby 1.8"
|
9
|
-
#end
|
10
9
|
|
11
10
|
module FFI_Yajl
|
12
11
|
class Parser
|
12
|
+
# FIXME: DRY with ffi_yajl/ffi.rb
|
13
|
+
libname = ::FFI.map_library_name("yajl")
|
14
|
+
libpath = File.expand_path(File.join(Libyajl2.opt_path, libname))
|
15
|
+
::DL.dlopen(libpath)
|
13
16
|
require 'ffi_yajl/ext/parser'
|
14
17
|
include FFI_Yajl::Ext::Parser
|
15
18
|
end
|
16
19
|
|
17
20
|
class Encoder
|
21
|
+
# FIXME: DRY with ffi_yajl/ffi.rb
|
22
|
+
libname = ::FFI.map_library_name("yajl")
|
23
|
+
libpath = File.expand_path(File.join(Libyajl2.opt_path, libname))
|
24
|
+
::DL.dlopen(libpath)
|
18
25
|
require 'ffi_yajl/ext/encoder'
|
19
26
|
include FFI_Yajl::Ext::Encoder
|
20
27
|
end
|
data/lib/ffi_yajl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.2
|
5
5
|
platform: ruby
|
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-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.2.
|
170
|
+
rubygems_version: 2.2.2
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Ruby FFI wrapper around YAJL 2.x
|