Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ dependencies {
'com.amazonaws:aws-lambda-java-events:1.0.0',
'com.google.code.gson:gson:2.3.1',
)
compile files('lib/jruby.jar')
compile files('lib/jruby-complete.jar')
}

task buildZip(type: Zip) {
from compileJava
from processResources
from processResources
into('lib') {
from configurations.runtime
}
}
}

build.dependsOn buildZip
Binary file renamed lib/jruby.jar → lib/jruby-complete.jar
Binary file not shown.
12 changes: 6 additions & 6 deletions src/main/java/AWSLambdaJRuby.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ public class AWSLambdaJRuby {

@SuppressWarnings("rawtypes")
public String handler(Map data, Context context) throws Exception {

ScriptingContainer container = new ScriptingContainer();
String arg = new Gson().toJson(data);
context.getLogger().log(arg);

//add std lib path
URL stdLibPath = getClass().getResource("/stdlib/").toURI().toURL();
container.addLoadPath(new URLClassLoader(new URL[]{stdLibPath}));
//set argument of lambda function to ruby global variable as JSON format
// URL stdLibPath = getClass().getResource("/stdlib/").toURI().toURL();
// container.addLoadPath(new URLClassLoader(new URL[]{stdLibPath}));

//set argument of lambda function to ruby global variable as JSON format
container.put("$lambda_arg", arg);
// uploaded zip is extracted to /var/task directory
container.setCurrentDirectory("/var/task");
Object result = container.runScriptlet(PathType.CLASSPATH,rubyFileName);

return result == null ? null : result.toString();
}

Expand Down
Empty file.
189 changes: 0 additions & 189 deletions src/main/resources/stdlib/English.rb

This file was deleted.

102 changes: 0 additions & 102 deletions src/main/resources/stdlib/Win32API.rb

This file was deleted.

Loading