Created
May 18, 2009 12:56
-
-
Save ancorcruz/113453 to your computer and use it in GitHub Desktop.
fix routing specs 1.1.12 to 1.2.6
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
/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\}/ | |
} | |
} |
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
#!/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