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
/usr/local% git diff | |
git diff | |
diff --git a/Library/Formula/poppler.rb b/Library/Formula/poppler.rb | |
index 79f8e4f..70088b6 100644 | |
--- a/Library/Formula/poppler.rb | |
+++ b/Library/Formula/poppler.rb | |
@@ -31,6 +31,9 @@ class Poppler < Formula | |
args = ["--disable-dependency-tracking", "--prefix=#{prefix}"] | |
args << "--disable-poppler-qt4" unless ARGV.include? "--with-qt4" | |
args << "--enable-xpdf-headers" if ARGV.include? "--enable-xpdf-headers" |
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
/usr/local/Library/Formula% cd | |
cd | |
/Users/niku% cd /usr/local | |
cd /usr/local | |
/usr/local% git diff | |
git diff | |
diff --git a/Library/Formula/poppler.rb b/Library/Formula/poppler.rb | |
index 79f8e4f..8aa211c 100644 | |
--- a/Library/Formula/poppler.rb | |
+++ b/Library/Formula/poppler.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
/Users/niku% ruby --version | |
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0] | |
/Users/niku% curl -H host:pow localhost/config.json | |
{"bin":"/Users/niku/Library/Application Support/Pow/Versions/0.3.1/bin/pow","dstPort":80,"httpPort":20559,"dnsPort":20560,"timeout":900,"workers":2,"domains":["dev"],"extDomains":[],"hostRoot":"/Users/niku/Library/Application Support/Pow/Hosts","logRoot":"/Users/niku/Library/Logs/Pow","rvmPath":"/Users/niku/.rvm/scripts/rvm"} | |
/Users/niku% mkdir lint_test | |
/Users/niku% echo "require 'rack'\nrequire 'rack/lobster'\n\nuse Rack::Lint\nrun Rack::Lobster.new\n" > lint_test/config.ru | |
/Users/niku% cat lint_test/config.ru | |
require 'rack' | |
require 'rack/lobster' |
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 Foo | |
def block | |
yield if block_given? | |
end | |
def call &b | |
b.call if b | |
end | |
end | |
Foo.new.send(:block) { 'block called' } # => "block called" |
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 'rspec' | |
class Foo | |
def bar | |
if block_given? | |
yield(1) | |
yield(2) | |
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
require 'rspec' | |
class Int | |
attr_reader :count | |
def initialize | |
@count = 0 | |
end | |
def increment | |
@count += 1 | |
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
require 'rspec' | |
class Foo | |
def bar &block | |
block.call(:called) if block | |
:done | |
end | |
end | |
# Foo.new.bar{ |m| p m } |
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 'rspec' | |
class Foo | |
attr_reader :ary | |
def initialize | |
@ary = [] | |
@num = 0 | |
end | |
def update | |
@ary << @num |
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 'rspec' | |
class Foo | |
def my_fork | |
fork do | |
p 'forked once' | |
end | |
end | |
def my_fork_double | |
fork 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
# -*- coding: utf-8 -*- | |
require 'rspec' | |
class LRUCache | |
attr_reader :order, :capacity | |
def initialize(capacity) | |
@capacity = capacity | |
@order = [] | |
@hash = {} |