Skip to content

Commit

Permalink
irb from within the jruby-complete.jar needs to handle uri like file …
Browse files Browse the repository at this point in the history
…names - fixes #1983
  • Loading branch information
mkristian committed Sep 18, 2014
1 parent 29c2f06 commit 88e9f75
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/jirb
Expand Up @@ -9,7 +9,7 @@

require "irb"

if __FILE__ == $0
if __FILE__.sub(/file:/, '') == $0.sub(/file:/, '')
IRB.start(__FILE__)
else
# check -e option
Expand Down
2 changes: 1 addition & 1 deletion bin/jirb_swing
Expand Up @@ -49,7 +49,7 @@ end
JRuby.objectspace = true # useful for code completion

# From vanilla IRB
if __FILE__ == $0
if __FILE__.sub(/file:/, '') == $0.sub(/file:/, '')
IRB.start(__FILE__)
else
# check -e option
Expand Down
@@ -0,0 +1,5 @@
JAVA=`which java`
# jirb_swing does not work in those test environments
for i in irb jirb ; do
echo "puts 'hello $i'" | PATH= $JAVA -jar jruby-complete-1.7.16-SNAPSHOT.jar -S $i
done
@@ -0,0 +1,43 @@
<project>
<groupId>org.jruby</groupId>
<artifactId>execute-java--jar-jruby-complete_dot_jar--S-jirb</artifactId>
<version>1</version>
<modelVersion>4.0.0</modelVersion>

<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>1.7.16-SNAPSHOT</version>
<type>jar</type>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>../../local-repo/org/jruby/jruby-complete/1.7.16-SNAPSHOT</directory>
<includes>
<include>jruby-complete-*.jar</include>
</includes>
<targetPath>${project.basedir}</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>exec</goal></goals>
<configuration>
<executable>irb.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,20 @@
import java.io.*;
import org.codehaus.plexus.util.FileUtils;


String log = FileUtils.fileRead( new File( basedir, "build.log" ) );
String expected = "hello irb";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
// expected = "hello swing_jirb";
// if ( !log.contains( expected ) )
// {
// throw new RuntimeException( "log file does not contain '" + expected + "'" );
// }
expected = "hello jirb";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}

1 comment on commit 88e9f75

@rdp
Copy link
Contributor

@rdp rdp commented on 88e9f75 Sep 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Please sign in to comment.