diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644
index 000000000..4fddfba9f
--- /dev/null
+++ b/.github/workflows/maven.yml
@@ -0,0 +1,35 @@
+# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
+
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+
+name: Java CI with Maven
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK 8
+ uses: actions/setup-java@v3
+ with:
+ java-version: '8'
+ distribution: 'temurin'
+ cache: maven
+ - name: Build with Maven
+ run: mvn -B install --file pom.xml
+
+ # Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
+ - name: Update dependency graph
+ uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
diff --git a/Gemfile b/Gemfile
index 6a4127329..cbf214e6c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -12,6 +12,6 @@ group :development do
gem 'appraisal', '< 1.0', :require => nil
end
-gem 'rake', '~> 10.3.1', :group => :test, :require => nil
-gem 'rspec', '~> 2.14.1', :group => :test
+gem 'rake', '~> 13.2', :group => :test, :require => nil
+gem 'rspec', :group => :test
gem 'jruby-openssl', :group => :test if JRUBY_VERSION < '1.7.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 7d3bc6ef9..43b978fdd 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -4,23 +4,31 @@ GEM
appraisal (0.5.2)
bundler
rake
- diff-lcs (1.2.5)
- rack (1.6.0)
- rake (10.3.2)
- rspec (2.14.1)
- rspec-core (~> 2.14.0)
- rspec-expectations (~> 2.14.0)
- rspec-mocks (~> 2.14.0)
- rspec-core (2.14.8)
- rspec-expectations (2.14.5)
- diff-lcs (>= 1.1.3, < 2.0)
- rspec-mocks (2.14.6)
+ diff-lcs (1.5.1)
+ rack (3.0.11)
+ rake (13.2.1)
+ rspec (3.13.0)
+ rspec-core (~> 3.13.0)
+ rspec-expectations (~> 3.13.0)
+ rspec-mocks (~> 3.13.0)
+ rspec-core (3.13.0)
+ rspec-support (~> 3.13.0)
+ rspec-expectations (3.13.0)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.13.0)
+ rspec-mocks (3.13.1)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.13.0)
+ rspec-support (3.13.1)
PLATFORMS
- java
+ universal-java-1.8
DEPENDENCIES
appraisal (< 1.0)
rack
- rake (~> 10.3.1)
- rspec (~> 2.14.1)
+ rake (~> 13.2)
+ rspec
+
+BUNDLED WITH
+ 2.4.19
diff --git a/History.md b/History.md
index 511ae9fb7..2144ec219 100644
--- a/History.md
+++ b/History.md
@@ -39,7 +39,7 @@ Changes from 1.1.15 apply since the previous release got yanked due a regression
- a work-around for WAS (8.5) failing on `Dir.chdir` while booting (#170)
- consider response unhandled when OPTIONS with "Allow" header set (#153)
- improved handling for jruby.compat.version (should work with jruby-head)
-- start using de.saumya.mojo jruby plugins for mvn (relates to #108 as well)
+- start using org.jruby.maven jruby plugins for mvn (relates to #108 as well)
this allows us to work without a GEM_HOME/GEM_PATH (local ruby install)
- use ruby-style methods for the servlet api (in our servlet_env handler)
diff --git a/Rakefile b/Rakefile
index c3692d06c..d38ff4240 100644
--- a/Rakefile
+++ b/Rakefile
@@ -64,7 +64,7 @@ task :unpack_gem => "target" do |t|
mkdir_p "target/vendor"
require 'rubygems/installer'
rack_dir = File.basename(gem_file).sub(/\.gem$/, '')
- Gem::Installer.new(gem_file, :unpack => true, :install_dir => rack_dir).unpack "#{target}/#{rack_dir}"
+ Gem::Installer.new(Gem::Package.new(gem_file), :unpack => true, :install_dir => rack_dir).unpack "#{target}/#{rack_dir}"
File.open("#{target}/vendor/rack.rb", "w") do |f|
f << "dir = File.dirname(__FILE__)\n"
f << "if dir =~ /.jar!/ && dir !~ /^file:/\n"
diff --git a/pom.xml b/pom.xml
index e4972fde4..e43aeff21 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,11 +19,11 @@
- 1.7.19
+ 9.4.7.0
vendor/gems
- 1.7.14
+ 2.4.19
false
- 1.0.9
+ 3.0.3
${project.build.directory}/rubygems
@@ -75,10 +75,6 @@
-
- rubygems-releases
- http://rubygems-proxy.torquebox.org/releases
-
false
@@ -89,6 +85,10 @@
sonatype
https://oss.sonatype.org/content/repositories/snapshots/
+
+ mavengems
+ mavengem:https://rubygems.org
+
@@ -160,9 +160,21 @@
gem
provided
+
+ javax.activation
+ activation
+ 1.1
+
+
+
+ org.jruby.maven
+ mavengem-wagon
+ 2.0.2
+
+
install
${basedir}/src/main/java
@@ -186,8 +198,8 @@
maven-compiler-plugin
3.1
- 1.6
- 1.6
+ 8
+ 8
true
true
@@ -221,9 +233,9 @@
- de.saumya.mojo
+ org.jruby.maven
gem-maven-plugin
- ${saumya.mojo.version}
+ ${jruby.maven.plugins.version}
false
@@ -241,9 +253,9 @@
- de.saumya.mojo
+ org.jruby.maven
bundler-maven-plugin
- ${saumya.mojo.version}
+ ${jruby.maven.plugins.version}
bundle-install
@@ -258,19 +270,19 @@
- de.saumya.mojo
+ org.jruby.maven
rake-maven-plugin
- ${saumya.mojo.version}
+ ${jruby.maven.plugins.version}
-
- rake-spec
- test
- rake
-
- ${jruby.version}
- speconly SKIP_SPECS=${maven.test.skip} FULL_BIN_PATH=true
-
-
+
+
+
+
+
+
+
+
+
rake-resources
diff --git a/src/main/java/org/jruby/rack/ext/Logger.java b/src/main/java/org/jruby/rack/ext/Logger.java
index 84c57bfdc..b747cfd4d 100644
--- a/src/main/java/org/jruby/rack/ext/Logger.java
+++ b/src/main/java/org/jruby/rack/ext/Logger.java
@@ -388,7 +388,7 @@ else if ( msg instanceof RubyException ) { // print backtrace for error
@JRubyMethod(name = "<<")
public IRubyObject append(final ThreadContext context, final IRubyObject msg) {
final RubyString msgString = msg.asString();
- doLog(msgString); return msgString.length();
+ doLog(msgString); return msgString.rubyLength(context);
}
// private
diff --git a/src/main/java/org/jruby/rack/ext/Response.java b/src/main/java/org/jruby/rack/ext/Response.java
index ab3f928f7..f14dd3afd 100644
--- a/src/main/java/org/jruby/rack/ext/Response.java
+++ b/src/main/java/org/jruby/rack/ext/Response.java
@@ -286,6 +286,11 @@ public String getBody() {
final StringBuilder bodyParts = new StringBuilder();
invoke(context, this.body, "each",
new JavaInternalBlockBody(context.runtime, Arity.ONE_REQUIRED) {
+ @Override
+ public IRubyObject yield(ThreadContext context, IRubyObject[] args) {
+ return yield(context, args[0]);
+ }
+
@Override
public IRubyObject yield(ThreadContext context, IRubyObject part) {
bodyParts.append( part.asString().toString() );
@@ -377,6 +382,11 @@ public void visit(final IRubyObject key, final IRubyObject val) {
// value.each_line { |val| response.addHeader(key.to_s, val.chomp("\n")) }
invoke(context, val, each_line ? "each_line" : "each",
new JavaInternalBlockBody(context.runtime, Arity.ONE_REQUIRED) {
+ @Override
+ public IRubyObject yield(ThreadContext context, IRubyObject[] args) {
+ return yield(context, args[0]);
+ }
+
@Override
public IRubyObject yield(ThreadContext context, IRubyObject value) {
value.callMethod(context, "chomp!", newLine);
@@ -464,6 +474,11 @@ protected void writeBody(final RackResponseEnvironment response) throws IOExcept
try {
invoke(context, body, method,
new JavaInternalBlockBody(context.runtime, Arity.ONE_REQUIRED) {
+ @Override
+ public IRubyObject yield(ThreadContext context, IRubyObject[] args) {
+ return yield(context, args[0]);
+ }
+
@Override
public IRubyObject yield(ThreadContext context, IRubyObject line) {
//final ByteList bytes = line.asString().getByteList();
diff --git a/src/main/java/org/jruby/rack/util/ExceptionUtils.java b/src/main/java/org/jruby/rack/util/ExceptionUtils.java
index b98254837..bd6cae649 100644
--- a/src/main/java/org/jruby/rack/util/ExceptionUtils.java
+++ b/src/main/java/org/jruby/rack/util/ExceptionUtils.java
@@ -81,9 +81,9 @@ public static CharSequence formatError(final RubyException error) {
private static void appendInspect(final RubyException error, final StringBuilder out) {
final RubyClass errorClass = error.getMetaClass().getRealClass();
- if ( error.message != null && ! error.message.isNil() ) {
+ if ( error.getMessage() != null && ! error.getMessage().isNil() ) {
out.append("#<").append( errorClass.getName() ).append(": ");
- out.append( error.message.asString() ).append('>');
+ out.append( error.getMessage().asString() ).append('>');
}
else {
out.append( errorClass.getName() );