Skip to content

Instantly share code, notes, and snippets.

@danlucraft
danlucraft / padre
Created June 17, 2010 08:10
Patch to script/padre
15c18
< if ( $^O eq 'darwin' and $^X !~ m{/wxPerl\.app/} ) {
---
> if ( $^O eq 'darwin' and $^X !~ m{/wxPerl} ) {
Warning: prerequisite Cwd 3.2701 not found. We have 3.2501.
Warning: prerequisite Encode 2.26 not found. We have 2.23.
Warning: prerequisite ExtUtils::Manifest 1.56 not found. We have 1.51.
Warning: prerequisite File::Spec 3.2701 not found. We have 3.2501.
Warning: prerequisite File::Spec::Functions 3.2701 not found. We have 3.2501.
Warning: prerequisite Format::Human::Bytes 0.04 not found.
Warning: prerequisite Module::Build 0.3603 not found. We have 0.280801.
Warning: prerequisite Pod::Perldoc 3.15 not found. We have 3.1402.
Warning: prerequisite Pod::Simple 3.07 not found. We have 3.05.
Warning: prerequisite Pod::Simple::XHTML 3.04 not found.
cpan[7]> make Padre
Running make for module 'Padre'
Running make for P/PL/PLAVEN/Padre-0.64.tar.gz
Prepending blib/arch and blib/lib of 21 build dirs to PERL5LIB; for 'get'
Has already been unwrapped into directory /Users/danlucraft/.cpan/build/Padre-0.64-MBd1tG
Prepending blib/arch and blib/lib of 21 build dirs to PERL5LIB; for 'make'
CPAN.pm: Going to build P/PL/PLAVEN/Padre-0.64.tar.gz
$ echo "class Foo; end" > foo.rb
$ jrubyc foo.rb
Compiling foo.rb to class foo
$ jar cvf foo.jar foo.class
added manifest
adding: foo.class(in = 3387) (out= 1505)(deflated 55%)
$ jirb
require 'rj^Hirb(main):001:0> require 'java'
=> true
import java.util.*;
public class TicTacToe {
public static boolean DEBUG = true;
public static int EMPTY = 0;
public static int O = 1;
public static int X = 2;
public String boardString;
def connect_proc_to_item(item, entry)
if use_numbers? and Redcar.platform == :osx
item.text = entry.text + "\t" + @number.to_s
@number += 1
else
item.text = entry.text
end
item.addSelectionListener(ProcSelectionListener.new(entry))
end
-> builtin/core_ext/symbol
<- builtin/core_ext/symbol - 40ms
-> enumerator
<- enumerator - 4ms
-> bin/../lib/redcar_quick_start
-> socket
<- socket - 83ms
<- bin/../lib/redcar_quick_start - 90ms
-> bin/../lib/redcar
-> redcar_quick_start
@danlucraft
danlucraft / Declarations.rb
Created April 12, 2010 16:19
Beginnings of a JVM native ctags library?
require 'yaml'
JAVA_YAML=<<YAML
- regex: "class\\s+(\\w+)"
capture: 1
type: id
- regex: "interface\\s+(\\w+)"
capture: 1
type: id
- regex: "(public|private).*\\s+(\\w+)\s*\\("
$ cat example/test.rb
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require 'jruby-prof'
class Thing
def stuff1
10000.times { 1 + 2; "asdf".length }
end
$ less tracing_example.txt
#:0
Thing#stuff1:140
Fixnum#times:138
Fixnum#+:22
Thing#stuff4:114
Fixnum#times:88
Thing#method_overhead:28
JRubyProf.stop_tracing:0
Java::OrgJrubyRuntimeCallsite::CachingCallSite.stop_tracing:0