Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a ruby script to prepend files with a uniform header.
- Loading branch information
JorenSix
committed
Nov 14, 2012
1 parent
6f2aab1
commit 207ce09
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,25 @@ | |||
/* | |||
* _______ _____ _____ _____ | |||
* |__ __| | __ \ / ____| __ \ | |||
* | | __ _ _ __ ___ ___ ___| | | | (___ | |__) | | |||
* | |/ _` | '__/ __|/ _ \/ __| | | |\___ \| ___/ | |||
* | | (_| | | \__ \ (_) \__ \ |__| |____) | | | |||
* |_|\__,_|_| |___/\___/|___/_____/|_____/|_| | |||
* | |||
* ----------------------------------------------------------- | |||
* | |||
* TarsosDSP is developed by Joren Six at | |||
* The School of Arts, | |||
* University College Ghent, | |||
* Hoogpoort 64, 9000 Ghent - Belgium | |||
* | |||
* ----------------------------------------------------------- | |||
* | |||
* Info: http://tarsos.0110.be/tag/TarsosDSP | |||
* Github: https://github.com/JorenSix/TarsosDSP | |||
* Releases: http://tarsos.0110.be/releases/TarsosDSP/ | |||
* | |||
* TarsosDSP includes modified source code by various authors, | |||
* for credits and info, see README. | |||
* | |||
*/ |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
/* | |||
* _______ _____ _____ _____ | |||
* |__ __| | __ \ / ____| __ \ | |||
* | | __ _ _ __ ___ ___ ___| | | | (___ | |__) | | |||
* | |/ _` | '__/ __|/ _ \/ __| | | |\___ \| ___/ | |||
* | | (_| | | \__ \ (_) \__ \ |__| |____) | | | |||
* |_|\__,_|_| |___/\___/|___/_____/|_____/|_| | |||
* | |||
* ----------------------------------------------------------- | |||
* | |||
* TarsosDSP is developed by Joren Six at | |||
* The Royal Academy of Fine Arts & Royal Conservatory, | |||
* University College Ghent, | |||
* Hoogpoort 64, 9000 Ghent - Belgium | |||
* | |||
* http://tarsos.0110.be/tag/TarsosDSP | |||
* https://github.com/JorenSix/TarsosDSP | |||
* http://tarsos.0110.be/releases/TarsosDSP/ | |||
* | |||
*/ |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,26 @@ | |||
require 'rubygems' | |||
|
|||
source_files = Dir.glob(File.join("**", "*.java")) | |||
new_prefix = File.open("new_prefix.txt", "r").read | |||
old_prefix = File.open("old_prefix.txt", "r").read | |||
|
|||
|
|||
def starts_with?(string, prefix) | |||
prefix = prefix.to_s | |||
string[0, prefix.length] == prefix | |||
end | |||
|
|||
|
|||
source_files.each do |source_file| | |||
source_file_contents = File.open(source_file, "r").read | |||
if source_file_contents.start_with? old_prefix | |||
source_file_contents = source_file_contents.gsub(old_prefix,"") | |||
end | |||
unless source_file_contents.start_with? new_prefix | |||
source_file_contents = new_prefix + "\n" + source_file_contents | |||
File.open( source_file, 'w' ) { | file | file.puts source_file_contents } | |||
end | |||
end | |||
|
|||
puts source_files | |||
puts new_prefix |