Created
September 1, 2011 02:12
-
-
Save roykolak/1185275 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
task :seed do | |
content = '' | |
File.open('extension/history.html', 'r') do |file| | |
file.each do |line| | |
content += line | |
end | |
end | |
fixtures = ''; | |
Dir["spec/javascripts/fixtures/*.html"].each do |file_name| | |
File.open(file_name, 'r') do |file| | |
file.each do |line| | |
fixtures += " #{line}" | |
end | |
fixtures += "\n" | |
end | |
end | |
File.open('extension/history.html', 'w') {|f| f.write(content.gsub(/<!-- Templates Start -->(.*)<!-- Templates End -->/m, "<!-- Templates Start -->\n\n\n#{fixtures}\n <!-- Templates End -->"))} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment