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
require File.dirname(__FILE__) + '/test_helper.rb' | |
module SuperAwesomeTests | |
def test_truth_from_module | |
assert true | |
end | |
end | |
class TestModular < Test::Unit::TestCase | |
include SuperAwesomeTests |
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
require 'rubygems' | |
require 'ruby2ruby' | |
class Hello | |
def wtf(&block) | |
puts block.to_ruby | |
end | |
end | |
Hello.new.wtf do |
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
require 'rubygems' | |
require 'ruby-prof' | |
RubyProf.measure_mode = RubyProf::PROCESS_TIME | |
RubyProf.start | |
require 'config/environment' | |
results = RubyProf.stop | |
File.open "loading-graph.html", 'w' do |file| | |
RubyProf::GraphHtmlPrinter.new(results).print(file) |
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
$: << "/Users/lifo/Rails/sinatra/lib" | |
require 'rubygems' | |
require 'sinatra' | |
require 'sinatra/test/unit' | |
require 'app' | |
class Rack::Response | |
attr_accessor :variables | |
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
module Hello | |
module World | |
class << self | |
def lol | |
puts "lol" | |
end | |
end | |
end | |
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
class AsyncApp | |
# This is a template async response. N.B. Can't use string for body on 1.9 | |
AsyncResponse = [-1, {}, []].freeze | |
def call(env) | |
body = DeferrableBody.new | |
EventMachine::next_tick { env['async.callback'].call [200, {'Content-Type' => 'text/plain'}, body] } | |
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
[lifo@null rock (master)]$ ruby extconf.rb && make | |
[lifo@null rock (master)]$ ruby run.rb |
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
module Hello | |
autoload "World", "world" | |
class << self | |
def run | |
World.after | |
end | |
end | |
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
run "rm public/index.html" | |
generate(:scaffold, "item name:string") | |
route "map.root :controller => :items" | |
rake("db:migrate", "production") | |
gem 'ruby-openid' | |
gem 'will-paginate', :git => 'git://github.com/mislav/will_paginate.git' | |
gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net" |
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
ServerRoot "/Users/lifo/Apache/install" | |
Listen 8080 | |
# ErrorLog "logs/error_log" | |
# LogLevel debug | |
PassengerRoot /Users/lifo/Apache/src/passenger | |
PassengerRuby /opt/local/bin/ruby | |
<VirtualHost *:8080> |