summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/http_parser.rb-0.8.0/tasks/compile.rake
diff options
context:
space:
mode:
authorBenjamin Sanders <ben@Benjamins-MacBook-Pro.local>2025-10-11 10:34:24 -0400
committerBenjamin Sanders <ben@Benjamins-MacBook-Pro.local>2025-10-11 10:34:24 -0400
commit5571dc766e2143e39762ff0b47c41d1c2e154f4c (patch)
treef4f124d314a7e76c04484515aa0fd1f2e271a601 /vendor/bundle/ruby/3.4.0/gems/http_parser.rb-0.8.0/tasks/compile.rake
parent359f3309c97fc894b63e0a295c76ab298504d635 (diff)
Vendor bundled gems for deployment
Diffstat (limited to 'vendor/bundle/ruby/3.4.0/gems/http_parser.rb-0.8.0/tasks/compile.rake')
-rw-r--r--vendor/bundle/ruby/3.4.0/gems/http_parser.rb-0.8.0/tasks/compile.rake42
1 files changed, 42 insertions, 0 deletions
diff --git a/vendor/bundle/ruby/3.4.0/gems/http_parser.rb-0.8.0/tasks/compile.rake b/vendor/bundle/ruby/3.4.0/gems/http_parser.rb-0.8.0/tasks/compile.rake
new file mode 100644
index 0000000..22d6f6d
--- /dev/null
+++ b/vendor/bundle/ruby/3.4.0/gems/http_parser.rb-0.8.0/tasks/compile.rake
@@ -0,0 +1,42 @@
+require 'rubygems/package_task'
+require 'rake/extensiontask'
+require 'rake/javaextensiontask'
+
+def gemspec
+ @clean_gemspec ||= eval(File.read(File.expand_path('../../http_parser.rb.gemspec', __FILE__)))
+end
+
+Gem::PackageTask.new(gemspec) do |pkg|
+end
+
+if RUBY_PLATFORM =~ /java/
+ Rake::JavaExtensionTask.new("ruby_http_parser", gemspec) do |ext|
+ ext.classpath = File.expand_path('../../ext/ruby_http_parser/vendor/http-parser-java/ext/primitives.jar', __FILE__)
+ end
+else
+ Rake::ExtensionTask.new("ruby_http_parser", gemspec) do |ext|
+ unless RUBY_PLATFORM =~ /mswin|mingw/
+ ext.cross_compile = true
+ ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60']
+
+ # inject 1.8/1.9 pure-ruby entry point
+ ext.cross_compiling do |spec|
+ spec.files += ['lib/ruby_http_parser.rb']
+ end
+ end
+ end
+end
+
+file 'lib/ruby_http_parser.rb' do |t|
+ File.open(t.name, 'wb') do |f|
+ f.write <<-eoruby
+RUBY_VERSION =~ /(\\d+.\\d+)/
+require "\#{$1}/ruby_http_parser"
+ eoruby
+ end
+ at_exit{ FileUtils.rm t.name if File.exists?(t.name) }
+end
+
+if Rake::Task.task_defined?(:cross)
+ task :cross => 'lib/ruby_http_parser.rb'
+end