Skip to content

Commit

Permalink
Showing 28 changed files with 99 additions and 215 deletions.
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@
<extension>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-ruby</artifactId>
<version>0.1.11</version>
<version>0.1.15</version>
</extension>
</extensions>
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -85,8 +85,6 @@ matrix:
- env: JT=check_ambiguous_arguments
jdk: oraclejdk8
- env: JT='test mri'
- env: PHASE='-Pmain --projects !truffle'
jdk: oraclejdk8
- env: PHASE='-Pj2ee --projects !truffle'
jdk: oraclejdk7
# NOTE: build seems to never start (waited for any to finish for more than a day) - probably a travis-ci bug
9 changes: 8 additions & 1 deletion core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
@@ -60,6 +60,9 @@
* script or by a native executable.
*/
public class ArgumentProcessor {

public static final String SEPARATOR = "(?<!jar:file|jar|file|classpath|uri:classloader|uri|http|https):";

private static final class Argument {
public final String originalValue;
public final String dashedValue;
@@ -249,7 +252,11 @@ private void processArgument() {
break FOR;
case 'I':
String s = grabValue(getArgumentError("-I must be followed by a directory name to add to lib path"));
String[] ls = s.split(java.io.File.pathSeparator);
String separator = java.io.File.pathSeparator;
if (":".equals(separator)) {
separator = SEPARATOR;
}
String[] ls = s.split(separator);
config.getLoadPaths().addAll(Arrays.asList(ls));
break FOR;
case 'J':
4 changes: 2 additions & 2 deletions lib/pom.xml
Original file line number Diff line number Diff line change
@@ -276,7 +276,7 @@ DO NOT MODIFIY - GENERATED CODE
<plugin>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-maven-plugin</artifactId>
<version>0.1.11</version>
<version>0.1.15</version>
<executions>
<execution>
<id>install_gems</id>
@@ -327,7 +327,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-ruby</artifactId>
<version>0.1.11</version>
<version>0.1.15</version>
</dependency>
</dependencies>
</plugin>
18 changes: 1 addition & 17 deletions lib/ruby/stdlib/rubygems/defaults/jruby.rb
Original file line number Diff line number Diff line change
@@ -20,22 +20,6 @@ def ruby
def jarred_path?(p)
p =~ /^(file|uri|jar|classpath):/
end

# A jar path looks like this on non-Windows platforms:
# file:/path/to/file.jar!/path/within/jar/to/file.txt
# and like this on Windows:
# file:/C:/path/to/file.jar!/path/within/jar/to/file.txt
#
# This method returns:
# /path/to/file.jar
# or
# C:/path/to/file.jar
# as appropriate.
def jar_path(p)
path = p.sub(/^file:/, "").sub(/!.*/, "")
path = path.sub(/^\//, "") if win_platform? && path =~ /^\/[A-Za-z]:/
path
end
end

# Default home directory path to be used if an alternate value is not
@@ -72,7 +56,7 @@ def self.win_platform?
# Allow specifying jar and classpath type gem path entries
def self.path_separator
return File::PATH_SEPARATOR unless File::PATH_SEPARATOR == ':'
/(?<!jar:file|jar|file|classpath|uri:classloader|uri|http|https):/
/#{org.jruby.util.cli.ArgumentProcessor::SEPARATOR}/
end
end

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@ gem 'rspec', '~> 3.0'

gem 'rake', '10.4.2'

gem 'jbundler', '0.7.1'
#gem 'jbundler', '0.7.1'

gem 'ruby-maven', '3.1.1.0.11'
#gem 'ruby-maven', '3.1.1.0.11'
28 changes: 28 additions & 0 deletions maven/jruby-complete/src/it/runnable/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
rake (10.4.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.3)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)

PLATFORMS
java

DEPENDENCIES
rake (= 10.4.2)
rspec (~> 3.0)

BUNDLED WITH
1.11.2
File renamed without changes.
46 changes: 46 additions & 0 deletions maven/jruby-complete/src/it/runnable/Mavenfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#-*- mode: ruby -*-

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10',
'mavengem.wagon.version' => '0.2.0',
'jruby.version' => '9.0.5.0' )

gemfile

jarfile

packaging :jrubyJar

resource :includes => ['.rspec', '*.rb', 'config.ru', '*file', '*file.lock', '.jbundler/classpath.rb',
'lib/**', 'app/**', 'config/**', 'vendor/**', 'spec/**']


final_name 'runnable'

# test bits

phase :package do
plugin( 'org.codehaus.mojo:exec-maven-plugin:1.2',
:executable => 'java',
:environmentVariables => {
'HOME' => '${basedir}',
'GEM_PATH' => '${basedir}',
'GEM_HOME' => '${basedir}'
} ) do

execute_goal( :exec, :id => 'rake -T',
:arguments => [ '-jar', 'pkg/runnable.jar', '-S', 'rake', '-T' ] )

execute_goal( :exec, :id => 'rspec',
:arguments => [ '-jar', 'pkg/runnable.jar', '-S', 'rspec' ] )

execute_goal( :exec, :id => 'nested IsolatedScriptingContainer',
:arguments => [ '-jar', 'pkg/runnable.jar', 'nested.rb' ] )

# does not work anymore - bundler setup fails on forked rspec
# execute_goal( :exec, :id => 'rake spec',
# :arguments => [ '-jar', 'pkg/runnable.jar', '-S', 'rake', 'spec' ] )

end
end

Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ rescue Bundler::BundlerError => e
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'jbundler'

require 'rspec/core/rake_task'

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
require 'jbundler'

describe "something" do
it "does something" do
expect(__FILE__).to eq 'uri:classloader:/spec/one_spec.rb'
expect($CLASSPATH.size).to eq 6
expect(Jars.home).to eq 'uri:classloader:/jars'
expect($CLASSPATH.size).to eq 2
expect(Jars.home).to eq 'uri:classloader:/jars' if ENV_JAVA['jars.home']
expect(Dir.pwd).to eq 'uri:classloader://'
$LOAD_PATH.each do |lp|
# bundler or someone else messes up the $LOAD_PATH
3 changes: 3 additions & 0 deletions maven/jruby-complete/src/it/runnable/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require 'jars/setup'
module Helper
end
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -6,11 +6,11 @@ String log = FileUtils.fileRead( new File( basedir, "build.log" ) );
String expected = "Run RSpec code examples";
if ( !log.contains( expected ) ) throw new RuntimeException( "log file does not contain '" + expected + "'" );

expected = "uri:classloader:/Rakefile []";
expected = "uri:classloader:/Rakefile [\"-T\"]";
if ( !log.contains( expected ) ) throw new RuntimeException( "log file does not contain '" + expected + "'" );

expected = "uri:classloader:/Rakefile [\"spec\"]";
if ( !log.contains( expected ) ) throw new RuntimeException( "log file does not contain '" + expected + "'" );
//expected = "uri:classloader:/Rakefile [\"spec\"]";
//if ( !log.contains( expected ) ) throw new RuntimeException( "log file does not contain '" + expected + "'" );

expected = "5 runs, 5 assertions, 0 failures, 0 errors, 0 skips";
if ( !log.contains( expected ) )
13 changes: 0 additions & 13 deletions maven/jruby/src/it/.mvn/extensions.xml

This file was deleted.

12 changes: 0 additions & 12 deletions maven/jruby/src/it/runnable/.jbundler/classpath.rb

This file was deleted.

55 changes: 0 additions & 55 deletions maven/jruby/src/it/runnable/Gemfile.lock

This file was deleted.

6 changes: 0 additions & 6 deletions maven/jruby/src/it/runnable/Jarfile.lock

This file was deleted.

91 changes: 0 additions & 91 deletions maven/jruby/src/it/runnable/Mavenfile

This file was deleted.

2 changes: 0 additions & 2 deletions maven/jruby/src/it/runnable/spec/spec_helper.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ public class JRubyOsgiEmbedTest {

@Configuration
public Option[] config() {
File f = new File("target/osgi-test.jar");
File f = new File("pkg/osgi-test.jar");
return options(junitBundles(), bundle(f.toURI().toString()));
}

2 changes: 1 addition & 1 deletion pom.rb
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@
# used in ./lib/pom.rb and ./maven/jruby-stdlib/pom.rb
'rdoc.version' => '4.2.0',
'rake.version' => '10.4.2',
'jar-dependencies.version' => '0.2.3',
'jar-dependencies.version' => '0.3.2',

'jruby-launcher.version' => '1.1.1',
'ant.version' => '1.9.2',
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ DO NOT MODIFIY - GENERATED CODE
<jruby.plugins.version>1.0.10</jruby.plugins.version>
<invoker.skip>true</invoker.skip>
<json.version>1.8.3</json.version>
<jar-dependencies.version>0.2.3</jar-dependencies.version>
<jar-dependencies.version>0.3.2</jar-dependencies.version>
<power_assert.version>0.2.3</power_assert.version>
<version.jruby>${project.version}</version.jruby>
<bouncy-castle.version>1.47</bouncy-castle.version>

0 comments on commit fa4846f

Please sign in to comment.