Skip to content

Instantly share code, notes, and snippets.

john-mbp:feb_17 john$ irb -f
irb(main):001:0> require 'rubygems'; require 'pp'
=> true
irb(main):002:0> pp $:.grep(/gemcutter/)
["/Users/john/.gem/ruby/1.8/gems/gemcutter-0.1.0/lib",
"/Users/john/.gem/ruby/1.8/gems/gemcutter-0.1.1/lib",
"/Users/john/.gem/ruby/1.8/gems/gemcutter-0.2.0/lib",
"/Users/john/.gem/ruby/1.8/gems/gemcutter-0.2.1/lib",
"/Users/john/.gem/ruby/1.8/gems/gemcutter-0.3.0/lib",
"/Users/john/.gem/ruby/1.8/gems/gemcutter-0.3.1/bin",
require 'rubygems'
gem 'utility_belt'
require 'utility_belt'
# gem 'looksee'
# require 'looksee/shortcuts'
def new_constants(&block)
constants = Object.constants

Purpose

To define a set of performance measurements and test cases to compare Rack::Rewrite and Refraction.

Note: this is still currently a draft.

Prerequisite

Select a family of rewrite rules (concepts) that both libraries support. Prior to running the performance analysis, each library author should provide implementations of each of the rules for their library.

Measurements

@jtrupiano
jtrupiano / gist:292898
Created February 2, 2010 18:36
Demonstrate how multiple versions of the same gems with gem plugins not only get added to the load path but take precedence over the more recent versions
john-mbp:projects john$ irb -f
irb(main):001:0> require 'pp'
=> true
irb(main):002:0> pp $:
["/Library/Ruby/Site/1.8",
"/Library/Ruby/Site/1.8/powerpc-darwin9.0",
"/Library/Ruby/Site/1.8/universal-darwin9.0",
"/Library/Ruby/Site",
"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8",
"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/powerpc-darwin9.0",
john-mbp:gem_filer john$ ruby -rubygems gem_runner_test.rb
Successfully installed thor-0.12.3
1 gem installed
/Users/john/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:31: warning: already initialized constant EXPR_BEG
/Users/john/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:32: warning: already initialized constant EXPR_MID
/Users/john/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:33: warning: already initialized constant EXPR_END
/Users/john/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:34: warning: already initialized constant EXPR_ARG
/Users/john/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:35: warning: already initialized constant EXPR_FNAME
/Users/john/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:36: warning: already initialized constant EXPR_DOT
/Users/john/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/1.8/rdoc/parsers/parse_rb.rb:37: warning: already initialized constant EXPR_CLASS
require 'highline'
require 'ruby-debug'
require 'rubygems/gem_runner'
runner = ::Gem::GemRunner.new
runner.run(["install", "thor", "--version", "0.12.3", "--source", "http://gemcutter.org"])
/Users/john/.rvm/rubies/ruby-1.8.7-p248/bin/ruby: Mach-O executable i386
/usr/bin/ruby: Mach-O universal binary with 2 architectures
/usr/bin/ruby (for architecture ppc7400): Mach-O executable ppc
/usr/bin/ruby (for architecture i386): Mach-O executable i386
rvm 0.1.3 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]
system:
uname: "Darwin john-mbp.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386"
ruby:
interpreter: "ruby"
version: "1.8.7"
@jtrupiano
jtrupiano / gist:292271
Created February 2, 2010 01:47
spec_fetcher.rb:245 bug I keep getting with rvm + ruby 1.8.7
john-mbp:gem_filer john$ gem install highline ruby-debug
Successfully installed highline-1.5.2
/Users/john/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:245: [BUG] Segmentation fault
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-darwin9.8.0]
Abort trap
john-mbp:gem_filer john$ gem list highline
*** LOCAL GEMS ***