From 0561ad9615b5f3f181d790e2db16086aa572b1eb Mon Sep 17 00:00:00 2001 From: Tyler Vann-Campbell Date: Sun, 8 Feb 2015 13:20:43 -0800 Subject: Move #windows? to lib to allow not checking libname to determine platform --- lib/ffi_yajl/ext.rb | 3 ++- lib/ffi_yajl/platform.rb | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 lib/ffi_yajl/platform.rb diff --git a/lib/ffi_yajl/ext.rb b/lib/ffi_yajl/ext.rb index 7a84ef1..0d0faf3 100644 --- a/lib/ffi_yajl/ext.rb +++ b/lib/ffi_yajl/ext.rb @@ -4,6 +4,7 @@ require 'ffi_yajl/encoder' require 'ffi_yajl/parser' require 'ffi' require 'libyajl2' +require 'ffi_yajl/platform' module FFI_Yajl # FIXME: DRY with ffi_yajl/ffi.rb @@ -11,7 +12,7 @@ module FFI_Yajl # so that the C-library can be installed without FFI libname = ::FFI.map_library_name("yajl") # awful windows patch, but there is an open issue to entirely replace FFI.map_library_name already - libname = "libyajl.so" if libname == "yajl.dll" + libname = "libyajl.so" if Platform::windows? libpath = File.expand_path(File.join(Libyajl2.opt_path, libname)) libpath.gsub!(/dylib/, 'bundle') libpath = ::FFI.map_library_name("yajl") unless File.exist?(libpath) diff --git a/lib/ffi_yajl/platform.rb b/lib/ffi_yajl/platform.rb new file mode 100644 index 0000000..bde716d --- /dev/null +++ b/lib/ffi_yajl/platform.rb @@ -0,0 +1,5 @@ +module Platform + def self.windows? + !!(RUBY_PLATFORM =~ /mswin|mingw|cygwin|windows/) + end +end \ No newline at end of file -- cgit v1.2.1 From a750fa504bcb1f6eb173948b48d6ab8ca1c8ce13 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 17 Feb 2015 15:08:09 -0800 Subject: mixin windows? helper directly into the object its useful to be able to include/extend the platform class and then use this sugar directly --- lib/ffi_yajl/ext.rb | 4 +++- lib/ffi_yajl/platform.rb | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/ffi_yajl/ext.rb b/lib/ffi_yajl/ext.rb index 0d0faf3..5784023 100644 --- a/lib/ffi_yajl/ext.rb +++ b/lib/ffi_yajl/ext.rb @@ -7,12 +7,14 @@ require 'libyajl2' require 'ffi_yajl/platform' module FFI_Yajl + extend FFI_Yajl::Platform + # FIXME: DRY with ffi_yajl/ffi.rb # FIXME: extract map_library_name from FFI and stop requiring it at the top level # so that the C-library can be installed without FFI libname = ::FFI.map_library_name("yajl") # awful windows patch, but there is an open issue to entirely replace FFI.map_library_name already - libname = "libyajl.so" if Platform::windows? + libname = "libyajl.so" if windows? libpath = File.expand_path(File.join(Libyajl2.opt_path, libname)) libpath.gsub!(/dylib/, 'bundle') libpath = ::FFI.map_library_name("yajl") unless File.exist?(libpath) diff --git a/lib/ffi_yajl/platform.rb b/lib/ffi_yajl/platform.rb index bde716d..6c2a498 100644 --- a/lib/ffi_yajl/platform.rb +++ b/lib/ffi_yajl/platform.rb @@ -1,5 +1,7 @@ -module Platform - def self.windows? - !!(RUBY_PLATFORM =~ /mswin|mingw|cygwin|windows/) +module FFI_Yajl + module Platform + def windows? + !!(RUBY_PLATFORM =~ /mswin|mingw|cygwin|windows/) + end end -end \ No newline at end of file +end -- cgit v1.2.1 From 7a580315a543f5a91e2e2652b137ec257514566a Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 17 Feb 2015 15:11:49 -0800 Subject: add md file --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8724d54..6f88e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ * [**Elan Ruusamäe**](https://github.com/glensc): include status code for Unknown Error +* [**Tyler Vann-Campbell**](https://github.com/lrdcasimir) + Fix check for windows? on cygwin and get dll name right * Correctly throw useful invalid UTF-8 error exception ## 1.3.1 (11/24/2014) -- cgit v1.2.1 From 272e2fcb7e9da2976f033a0c64af99f73e1071cb Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 17 Feb 2015 15:33:55 -0800 Subject: bump version to 1.4.0 --- lib/ffi_yajl/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ffi_yajl/version.rb b/lib/ffi_yajl/version.rb index dffcc29..5f62ec1 100644 --- a/lib/ffi_yajl/version.rb +++ b/lib/ffi_yajl/version.rb @@ -1,3 +1,3 @@ module FFI_Yajl - VERSION = "1.3.1" + VERSION = "1.4.0" end -- cgit v1.2.1 From 729dc19395028f3cea829aeb1e554b3f256dfcdb Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 17 Feb 2015 15:35:33 -0800 Subject: reset CHANGELOG for release --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f88e7f..603274a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ ### Changes +### Bugs fixed + +## 1.4.0 (02/17/2015) + +### New features + * Implement :validate_utf8 (on by default) which can be set to false to suppress validation ### Bugs fixed -- cgit v1.2.1 From 0f1c327dcfee4e19c58afcda05b1378547650933 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 17 Feb 2015 15:37:23 -0800 Subject: remove opscode references --- README.md | 2 +- ffi-yajl.gemspec.shared | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4044b72..de23bfc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Build Status](https://travis-ci.org/opscode/ffi-yajl.png)](https://travis-ci.org/opscode/ffi-yajl) [![Code Climate](https://codeclimate.com/github/opscode/ffi-yajl.png)](https://codeclimate.com/github/opscode/ffi-yajl) +[![Build Status](https://travis-ci.org/chef/ffi-yajl.png)](https://travis-ci.org/chef/ffi-yajl) [![Code Climate](https://codeclimate.com/github/chef/ffi-yajl.png)](https://codeclimate.com/github/chef/ffi-yajl) # FFI YAJL diff --git a/ffi-yajl.gemspec.shared b/ffi-yajl.gemspec.shared index 356185d..2226fbd 100644 --- a/ffi-yajl.gemspec.shared +++ b/ffi-yajl.gemspec.shared @@ -10,7 +10,7 @@ Gem::Specification.new do |s| s.description = s.summary s.author = "Lamont Granquist" s.email = "lamont@getchef.com" - s.homepage = "http://github.com/opscode/ffi-yajl" + s.homepage = "http://github.com/chef/ffi-yajl" s.add_development_dependency "rake", "~> 10.1" s.add_development_dependency "rspec", "~> 2.99" -- cgit v1.2.1