incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r689741 - in /incubator/sling/trunk/scripting/ruby: pom.xml src/main/java/org/apache/sling/scripting/ruby/ErbScriptEngine.java
Date Thu, 28 Aug 2008 07:12:05 GMT
Author: bdelacretaz
Date: Thu Aug 28 00:12:04 2008
New Revision: 689741

URL: http://svn.apache.org/viewvc?rev=689741&view=rev
Log:
SLING-632 - upgrade jruby to 1.1.3, works with additional optional Import-Package statements

Modified:
    incubator/sling/trunk/scripting/ruby/pom.xml
    incubator/sling/trunk/scripting/ruby/src/main/java/org/apache/sling/scripting/ruby/ErbScriptEngine.java

Modified: incubator/sling/trunk/scripting/ruby/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/ruby/pom.xml?rev=689741&r1=689740&r2=689741&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/ruby/pom.xml (original)
+++ incubator/sling/trunk/scripting/ruby/pom.xml Thu Aug 28 00:12:04 2008
@@ -57,14 +57,11 @@
                         <Private-Package>
                             org.apache.sling.scripting.ruby
                         </Private-Package>
-                        
                         <Embed-Dependency>jruby-complete;inline=true</Embed-Dependency>
-                        <Import-Package>
-                            javax.swing.*;
-                            org.apache.bsf.*;
-                            sun.misc; resolution:=optional
-                        </Import-Package>
-                        <DynamicImport-Package>*</DynamicImport-Package>
+		        <Import-Package>
+		          com.sun.*;org.apache.bsf.*;sun.*;resolution:=optional
+			</Import-Package> 
+			<DynamicImport-Package>*</DynamicImport-Package>
                         <ScriptEngine-Name>${pom.name}</ScriptEngine-Name>
                         <ScriptEngine-Version>${pom.version}</ScriptEngine-Version>
                     </instructions>
@@ -101,7 +98,7 @@
         <dependency>
             <groupId>org.jruby</groupId>
             <artifactId>jruby-complete</artifactId>
-            <version>1.0</version>
+            <version>1.1.3</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: incubator/sling/trunk/scripting/ruby/src/main/java/org/apache/sling/scripting/ruby/ErbScriptEngine.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/ruby/src/main/java/org/apache/sling/scripting/ruby/ErbScriptEngine.java?rev=689741&r1=689740&r2=689741&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/ruby/src/main/java/org/apache/sling/scripting/ruby/ErbScriptEngine.java
(original)
+++ incubator/sling/trunk/scripting/ruby/src/main/java/org/apache/sling/scripting/ruby/ErbScriptEngine.java
Thu Aug 28 00:12:04 2008
@@ -49,8 +49,8 @@
         final ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
         try {
         	Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-            runtime = Ruby.getDefaultInstance();
-            runtime.evalScript("require 'java';require 'erb';self.send :include, ERB::Util;class
ERB;def get_binding;binding;end;attr_reader :props;def set_props(p);@props = p;"
+            runtime = Ruby.newInstance();
+            runtime.evalScriptlet("require 'java';require 'erb';self.send :include, ERB::Util;class
ERB;def get_binding;binding;end;attr_reader :props;def set_props(p);@props = p;"
                 + "for name,v in @props;instance_eval \"def #{name}; @props['#{name}'];end\";end;end;end;");
 
             erbModule = runtime.getClassFromPath("ERB");



Mime
View raw message