Created
July 20, 2011 07:27
-
-
Save bemurphy/1094517 to your computer and use it in GitHub Desktop.
This file contains 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
# With tweaks | |
text.scan(/#/).each do |match| | |
line1 | |
line2 | |
foo | |
end | |
describe "Foo" do | |
it "finds customers" do | |
foo = stub("something", | |
:foo => %w[ | |
foo | |
bar | |
fizz | |
buzz | |
]) | |
customer = stub("customer", | |
:foo => [ | |
'bar', | |
'another' | |
], | |
:bar => { | |
:fizz => "buzz" | |
}, | |
:fizz => { | |
:buzz => "boo" | |
}) | |
end | |
end | |
foo, bar = something, | |
something | |
# FFFFFFFFFUUUU | |
foobar = users.each { |user| | |
user | |
} | |
# Uh, what? | |
foobar = users.each { | |
something | |
} | |
hash = { | |
:a => { | |
:b => :c | |
} | |
} | |
lambda { | |
true == true | |
} | |
users.each do |user| | |
p user | |
end | |
# FFFFFFFFFUUUU | |
users.each {|user| | |
p user | |
} | |
var.func1(:param => 'value') do | |
var.func2(:param => 'value') do | |
puts "test" | |
end | |
end | |
var.func1(:param => 'value') { | |
var.func2(:param => 'value') { | |
puts "test" | |
} | |
} | |
builder = Nokogiri::XML::Builder.new do |xml| | |
xml.root { | |
xml.products { | |
xml.widget { | |
xml.id_ "10" | |
xml.name "Awesome widget" | |
} | |
} | |
} | |
end | |
puts builder.to_xml |
This file contains 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
# Pre-tweaks | |
text.scan(/#/).each do |match| | |
line1 | |
line2 | |
foo | |
end | |
describe "Foo" do | |
it "finds customers" do | |
foo = stub("something", | |
:foo => %w[ | |
foo | |
bar | |
fizz | |
buzz | |
]) | |
customer = stub("customer", | |
:foo => [ | |
'bar', | |
'another' | |
], | |
:bar => { | |
:fizz => "buzz" | |
}, | |
:fizz => { | |
:buzz => "boo" | |
}) | |
end | |
end | |
foo, bar = something, | |
something | |
foobar = users.each { |user| | |
user | |
} | |
foobar = users.each { | |
something | |
} | |
hash = { | |
:a => { | |
:b => :c | |
} | |
} | |
lambda { | |
true == true | |
} | |
users.each do |user| | |
p user | |
end | |
users.each {|user| | |
p user | |
} | |
var.func1(:param => 'value') do | |
var.func2(:param => 'value') do | |
puts "test" | |
end | |
end | |
var.func1(:param => 'value') { | |
var.func2(:param => 'value') { | |
puts "test" | |
} | |
} | |
builder = Nokogiri::XML::Builder.new do |xml| | |
xml.root { | |
xml.products { | |
xml.widget { | |
xml.id_ "10" | |
xml.name "Awesome widget" | |
} | |
} | |
} | |
end | |
puts builder.to_xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment