\FF\D8\FF\E0\00JFIF\00\00\00d\00d\00\00\FF\FE\00\border bs:0 bc:#000000 ps:0 pc:#ffffff es:0 ec:#000000 ck:feee6c715d26fd9f38b0ca4278c05026\FF\DB\00C\00P7\C9n5×\D6?\BDê\9Ds\EBp\9F[`8m\B7)o\B5\E8\E6I\99\FE3]]A2\BA\8Cw\D6E\93\\DEv\C8\009\F2\F1NI?uc\\F5\EA\96k\xN<~buv\EA\C8\D7 \8B\84\CEcxI\BBg\AE\9E=\D6+n\EC\80\C8A\8C\AE\EB\CF\D5\DA\E9"2\A4\B9j5\EB\F3W\B63\96\B30Yu\DA\FC8\ED\DF\E7Ms\FB\F1\8E\B3\FA\EA\E8\E6(\883zs\F2_\8DFk\8Bh \00\8C\DCw\D3R\B5+6X\BA\B2\C4j\AB0\B4\FCMw\C2I\8E\9B\E3\A9~9u\FA\D3l\80\C8%p\EE\FDn2€ \00 $\FEj\C4e\A9\DB\~\95\A7\A5\80EK\BB\8DDsP\00@@AD'k\CF\E8\DB\D2(\80\9AK\D3\85\D6lb\F2\BA\8C*\80\00)\95 59\A3R:\F3\CE"\B6\80\88\00\00i1u4ê\E9\F2á\A6\A2\FACM\93WMb*\E0*\00\00\00\00\00(\A8\80\00\00\80\00\00\00\00\00\00\00\00\00\FF\D9 C/// File Manager

File Manager

Path: /opt/chef.upgrade/embedded/lib/ruby/gems/2.3.0/gems/ffi-yajl-2.3.0/

Viewing File: Rakefile

$LOAD_PATH << File.expand_path(File.join(File.dirname( __FILE__ ), "lib"))

require 'rspec/core/rake_task'
require 'rubygems/package_task'
require 'rake/extensiontask'
require 'ffi_yajl/version'
require 'github_changelog_generator/task'

Dir[File.expand_path("../*gemspec", __FILE__)].reverse_each do |gemspec_path|
  gemspec = eval(IO.read(gemspec_path))
  Gem::PackageTask.new(gemspec).define
end

GitHubChangelogGenerator::RakeTask.new :changelog do |config|
  config.issues = false
  config.since_tag = '1.0.1'
  config.exclude_labels = %w{duplicate question invalid wontfix changelog_skip}
end

desc "Build it and ship it"
task ship: [:clean, :gem] do
  sh("git tag #{FFI_Yajl::VERSION}")
  sh("git push --tags")
  Dir[File.expand_path("../pkg/*.gem", __FILE__)].reverse_each do |built_gem|
    sh("gem push #{built_gem}")
  end
end

unix_gemspec = eval(File.read("ffi-yajl.gemspec"))

task :clean do
  sh "rm -f Gemfile.lock"
  sh "rm -rf pkg/* tmp/* .bundle lib/ffi_yajl/ext/*"
end

desc "install the gem locally"
task install: [:package] do
  if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
    sh %{gem install pkg/#{unix_gemspec.name}-#{unix_gemspec.version}-universal-java.gem}
  else
    sh %{gem install pkg/#{unix_gemspec.name}-#{unix_gemspec.version}.gem}
  end
end

spec = Gem::Specification.load('ffi-yajl.gemspec')

Rake::ExtensionTask.new do |ext|
  ext.name = 'encoder'
  ext.lib_dir = 'lib/ffi_yajl/ext'
  ext.ext_dir = 'ext/ffi_yajl/ext/encoder'
  ext.gem_spec = spec
end

Rake::ExtensionTask.new do |ext|
  ext.name = 'parser'
  ext.lib_dir = 'lib/ffi_yajl/ext'
  ext.ext_dir = 'ext/ffi_yajl/ext/parser'
  ext.gem_spec = spec
end

Rake::ExtensionTask.new do |ext|
  ext.name = 'dlopen'
  ext.lib_dir = 'lib/ffi_yajl/ext'
  ext.ext_dir = 'ext/ffi_yajl/ext/dlopen'
  ext.gem_spec = spec
end

#
# test tasks
#

desc "Run all specs against both extensions"
task :spec do
  Rake::Task["spec:ffi"].invoke
  if !defined?(RUBY_ENGINE) || RUBY_ENGINE !~ /jruby/
    Rake::Task["spec:ext"].invoke
  end
end

namespace :spec do
  desc "Run all specs against ffi extension"
  RSpec::Core::RakeTask.new(:ffi) do |t|
    ENV['FORCE_FFI_YAJL'] = "ffi"
    t.pattern = FileList['spec/**/*_spec.rb']
  end
  if !defined?(RUBY_ENGINE) || RUBY_ENGINE !~ /jruby/
    desc "Run all specs again c extension"
    RSpec::Core::RakeTask.new(:ext) do |t|
      ENV['FORCE_FFI_YAJL'] = "ext"
      t.pattern = FileList['spec/**/*_spec.rb']
    end
  end
end

if RUBY_VERSION.to_f >= 1.9
  namespace :integration do
    begin
      require 'kitchen'
    rescue LoadError
      task :vagrant do
        puts "test-kitchen gem is not installed"
      end
      task :cloud do
        puts "test-kitchen gem is not installed"
      end
    else
      desc 'Run Test Kitchen with Vagrant'
      task :vagrant do
        Kitchen.logger = Kitchen.default_file_logger
        Kitchen::Config.new.instances.each do |instance|
          instance.test(:always)
        end
      end

      desc 'Run Test Kitchen with cloud plugins'
      task :cloud do
        if ENV['TRAVIS_PULL_REQUEST'] != 'true'
          ENV['KITCHEN_YAML'] = '.kitchen.cloud.yml'
          sh "kitchen test --concurrency 4"
        end
      end
    end
  end
  namespace :style do
    desc 'Run Ruby style checks'
    begin
      require 'rubocop/rake_task'
    rescue LoadError
      task :rubocop do
        puts "rubocop gem is not installed"
      end
    else
      RuboCop::RakeTask.new(:rubocop) do |t|
        t.fail_on_error = false
      end
    end

    desc 'Run Ruby smell checks'
    begin
      require 'reek/rake/task'
    rescue LoadError
      task :reek do
        puts "reek gem is not installed"
      end
    else
      Reek::Rake::Task.new(:reek) do |t|
        t.fail_on_error = false
        #        t.config_files = '.reek.yml'
      end
    end
  end
else
  namespace :integration do
    task :vagrant do
      puts "test-kitchen unsupported on ruby 1.8"
    end
    task :cloud do
      puts "test-kitchen unsupported on ruby 1.8"
    end
  end
  namespace :style do
    task :rubocop do
      puts "rubocop unsupported on ruby 1.8"
    end
    task :reek do
      puts "reek unsupported on ruby 1.8"
    end
  end
end

desc 'Run all style checks'
task style: ['style:rubocop', 'style:reek']

desc 'Run style + spec tests by default on travis'
task travis: %w{style spec}

desc 'Run style, spec and test kichen on travis'
task travis_all: ['style', 'spec', 'integration:cloud']

task default: ['style', 'spec', 'integration:vagrant']