Skip to content

Instantly share code, notes, and snippets.

View ELLIOTTCABLE's full-sized avatar
🐫

ELLIOTTCABLE

🐫
View GitHub Profile
($:.unshift '/Users/elliottcable/Code/refinery/lib').uniq!
require 'refinery/core_ext/class'
require 'refinery/core_ext/object'
class Something
def abc
@abc
end
def abc= value
@abc = value
Foo := Object clone
Foo something := 0
Foo run := method(
something := 1
)
Foo slotSummary println
foo := Foo clone
foo run
forward := method(
self matcher := call message name
self against := call message arguments
return matchee
)
// code code code
run := method(
matcher getSlot(matcher) call(against)
describe '#instances' do
it 'should return all instances of a class currently present in the Ruby ObjectSpace' do
klass = Class.new
instance1 = klass.new
instance2 = klass.new
instance3 = klass.new
[instance1, instance2, instance3].each {|instance| klass.instances.should include(instance) }
end
[Thu Oct 16 - 05:43:07] [elliottcable @ Geoffrey] [~/Code/]
-- irb
# IRB loaded…
first = [:first, 1, 2, 3]
# => [:first, 1, 2, 3]
second = [:second, 4, 5, 6]
# => [:second, 4, 5, 6]
[first, second].assoc(:second)
# => [:second, 4, 5, 6]
[first, second].assoc(:second) << 7
[Thu Oct 16 - 14:28:37] [elliottcable @ Geoffrey] [~/Code/]
-- sudo gem install oniguruma
Building native extensions. This could take a while...
ERROR: Error installing oniguruma:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install oniguruma
checking for main() in -lonig... no
creating Makefile
VALUE whatever_we_are_calling_this(VALUE self) {
st_data_t value;
if(FL_TEST(klass, FL_SINGLETON)) st_lookup( RCLASS(self)->iv_tbl, rb_intern("__attached__"), &value );
else rb_raise(rb_eRuntimeError, "not a singleton");
return (VALUE) value;
}
package name.elliottcable.tests;
import org.junit.Test;
import static org.junit.Assert.*;
public class RationalTest {
@Test public void simpleTest() {
Integer one = 1;
Integer two = 2;
assertTrue(one.equals(two));
}
Spec::Rake::SpecTask.new(:run) do |t|
t.spec_opts = ["--format", "profile"]
t.spec_opts << "--colour" unless ENV['CI']
t.spec_files = Dir['spec/**/*_spec.rb'].sort
t.libs = ['lib']
t.rcov = true
t.rcov_opts = [ '--include-file', '"^lib"', '--exclude-only', '"^spec"']
t.rcov_dir = File.join('meta', 'coverage')
end
[Wed Oct 22 - 17:05:33] [elliottcable @ Geoffrey] [~/Code/]
-- time curl -I http://yreality.net/g/ ; time curl -I http://www.google.com/
HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Thu, 23 Oct 2008 01:06:13 GMT
Content-Type: text/html
Content-Length: 161
Last-Modified: Sat, 20 Sep 2008 09:21:09 GMT
Connection: keep-alive
Accept-Ranges: bytes