Skip to content

Instantly share code, notes, and snippets.

@bemurphy
Created July 20, 2011 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bemurphy/1094517 to your computer and use it in GitHub Desktop.
Save bemurphy/1094517 to your computer and use it in GitHub Desktop.
# 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
# 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