Sha256: faaac8b27b75029110e2e34cd82ce0614f0f30f2a054fdc249bb45dbf11e2a32

Contents?: true

Size: 1.14 KB

Versions: 8

Compression:

Stored size: 1.14 KB

Contents

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'yard'
require 'open3'
require_relative 'lib/tasks/generate_huffman_table'

RSpec::Core::RakeTask.new(:spec) do |t|
  t.exclude_pattern = './spec/hpack_test_spec.rb'
end

RSpec::Core::RakeTask.new(:hpack) do |t|
  t.pattern = './spec/hpack_test_spec.rb'
end

task :h2spec do
  if /darwin/ !~ RUBY_PLATFORM
    abort "h2spec rake task currently only works on OSX.
           Download other binaries from https://github.com/summerwind/h2spec/releases"
  end

  system 'ruby example/server.rb -p 9000 &', out: File::NULL
  sleep 1

  output = ''
  Open3.popen2e('spec/h2spec/h2spec.darwin -p 9000 -o 1') do |_i, oe, _t|
    oe.each do |l|
      l.gsub!(/\e\[(\d+)(;\d+)*m/, '')

      output << l
      if l =~ /passed.*failed/
        puts "\n#{l}"
        break # suppress post-summary failure output
      else
        print '.'
      end
    end
  end

  File.write 'spec/h2spec/output/non_secure.txt', output

  system 'kill `pgrep -f example/server.rb`'
end

RuboCop::RakeTask.new
YARD::Rake::YardocTask.new

task default: [:spec, :rubocop]
task all: [:default, :hpack]

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
http-2-0.11.0 Rakefile
http-2-0.10.2 Rakefile
http-2-0.10.1 Rakefile
http-2-0.10.0 Rakefile
http-2-0.9.1 Rakefile
http-2-0.9.0 Rakefile
http-2-0.8.4 Rakefile
http-2-0.8.3 Rakefile