Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow to customize username in revision log via local_user variable #1031

Merged
merged 1 commit into from

4 participants

@sauliusgrigaitis

I believe it's too edge case to add one more default variable, but this looks like nice solution for #1030

@mikegee

Looks good to me. What is the next step to get this merged?

@leehambley
Owner

Just some testing on my side, next time I work on Cap will be 11.05.2014.

@rwestergren

What's the ETA on merging this in?

@sauliusgrigaitis

I know maintainers are busy, but it's almost tree months... @leehambley , looks like peeps are interested in this feature, so probably makes sense to merge it?

@leehambley
Owner

Dammit, use your Gemfile, and refer it to a fork, or step up and take an active role in maintainership. I do this work for free, I plan, build, direct, and design this software and ask for nothing in return. I will get to it as fast as I can.

You may only be interested in this "small fix" but I currently have 57 issues, and 22 open pull requests to get through, test, evaluate, get feedback on, and try and get into the tool without breaking anything for the hundreds of thousands of people who use Capistrano.

I don't ask for anything, but a little patience, c'mon guys.

@leehambley leehambley merged commit 6a77aca into capistrano:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  CHANGELOG.md
@@ -10,6 +10,7 @@ https://github.com/capistrano/capistrano/compare/v3.2.1...HEAD
* Fixed compatibility with FreeBSD tar (@robbertkl)
* Minor Changes
+ * Capistrano now allows to customize `local_user` for revision log. (@sauliusgrigaitis)
* Added tests for after/before hooks features (@juanibiapina, @miry)
* Improved the output of `cap --help`. (@mbrictson)
* Cucumber suite now runs on the latest version of Vagrant (@tpett)
View
2  lib/capistrano/defaults.rb
@@ -10,3 +10,5 @@
set :log_level, :debug
set :pty, false
+
+set :local_user, -> { Etc.getlogin }
View
2  lib/capistrano/dsl.rb
@@ -42,7 +42,7 @@ def rollback_log_message
end
def local_user
- Etc.getlogin
+ fetch(:local_user)
end
def lock(locked_version)
View
30 spec/integration/dsl_spec.rb
@@ -488,4 +488,34 @@
end
end
end
+
+ describe 'local_user' do
+ before do
+ dsl.set :local_user, -> { Etc.getlogin }
+ end
+
+ describe 'fetching local_user' do
+ subject { dsl.local_user }
+
+ context 'where a local_user is not set' do
+ before do
+ Etc.expects(:getlogin).returns('login')
+ end
+
+ it 'returns the login name' do
+ expect(subject.to_s).to eq 'login'
+ end
+ end
+
+ context 'where a local_user is set' do
+ before do
+ dsl.set(:local_user, -> { 'custom login' })
+ end
+
+ it 'returns the custom name' do
+ expect(subject.to_s).to eq 'custom login'
+ end
+ end
+ end
+ end
end
View
11 spec/lib/capistrano/dsl_spec.rb
@@ -48,16 +48,5 @@ class DummyDSL
dsl.sudo(:my, :command)
end
end
-
- describe '#local_user' do
-
- before do
- Etc.expects(:getlogin)
- end
-
- it 'delegates to Etc#getlogin' do
- dsl.local_user
- end
- end
end
end
Something went wrong with that request. Please try again.