Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 642baaa
Showing
2 changed files
with
39 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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env ruby | ||
require 'liquid' | ||
require 'yaml' | ||
|
||
# Open the properties file | ||
properties_file = File.open "properties.yaml" | ||
properties_yaml = properties_file.read | ||
puts properties_yaml | ||
puts | ||
# Ask the user if the properties are correct | ||
puts "Are these properties correct?" | ||
reply = gets | ||
if reply[0] != "y" then | ||
puts "Aborting. Edit properties.yaml to make changes." | ||
exit | ||
end | ||
|
||
# Load the properties | ||
properties = YAML::load(properties_yaml) | ||
|
||
# process the files | ||
files = [ "pom.xml" ] | ||
files.each do |file| | ||
puts "Processing #{file}..." | ||
# read the file | ||
template = File.open(file, "r").read | ||
# process the file | ||
rendering = Liquid::Template.parse(template).render properties | ||
# write the file | ||
File.open(file, "w").write(rendering) | ||
end | ||
|
||
puts "Successful. Removing init.rb..." | ||
File.delete "init.rb" | ||
|
||
puts "Done!" |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
project : my-project | ||
description : ~ |