capistrano 3.13.0 → 3.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -2
- data/README.md +1 -1
- data/lib/capistrano/configuration/question.rb +9 -1
- data/lib/capistrano/i18n.rb +2 -0
- data/lib/capistrano/version.rb +1 -1
- data/spec/lib/capistrano/configuration/question_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05d4d15902188667bafc9bbaa729506f5648ffb2adcd1f5705739977dd971db1
|
4
|
+
data.tar.gz: f75c361ed0aa048cce3d18870e089e7d73861b2f43caf05aa4282d009e06e199
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 287936297e0003a7deb6e56e822355a65d1d2b12dfa141a957de6cf4aeaf818220d7ab3f1fe55c3e9c381c58ef72f1837ba49b8f0637637af62373d0fa3f3e72
|
7
|
+
data.tar.gz: '08dadc7a9ae58638b5618203a6577de5f9cdab92c8f062977ea5758a915dcbd53d050a779373fde0d66a9173be58140f05ea03bda6ff20dc9c42c49ccab9e95d'
|
data/Gemfile
CHANGED
@@ -26,11 +26,16 @@ if Gem::Requirement.new("< 2.1").satisfied_by?(Gem::Version.new(RUBY_VERSION))
|
|
26
26
|
gem "public_suffix", "< 3.0.0"
|
27
27
|
end
|
28
28
|
|
29
|
-
# Latest versions of i18n don't support Ruby < 2.
|
30
|
-
if Gem::Requirement.new("< 2.
|
29
|
+
# Latest versions of i18n don't support Ruby < 2.4
|
30
|
+
if Gem::Requirement.new("< 2.4").satisfied_by?(Gem::Version.new(RUBY_VERSION))
|
31
31
|
gem "i18n", "< 1.3.0"
|
32
32
|
end
|
33
33
|
|
34
|
+
# Latest versions of rake don't support Ruby < 2.2
|
35
|
+
if Gem::Requirement.new("< 2.2").satisfied_by?(Gem::Version.new(RUBY_VERSION))
|
36
|
+
gem "rake", "< 13.0.0"
|
37
|
+
end
|
38
|
+
|
34
39
|
# We only run danger once on a new-ish ruby; no need to install it otherwise
|
35
40
|
if Gem::Requirement.new("> 2.4").satisfied_by?(Gem::Version.new(RUBY_VERSION))
|
36
41
|
gem "danger"
|
data/README.md
CHANGED
@@ -49,7 +49,11 @@ module Capistrano
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def question
|
52
|
-
if default.nil?
|
52
|
+
if prompt && default.nil?
|
53
|
+
I18n.t(:question_prompt, key: prompt, scope: :capistrano)
|
54
|
+
elsif prompt
|
55
|
+
I18n.t(:question_prompt_default, key: prompt, default_value: default, scope: :capistrano)
|
56
|
+
elsif default.nil?
|
53
57
|
I18n.t(:question, key: key, scope: :capistrano)
|
54
58
|
else
|
55
59
|
I18n.t(:question_default, key: key, default_value: default, scope: :capistrano)
|
@@ -63,6 +67,10 @@ module Capistrano
|
|
63
67
|
def stdin
|
64
68
|
(options || {}).fetch(:stdin, $stdin)
|
65
69
|
end
|
70
|
+
|
71
|
+
def prompt
|
72
|
+
(options || {}).fetch(:prompt, nil)
|
73
|
+
end
|
66
74
|
end
|
67
75
|
end
|
68
76
|
end
|
data/lib/capistrano/i18n.rb
CHANGED
@@ -12,6 +12,8 @@ en = {
|
|
12
12
|
written_file: "create %{file}",
|
13
13
|
question: "Please enter %{key}: ",
|
14
14
|
question_default: "Please enter %{key} (%{default_value}): ",
|
15
|
+
question_prompt: "%{key}: ",
|
16
|
+
question_prompt_default: "%{key} (%{default_value}): ",
|
15
17
|
keeping_releases: "Keeping %{keep_releases} of %{releases} deployed releases on %{host}",
|
16
18
|
skip_cleanup: "Skipping cleanup of invalid releases on %{host}; unexpected foldername found (should be timestamp)",
|
17
19
|
wont_delete_current_release: "Current release was marked for being removed but it's going to be skipped on %{host}",
|
data/lib/capistrano/version.rb
CHANGED
@@ -6,6 +6,8 @@ module Capistrano
|
|
6
6
|
let(:question) { Question.new(key, default, stdin: stdin) }
|
7
7
|
let(:question_without_echo) { Question.new(key, default, echo: false, stdin: stdin) }
|
8
8
|
let(:question_without_default) { Question.new(key, nil, stdin: stdin) }
|
9
|
+
let(:question_prompt) { Question.new(key, default, stdin: stdin, prompt: "Your favorite branch") }
|
10
|
+
let(:question_prompt_without_default) { Question.new(key, nil, stdin: stdin, prompt: "Your favorite branch") }
|
9
11
|
let(:default) { :default }
|
10
12
|
let(:key) { :branch }
|
11
13
|
let(:stdin) { stub(tty?: true) }
|
@@ -43,6 +45,22 @@ module Capistrano
|
|
43
45
|
|
44
46
|
expect(question_without_default.call).to eq(branch)
|
45
47
|
end
|
48
|
+
|
49
|
+
it "uses prompt and returns the value" do
|
50
|
+
$stdout.expects(:print).with("Your favorite branch (default): ")
|
51
|
+
stdin.expects(:gets).returns(branch)
|
52
|
+
stdin.expects(:noecho).never
|
53
|
+
|
54
|
+
expect(question_prompt.call).to eq(branch)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "uses prompt and returns the value but has no default between parenthesis" do
|
58
|
+
$stdout.expects(:print).with("Your favorite branch: ")
|
59
|
+
stdin.expects(:gets).returns(branch)
|
60
|
+
stdin.expects(:noecho).never
|
61
|
+
|
62
|
+
expect(question_prompt_without_default.call).to eq(branch)
|
63
|
+
end
|
46
64
|
end
|
47
65
|
|
48
66
|
context "value is not entered" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Clements
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-05-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: airbrussh
|