This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ($:.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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Foo := Object clone | |
| Foo something := 0 | |
| Foo run := method( | |
| something := 1 | |
| ) | |
| Foo slotSummary println | |
| foo := Foo clone | |
| foo run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| forward := method( | |
| self matcher := call message name | |
| self against := call message arguments | |
| return matchee | |
| ) | |
| // code code code | |
| run := method( | |
| matcher getSlot(matcher) call(against) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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 |