Skip to content
Browse files

backout changes for sinatra

  • Loading branch information...
1 parent e6531a8 commit 571d031bea01773e2c5984bece686b9916bffdd7 Sarah Zelechoski committed
Showing with 6 additions and 24 deletions.
  1. +2 −10 lib/capistrano/git/notifier.rb
  2. +4 −14 lib/capistrano/git/release_notes.rb
View
12 lib/capistrano/git/notifier.rb
@@ -21,14 +21,6 @@ def tag_format(options = {})
tag_format
end
- def app_root
- if rails_root.nil?
- return settings.root
- else
- return rails_root
- end
- end
-
user = `git config --get user.name`
email = `git config --get user.email`
deployer = "#{user} (#{email})"
@@ -53,7 +45,7 @@ def app_root
room.speak "#{branch_name} branch of #{application_name} to #{rails_env} "
room.speak "with `cap #{ARGV.join(' ')}` (#{compare_url})"
- release_notes = File.read(app_root + "/config/CHANGELOG").split(/\n/)
+ release_notes = File.read(rails_root + "/config/CHANGELOG").split(/\n/)
release_notes.each do |line|
room.speak "#{line}"
end
@@ -70,7 +62,7 @@ def app_root
deploying = tags[0]
compare_url = "http://github.com/#{source_repo}/compare/#{deployed}...#{deploying}"
- release_notes = File.read(app_root + "/config/CHANGELOG")
+ release_notes = File.read(rails_root + "/config/CHANGELOG")
body = ""
body << "----------------------------------------------------------------\n"
body << "Version: #{deployed_version.strip}\n"
View
18 lib/capistrano/git/release_notes.rb
@@ -20,19 +20,9 @@ def tag_format(options = {})
tag_format = tag_format.gsub(":release", options[:release] || "")
tag_format
end
-
- def app_root
- if rails_root.nil?
- return settings.root
- else
- return rails_root
- end
- end
desc "Ask deploy user if release notes have been updated and build VERSION file"
task :build do
-
-
user = `git config --get user.name`
email = `git config --get user.email`
@@ -46,9 +36,9 @@ def app_root
response = Capistrano::CLI.ui.ask("Have you updated the release notes in config/CHANGELOG?")
if response =~ /y(es)?/i
- release_notes = File.read(app_root + "/config/CHANGELOG")
+ release_notes = File.read(rails_root + "/config/CHANGELOG")
if release_notes != ""
- Tempfile.open File.basename(app_root + "/public/tmp") do |tempfile|
+ Tempfile.open File.basename(rails_root + "/public/tmp") do |tempfile|
# prepend data to tempfile
tempfile << "----------------------------------------------------------------\n"
tempfile << "Version: #{deployed_version.strip}\n"
@@ -59,7 +49,7 @@ def app_root
tempfile << release_notes.gsub(/^ */, ' ' * 4)
tempfile << "\n----------------------------------------------------------------\n\n"
- File.open(app_root + "/public/VERSION", File::RDWR|File::CREAT) do |file|
+ File.open(rails_root + "/public/VERSION", File::RDWR|File::CREAT) do |file|
# append original data to tempfile
tempfile << file.read
# reset file positions
@@ -78,7 +68,7 @@ def app_root
desc "Empty changelog for next deploy"
task :empty_changelog do
- File.open(app_root + "/config/CHANGELOG",'w') {|file| file << ""}
+ File.open(rails_root + "/config/CHANGELOG",'w') {|file| file << ""}
end
desc "Push git revision with new VERSION file"

0 comments on commit 571d031

Please sign in to comment.
Something went wrong with that request. Please try again.