Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Output status messages when checking out and updating

  • Loading branch information...
commit f24e9cac104f74661b01fb9175cda8efa0cf3022 1 parent 34cbc7f
Joe Ferris jferris authored
Showing with 18 additions and 2 deletions.
  1. +13 −1 features/sync_gemfile.feature
  2. +5 −1 lib/trout/managed_file.rb
14 features/sync_gemfile.feature
View
@@ -16,6 +16,10 @@ Feature: sync a Gemfile between two repositories
And I run "git commit -m 'Added gemfile'"
And I cd to "../child_repo"
And I run "trout checkout Gemfile ../upstream_repo"
+ Then the output should contain:
+ """
+ Checked out Gemfile from ../upstream_repo.
+ """
And I run "cat Gemfile"
Then the output should contain:
"""
@@ -39,7 +43,11 @@ Feature: sync a Gemfile between two repositories
gem "redcloth"
"""
When I run "trout update Gemfile"
- And I run "cat Gemfile"
+ Then the output should contain:
+ """
+ Merged changes to Gemfile.
+ """
+ When I run "cat Gemfile"
Then the output should contain:
"""
source "http://rubygems.org"
@@ -59,6 +67,10 @@ Feature: sync a Gemfile between two repositories
gem "redcloth"
"""
When I run "trout update Gemfile"
+ Then the output should contain:
+ """
+ Gemfile already up to date.
+ """
And I run "cat Gemfile"
Then the output should contain:
"""
6 lib/trout/managed_file.rb
View
@@ -13,15 +13,19 @@ def copy_from(git_url)
checkout(git_url)
copy_to_destination
write_url_and_version
+ puts "Checked out #{filename} from #{git_url}."
ensure
cleanup
end
def update
checkout(previous_git_url)
- unless up_to_date?
+ if up_to_date?
+ puts "#{filename} already up to date."
+ else
merge_to_destination
write_url_and_version
+ puts "Merged changes to #{filename}."
end
ensure
cleanup
Please sign in to comment.
Something went wrong with that request. Please try again.