Skip to content

Instantly share code, notes, and snippets.

View woodie's full-sized avatar

John Woodell woodie

View GitHub Profile
@woodie
woodie / logging.properties
Created January 5, 2010 04:21
Set log level on App Engine for JRuby
# Specify the handlers to create in the root logger
# (all loggers are children of the root logger)
# The following creates two handlers
handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
# Set the default logging level for the root logger
.level = ALL
# Set the default logging level for new ConsoleHandler instances
java.util.logging.ConsoleHandler.level = INFO
@woodie
woodie / bundle.rdoc
Created January 6, 2010 10:04
Bundle from JRuby, from MRI

We bundle from MRI for JRuby

no such file to load –

/Users/me/Desktop/rails_app/.gems/bundler_gems/jruby/1.8/environment (LoadError)

but this file exists –

/Users/me/Desktop/rails_app/.gems/bundler_gems/ruby/1.8/environment.rb

The stub environment.rb now contains this…

require 'rbconfig'
@woodie
woodie / redo.duby
Created January 13, 2010 23:20 — forked from ribrdb/redo.duby
def foo(a:int[])
a.each {|x| x += 1;puts x; redo if x == 2}
end
@woodie
woodie / Gemfile .rb
Created January 16, 2010 17:38
Gem Bundle, then make a gems.jar
# Critical default settings:
disable_system_gems
disable_rubygems
bundle_path '.gems/bundler_gems'
# List gems to bundle here:
gem 'rails_dm_datastore'
gem 'rails', "2.3.5"
gem 'i18n'
gem 'tzinfo'
@woodie
woodie / Gemfile .rb
Created January 17, 2010 10:44
Mechanize with Hpricot on AppEngine
# Critical default settings:
disable_system_gems
disable_rubygems
bundle_path ".gems/bundler_gems"
# List gems to bundle here:
gem "appengine-rack"
gem "appengine-apis"
gem 'hpricot', '0.8.2'
gem 'mechanize', '0.8.5'
@woodie
woodie / Gemfile .rb
Created January 18, 2010 07:03
Send Mail from AppEngine for JRuby
# Critical default settings:
disable_system_gems
disable_rubygems
bundle_path ".gems/bundler_gems"
# List gems to bundle here:
gem "appengine-rack"
gem "appengine-apis"
gem "activesupport", "3.0.pre"
gem "builder"
@woodie
woodie / gist:280490
Created January 18, 2010 23:27 — forked from headius/gist:280301
CodeCache = Awesomeness
~/projects/jruby ➔ jruby -J-Djruby.jit.threshold=0 -J-Djruby.jit.codeCache=`pwd`/codecache -e "load 'test/mri/sample/test.rb'"
assignment : ..................................................................................................................................................................................................................................................................................................................................................................condition : ..if/unless : ...case : .....while/until : ........exception : .......array : .......................................hash : ...........................iterator : .........................................................................................float : ................................................................................bignum : ...............................string & char : ..............................................................assignment : ..........call : ......proc : .........eval : ..
@woodie
woodie / appengine gem versions
Created January 18, 2010 23:35 — forked from takeru/appengine gem versions
Gem Versions and Dates
require "date"
puts "appengine gem versions: #{Time.now}"
cmd = "gem list | grep appengine"
#puts cmd
gems = `#{cmd}`.split("\n").collect{|v| v.strip }.sort
gems.each do |gem|
if gem =~ /^(\S+) \((.+)\)$/
name = $1
versions = $2.split(",").collect{|v| v.strip }.sort
@woodie
woodie / README.rdoc
Created January 20, 2010 19:44
Working with JRuby CodeCache on App Engine

Working with JRuby CodeCache on App Engine

CodeCache is a way to dump bitecode when classes hit the JRuby JIT. Setting the jruby.jit.threshold low will generate more files, but may not be helpful. Without CodeCache, the default jruby.jit.threshold of 99 is best.

Getting Started

First, make sure you have a current version of 1.5.x

gist.github.com/423990

diff --git a/src/org/jruby/compiler/JITCompiler.java b/src/org/jruby/compiler/JITCompiler.java
index c1bc58a..3fb2faa 100644
--- a/src/org/jruby/compiler/JITCompiler.java
+++ b/src/org/jruby/compiler/JITCompiler.java
@@ -190,6 +190,7 @@ public class JITCompiler implements JITCompilerMBean {
private String className;
private String filename;
private String methodName;
+ private String key;