Skip to content

Instantly share code, notes, and snippets.

...
spec:ci_interpreted_18_19:
[echo] Running rake spec:ci_interpreted_18_19
[echo] compile=OFF, threshold=20, objectspace=true threadpool=false reflection=false
[java] JAVA options: {:fork=>"true", :failonerror=>"true", :classname=>"org.jruby.Main", :maxmemory=>"1024M"}
[java] NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
[java] Gem.source_index called from /home/sebastien/dev/jruby/build/classes/jruby/jruby/commands.rb:36.
[java] NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
[java] Gem::SourceIndex#search called from /home/sebastien/dev/jruby/build/classes/jruby/jruby/commands.rb:36.
@tychobrailleur
tychobrailleur / select_jvm.rb
Created January 11, 2012 21:57
Set current jvm
#!/usr/bin/env jruby
require 'java'
JVMS = ["/home/sebastien/dev/jdk1.6.0_25",
"/home/sebastien/dev/jdk1.6.0_30",
"/home/sebastien/dev/jdk1.7.0_02"]
current_java_home = ENV['JAVA_HOME']
if ARGV.size != 1
@tychobrailleur
tychobrailleur / .custom
Created January 12, 2012 10:47
dot emacs
;; Format a pom file - and pretty much any othe file!
(defun format-pom ()
"formats a pom.xml file"
(interactive)
(progn (indent-region (point-min) (point-max))
(delete-trailing-whitespace)))
(defun untabify-all ()
"untabifies a whole buffer"
@tychobrailleur
tychobrailleur / simple.rb
Created January 12, 2012 22:36
Use maven artefact with JRuby
# install gem:
# jruby -S gem install mvn:commons-lang:commons-lang
require 'java'
require 'rubygems'
require 'maven/commons-lang/commons-lang'
java_import 'org.apache.commons.lang.StringUtils'
puts StringUtils::count_matches('totototo', 'to')
@tychobrailleur
tychobrailleur / output
Created January 18, 2012 06:22
Gradle startup time
sebastien@kilkenny:~/tmp$ echo > build.gradle
sebastien@kilkenny:~/tmp$ gradle t
:tasks
------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------
Help tasks
----------
#!/bin/sh
fsck -p /dev/sda3
fsck -p /dev/sdb5
@tychobrailleur
tychobrailleur / pom.xml
Created January 21, 2012 19:34
Pom template
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>TODO</groupId>
<artifactId>TODO</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>TODO app name</name>
<properties>
@tychobrailleur
tychobrailleur / .jrubyrc
Created March 4, 2012 14:32
Sample .jrubyrc, with comments
# Example of .jrubyrc
# Set compilation mode. JIT = at runtime; FORCE = before execution. (JIT, FORCE, OFF, OFFIR)
# compile.mode = FORCE
# Dump to console all bytecode generated at runtime.
# compile.dump = true
# Enable verbose JIT logging (reports failed compilation)
# jit.logging.verbose = true
@tychobrailleur
tychobrailleur / replace.rb
Created March 5, 2012 09:56
Remove auto_increment in sql script; good ruby example on how to process a file
file_names = ['script.sql']
file_names.each do |file_name|
text = File.read(file_name)
File.open(file_name, 'wb') do
|file|
file.write(text.gsub(/\s*AUTO_INCREMENT\s*(\=\s*[0-9]+)?/, ""))
end
end
@tychobrailleur
tychobrailleur / stepdefs.rb
Created March 5, 2012 13:18
Extract cucumber-jvm mappings from stepdefs ("already implemented stepdefs") and prints them in alphabetical order
require 'erb'
mappings = []
features = File.join("**", "*.java")
current_dir = ARGV[0]
Dir.chdir(current_dir)
Dir.glob(features).each do |file_name|
puts "Processing #{file_name}" if $DEBUG