Skip to content

Commit

Permalink
better regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Croak authored and thoughtbot-travis committed Jun 4, 2010
1 parent e04c421 commit 1dbfc18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion install.rb
Expand Up @@ -3,5 +3,5 @@

puts "inserting #{line} into #{path}"

content = File.read(path).gsub(/^(class|module|.*Routes).*$/) {|match| "#{match}\n #{line}" }
content = File.read(path).gsub(/^(end\s*)$/) {|match| " #{line}\n#{match}" }
File.open(path, 'wb') { |file| file.write(content) }

0 comments on commit 1dbfc18

Please sign in to comment.