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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 106e9a1f39150e1ba6d8c9e8cc89494619cada58
4
- data.tar.gz: 2d13687a1f4eb651f4fd18078d2662afd6d9d0d9
3
+ metadata.gz: b3ce1385d8ff7b48416b9ae7b57157be1b0211c4
4
+ data.tar.gz: 461f634749b19eafbbc770e869e79e85a4d7a73b
5
5
  SHA512:
6
- metadata.gz: 26a0c758139e7cfe1d36abec9457baef1ddc886a90c054bb637d52d5df51650cb1c633e9e8dacf702761fdc2c804fda5f11c00398a900b0b4e4a0bc46a4b822e
7
- data.tar.gz: 7b86b9d4b257be76b21cf1f3c3c59ca3b2dc7ed7f7502be2012961e45b5324d8551ee6368e7d2c2f4d1887dc4dfd4a3380acf8359c28c19b9fd02edeb4195f1c
6
+ metadata.gz: 3268713c039518262d00724a1d50a828359463a279494ca50b797472bc754c0181ad867051743ca778e65d2b9ef609d4deed10f24308183263633910bcb7afe9
7
+ data.tar.gz: 7b7655a1cb1d46b4ab13202ad33f9b08dcae4b14eb9d6b52319e685daf753d9ebe9efb18144b34535b031016389993f9d7e4e02301ebaa33c2550719cb12cd47
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ $: << File.expand_path(File.join(File.dirname( __FILE__ ), "lib"))
2
+
1
3
  require 'rspec/core/rake_task'
2
4
  require 'rubygems/package_task'
3
5
  require 'rake/extensiontask'
@@ -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} #{$CFLAGS}"
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
- $LDFLAGS << " -lyajl"
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} #{$CFLAGS}"
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
- $LDFLAGS << " -lyajl"
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
@@ -1,3 +1,3 @@
1
1
  module FFI_Yajl
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-06 00:00:00.000000000 Z
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.1
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