Skip to content

Instantly share code, notes, and snippets.

@ancorcruz
Created May 18, 2009 12:56
Show Gist options
  • Save ancorcruz/113453 to your computer and use it in GitHub Desktop.
Save ancorcruz/113453 to your computer and use it in GitHub Desktop.
fix routing specs 1.1.12 to 1.2.6
/generation" do$/,/recognition" do$/{
s/> 1/> "1"/g
/"create"/,/$/{
s/== "/== \{:path => "/
s/"[[:space:]]*$/&, :method => :post\}/
}
/"update"/,/$/{
s/== "/== \{:path => "/
s/\/1"[[:space:]]*$/&, :method => :put\}/
}
/"destroy"/,/$/{
s/== "/== \{:path => "/
s/\/1"[[:space:]]*$/&, :method => :delete\}/
}
}
#!/usr/bin/env ruby
if __FILE__ == $0
files = Dir.entries('spec/controllers').delete_if {|x| !x.include? "routing"}
files.each do |file|
system "sed -f route_spec_upgrade.sed -i spec/controllers/#{file}"
end
puts "Revisados " + files.size.to_s + " archivos"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment