Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Rakefile #1847

Merged
merged 1 commit into from
Jul 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 7 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ require_relative 'lib/puma/detect'
require 'rubygems/package_task'
require 'bundler/gem_tasks'

gemspec = Gem::Specification.load(Dir['*.gemspec'].first)
gemspec = Gem::Specification.load("puma.gemspec")
Gem::PackageTask.new(gemspec).define

# Add rubocop task
RuboCop::RakeTask.new

spec = Gem::Specification.load("puma.gemspec")

# generate extension code using Ragel (C and Java)
desc "Generate extension code (C and Java) using Ragel"
task :ragel
Expand All @@ -40,16 +38,16 @@ task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java']
if !Puma.jruby?
# compile extensions using rake-compiler
# C (MRI, Rubinius)
Rake::ExtensionTask.new("puma_http11", spec) do |ext|
Rake::ExtensionTask.new("puma_http11", gemspec) do |ext|
# place extension inside namespace
ext.lib_dir = "lib/puma"

CLEAN.include "lib/puma/{1.8,1.9}"
CLEAN.include "lib/puma/puma_http11.rb"
end
CLEAN.include "lib/puma/{1.8,1.9}"
CLEAN.include "lib/puma/puma_http11.rb"
end
else
# Java (JRuby)
Rake::JavaExtensionTask.new("puma_http11", spec) do |ext|
Rake::JavaExtensionTask.new("puma_http11", gemspec) do |ext|
ext.lib_dir = "lib/puma"
end
end
Expand All @@ -75,6 +73,7 @@ end

namespace :test do
desc "Run the integration tests"

task :integration do
sh "ruby test/shell/run.rb"
end
Expand Down