Finalize support for delegating behaviours.
[tagua/yd.git] / fix_copyright.rb
blobd6872cc7de931d6fb5f8a5add94a0b6b2ae61027
1 #!/usr/bin/ruby
3 require 'find'
5 stmt = %{/*
6   Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
7             (c) 2007 Maurizio Monge <maurizio.monge@kdemail.net>
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; either version 2 of the License, or
12   (at your option) any later version.
18 Find.find('.') do |filename|
19     if filename =~ /\.(cpp|h)$/
20         code = File.open(filename) {|f| f.read}
21         unless code =~ /copyright/i
22             File.open(filename, 'w') {|f| f.write(stmt + code)}
23         end
24     end
25 end