summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-06-20 15:37:38 -0700
committerTim Smith <tsmith@chef.io>2017-06-20 15:37:38 -0700
commit672fce3aed2d68e7362dc5cfeb72df78f30eb3a2 (patch)
tree76598d0c31493ca6fa8a8353402136cf8003b997 /ext
parentf3f92275f804f4c6cf93ee054af7d4ba3e50030a (diff)
downloadffi-yajl-672fce3aed2d68e7362dc5cfeb72df78f30eb3a2.tar.gz
Switch from reek/rubocop to chefstyle
Reek doesn't work with modern Rake Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'ext')
-rw-r--r--ext/ffi_yajl/ext/dlopen/extconf.rb10
-rw-r--r--ext/ffi_yajl/ext/encoder/extconf.rb24
-rw-r--r--ext/ffi_yajl/ext/parser/extconf.rb24
3 files changed, 29 insertions, 29 deletions
diff --git a/ext/ffi_yajl/ext/dlopen/extconf.rb b/ext/ffi_yajl/ext/dlopen/extconf.rb
index f35d0cb..803d326 100644
--- a/ext/ffi_yajl/ext/dlopen/extconf.rb
+++ b/ext/ffi_yajl/ext/dlopen/extconf.rb
@@ -1,8 +1,8 @@
# rubocop:disable Style/GlobalVars
-require 'mkmf'
-require 'rubygems'
+require "mkmf"
+require "rubygems"
-RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
+RbConfig::MAKEFILE_CONFIG["CC"] = ENV["CC"] if ENV["CC"]
puts $CFLAGS
puts $LDFLAGS
@@ -11,6 +11,6 @@ have_header("dlfcn.h")
have_library("dl", "dlopen")
-dir_config 'dlopen'
+dir_config "dlopen"
-create_makefile 'ffi_yajl/ext/dlopen'
+create_makefile "ffi_yajl/ext/dlopen"
diff --git a/ext/ffi_yajl/ext/encoder/extconf.rb b/ext/ffi_yajl/ext/encoder/extconf.rb
index e46080a..e13c0a1 100644
--- a/ext/ffi_yajl/ext/encoder/extconf.rb
+++ b/ext/ffi_yajl/ext/encoder/extconf.rb
@@ -1,9 +1,9 @@
# rubocop:disable Style/GlobalVars
-require 'mkmf'
-require 'rubygems'
-require 'libyajl2'
+require "mkmf"
+require "rubygems"
+require "libyajl2"
-RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
+RbConfig::MAKEFILE_CONFIG["CC"] = ENV["CC"] if ENV["CC"]
# pick up the vendored libyajl2 out of the libyajl2 gem
$CFLAGS = " -I#{Libyajl2.include_path} #{$CFLAGS}"
@@ -16,7 +16,7 @@ puts $CFLAGS
puts $LDFLAGS
# except if you're doing an unoptimized gcc install we're going to help you out a bit
-if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc|clang/
+if RbConfig::MAKEFILE_CONFIG["CC"] =~ /gcc|clang/
$CFLAGS << " -O3" unless $CFLAGS[/-O\d/]
# how many people realize that -Wall is a compiler-specific flag???
# apparently not many based on reading lots of shitty extconf.rb's out there
@@ -34,32 +34,32 @@ end
# NOTE: find_library has the side effect of adding -lyajl to the flags which we are deliberately
# avoiding doing with the libyajl2-gem (allowing it to be lazily loaded with dlopen)
-if !windows? && !find_header('yajl/yajl_tree.h')
+if !windows? && !find_header("yajl/yajl_tree.h")
puts "libyajl2 headers not found in libyajl2-gem, searching for system libraries..."
HEADER_DIRS = [
"/opt/local/include", # MacPorts
"/usr/local/include", # /usr/local
- RbConfig::CONFIG['includedir'], # Ruby
+ RbConfig::CONFIG["includedir"], # Ruby
"/usr/include", # (default)
]
LIB_DIRS = [
"/opt/local/lib", # MacPorts
"/usr/local/lib", # /usr/local + Homebrew
- RbConfig::CONFIG['libdir'], # Ruby
+ RbConfig::CONFIG["libdir"], # Ruby
"/usr/lib", # (default)
]
# add --with-yajl-dir, --with-yajl-include, --with-yajl-lib
- dir_config('yajl', HEADER_DIRS, LIB_DIRS)
+ dir_config("yajl", HEADER_DIRS, LIB_DIRS)
# here we use find_library in order to deliberately link with -lyajl as a useful side-effect
- unless find_header('yajl/yajl_tree.h') && find_library('yajl', 'yajl_complete_parse')
+ unless find_header("yajl/yajl_tree.h") && find_library("yajl", "yajl_complete_parse")
abort "libyajl2 is missing. please install libyajl2"
end
end
-dir_config 'encoder'
+dir_config "encoder"
-create_makefile 'ffi_yajl/ext/encoder'
+create_makefile "ffi_yajl/ext/encoder"
diff --git a/ext/ffi_yajl/ext/parser/extconf.rb b/ext/ffi_yajl/ext/parser/extconf.rb
index 6f8526e..86ee50f 100644
--- a/ext/ffi_yajl/ext/parser/extconf.rb
+++ b/ext/ffi_yajl/ext/parser/extconf.rb
@@ -1,9 +1,9 @@
# rubocop:disable Style/GlobalVars
-require 'mkmf'
-require 'rubygems'
-require 'libyajl2'
+require "mkmf"
+require "rubygems"
+require "libyajl2"
-RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
+RbConfig::MAKEFILE_CONFIG["CC"] = ENV["CC"] if ENV["CC"]
# pick up the vendored libyajl2 out of the libyajl2 gem
$CFLAGS = "-I#{Libyajl2.include_path} #{$CFLAGS}"
@@ -16,7 +16,7 @@ puts $CFLAGS
puts $LDFLAGS
# except if you're doing an unoptimized gcc install we're going to help you out a bit
-if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc|clang/
+if RbConfig::MAKEFILE_CONFIG["CC"] =~ /gcc|clang/
$CFLAGS << " -O3" unless $CFLAGS[/-O\d/]
# how many people realize that -Wall is a compiler-specific flag???
# apparently not many based on reading lots of shitty extconf.rb's out there
@@ -34,32 +34,32 @@ end
# NOTE: find_library has the side effect of adding -lyajl to the flags which we are deliberately
# avoiding doing with the libyajl2-gem (allowing it to be lazily loaded with dlopen)
-if !windows? && !find_header('yajl/yajl_tree.h')
+if !windows? && !find_header("yajl/yajl_tree.h")
puts "libyajl2 headers not found in libyajl2-gem, searching for system libraries..."
HEADER_DIRS = [
"/opt/local/include", # MacPorts
"/usr/local/include", # /usr/local
- RbConfig::CONFIG['includedir'], # Ruby
+ RbConfig::CONFIG["includedir"], # Ruby
"/usr/include", # (default)
]
LIB_DIRS = [
"/opt/local/lib", # MacPorts
"/usr/local/lib", # /usr/local + Homebrew
- RbConfig::CONFIG['libdir'], # Ruby
+ RbConfig::CONFIG["libdir"], # Ruby
"/usr/lib", # (default)
]
# add --with-yajl-dir, --with-yajl-include, --with-yajl-lib
- dir_config('yajl', HEADER_DIRS, LIB_DIRS)
+ dir_config("yajl", HEADER_DIRS, LIB_DIRS)
# here we use find_library in order to deliberately link with -lyajl as a useful side-effect
- unless find_header('yajl/yajl_tree.h') && find_library('yajl', 'yajl_complete_parse')
+ unless find_header("yajl/yajl_tree.h") && find_library("yajl", "yajl_complete_parse")
abort "libyajl2 is missing. please install libyajl2"
end
end
-dir_config 'parser'
+dir_config "parser"
-create_makefile 'ffi_yajl/ext/parser'
+create_makefile "ffi_yajl/ext/parser"