capistrano 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59f8fb6442e27e32704d86292e1e22a6c67daa61
4
- data.tar.gz: 7ecf7b387a1c3cbf2c0bc2685e3ec6b6a1336d9b
3
+ metadata.gz: 89a96214d20583f07f6f4094f94235893bec7ee1
4
+ data.tar.gz: 5744a684bea5aa5d11a400fb90159495e685c28f
5
5
  SHA512:
6
- metadata.gz: 4a03a957b09b8b2c28f29e8f3bb81f099fdaca0f4cec6d1741591a82a24617e36416c3e8aa2ba3ff29ae6b9cb612162d8e13bb32bfb04f816fe86736aed5ca12
7
- data.tar.gz: 383b341deed499908407ade22a77432bef14797a70247c5e1fc48b19103cd20e3fe4ba5b23256b5b8155ae754b4e5626cd20b2a6aa09a4bab98faffa7358872a
6
+ metadata.gz: e23596ce8fd844d9292f92a4fc7c6a97feceb85ecdfce82eb6462822ffe456929a693b4fdfeb2261258a7b8dffd65960c69e3688e4a433021e5db4e1062588a2
7
+ data.tar.gz: efc1d484e301975405fd1f7c3081ba0d2850e2dd8a64bcfbfc10b9f0b1dcbf1fea1e6e2e1cb07905327f984647c12ba798ad821198344fe9d30f8d1c291eeada
@@ -6,7 +6,21 @@ Reverse Chronological Order:
6
6
 
7
7
  https://github.com/capistrano/capistrano/compare/v3.2.0...HEAD
8
8
 
9
- ## `3.2.0``
9
+ ## `3.2.1`
10
+
11
+ * Bug Fixes:
12
+ * 3.2.0 introduced some behaviour to modify the way before/after hooks were called, to allow the optional
13
+ preservation of arguments to be passed to tasks. This release reverts that commit in order to restore
14
+ original functionality, and fix (fairly serious) bugs introduced by the refactoring.
15
+
16
+ * Minor changes:
17
+ * Update dsl#local_user method and add test for it. (@bruno-)
18
+ * Revert short sha1 revision with git. (@blaugueux)
19
+ * Changed asking question to more standard format (like common unix commandline tools) (@sponomarev)
20
+ * Fixed typos in the README. (@sponomarev)
21
+ * Added `keys` method to Configuration to allow introspection of configuration options. (@juanibiapina)
22
+
23
+ ## `3.2.0`
10
24
 
11
25
  The changelog entries here are incomplete, because many authors choose not to
12
26
  be credited for their work, check the tag comparison link for Github.
data/README.md CHANGED
@@ -17,7 +17,7 @@ Get <a href="http://codersclan.net/?repo_id=325&source=link">Capistrano support
17
17
  Add this line to your application's Gemfile:
18
18
 
19
19
  ``` ruby
20
- gem 'capistrano', '~> 3.1.0'
20
+ gem 'capistrano', '~> 3.2.0'
21
21
  ```
22
22
 
23
23
  And then execute:
@@ -156,10 +156,10 @@ Perfect, who needs telephones.
156
156
 
157
157
  ## Using password authentication
158
158
 
159
- Password authentication can be done via `set` and `ask` in your deploy environment file (e.g.: config/environments/production.rb)
159
+ Password authentication can be done via `set` and `ask` in your deploy environment file (e.g.: config/deploy/production.rb)
160
160
 
161
161
  ```ruby
162
- set :password, ask('Server password:', nil)
162
+ set :password, ask('Server password', nil)
163
163
  server 'server.domain.com', user: 'ssh_user_name', port: 22, password: fetch(:password), roles: %w{web app db}
164
164
  ```
165
165
 
@@ -36,6 +36,10 @@ module Capistrano
36
36
  return value
37
37
  end
38
38
 
39
+ def keys
40
+ config.keys
41
+ end
42
+
39
43
  def role(name, hosts, options={})
40
44
  if name == :all
41
45
  raise ArgumentError.new("#{name} reserved name for role. Please choose another name")
@@ -15,7 +15,7 @@ module Capistrano
15
15
  attr_reader :env, :key, :default
16
16
 
17
17
  def ask_question
18
- $stdout.puts question
18
+ $stdout.print question
19
19
  end
20
20
 
21
21
  def save_response
@@ -1,3 +1,4 @@
1
+ require 'etc'
1
2
  require 'capistrano/dsl/task_enhancements'
2
3
  require 'capistrano/dsl/paths'
3
4
  require 'capistrano/dsl/stages'
@@ -41,7 +42,7 @@ module Capistrano
41
42
  end
42
43
 
43
44
  def local_user
44
- `whoami`
45
+ Etc.getlogin
45
46
  end
46
47
 
47
48
  def lock(locked_version)
@@ -44,12 +44,7 @@ module Capistrano
44
44
  end
45
45
 
46
46
  def release_roles(*names)
47
- options = { exclude: :no_release }
48
- if names.last.is_a? Hash
49
- names.last.merge(options)
50
- else
51
- names << options
52
- end
47
+ names << { exclude: :no_release } unless names.last.is_a? Hash
53
48
  roles(*names)
54
49
  end
55
50
 
@@ -2,16 +2,14 @@ module Capistrano
2
2
  module TaskEnhancements
3
3
  def before(task, prerequisite, *args, &block)
4
4
  prerequisite = Rake::Task.define_task(prerequisite, *args, &block) if block_given?
5
- Rake::Task[task].enhance do
6
- Rake::Task[prerequisite].invoke(*args)
7
- end
5
+ Rake::Task[task].enhance [prerequisite]
8
6
  end
9
7
 
10
8
  def after(task, post_task, *args, &block)
11
9
  Rake::Task.define_task(post_task, *args, &block) if block_given?
12
10
  post_task = Rake::Task[post_task]
13
11
  Rake::Task[task].enhance do
14
- post_task.invoke(args)
12
+ post_task.invoke
15
13
  end
16
14
  end
17
15
 
@@ -34,7 +34,7 @@ class Capistrano::Git < Capistrano::SCM
34
34
  end
35
35
 
36
36
  def fetch_revision
37
- context.capture(:git, "rev-parse #{fetch(:branch)}")
37
+ context.capture(:git, "rev-parse --short #{fetch(:branch)}")
38
38
  end
39
39
  end
40
40
  end
@@ -3,7 +3,6 @@ require 'i18n'
3
3
  en = {
4
4
  starting: 'Starting',
5
5
  capified: 'Capified',
6
- starting: 'Starting',
7
6
  start: 'Start',
8
7
  update: 'Update',
9
8
  finalize: 'Finalise',
@@ -11,12 +10,12 @@ en = {
11
10
  finished: 'Finished',
12
11
  stage_not_set: 'Stage not set, please call something such as `cap production deploy`, where production is a stage you have defined.',
13
12
  written_file: 'create %{file}',
14
- question: 'Please enter %{key}: |%{default_value}|',
13
+ question: 'Please enter %{key} (%{default_value}): ',
15
14
  keeping_releases: 'Keeping %{keep_releases} of %{releases} deployed releases on %{host}',
16
15
  no_old_releases: 'No old releases (keeping newest %{keep_releases}) on %{host}',
17
16
  linked_file_does_not_exist: 'linked file %{file} does not exist on %{host}',
18
17
  cannot_rollback: 'There are no older releases to rollback to',
19
- mirror_exists: "The repository mirror is at %{at}",
18
+ mirror_exists: 'The repository mirror is at %{at}',
20
19
  revision_log_message: 'Branch %{branch} (at %{sha}) deployed as release %{release} by %{user}',
21
20
  rollback_log_message: '%{user} rolled back to release %{release}',
22
21
  deploy_failed: 'The deploy has failed with an error: %{ex}',
@@ -1,3 +1,3 @@
1
1
  module Capistrano
2
- VERSION = "3.2.0"
2
+ VERSION = "3.2.1"
3
3
  end
@@ -283,7 +283,7 @@ describe Capistrano::DSL do
283
283
  describe 'asking for a variable' do
284
284
  before do
285
285
  dsl.ask(:scm, :svn)
286
- $stdout.stubs(:puts)
286
+ $stdout.stubs(:print)
287
287
  end
288
288
 
289
289
  context 'variable is provided' do
@@ -23,7 +23,7 @@ module Capistrano
23
23
  let(:branch) { 'branch' }
24
24
 
25
25
  before do
26
- $stdout.expects(:puts).with('Please enter branch: |default|')
26
+ $stdout.expects(:print).with('Please enter branch (default): ')
27
27
  $stdin.expects(:gets).returns(branch)
28
28
  end
29
29
 
@@ -37,7 +37,7 @@ module Capistrano
37
37
  let(:branch) { default }
38
38
 
39
39
  before do
40
- $stdout.expects(:puts).with('Please enter branch: |default|')
40
+ $stdout.expects(:print).with('Please enter branch (default): ')
41
41
  $stdin.expects(:gets).returns('')
42
42
  end
43
43
 
@@ -112,6 +112,19 @@ module Capistrano
112
112
  end
113
113
  end
114
114
 
115
+ describe 'keys' do
116
+ subject { config.keys }
117
+
118
+ before do
119
+ config.set(:key1, :value1)
120
+ config.set(:key2, :value2)
121
+ end
122
+
123
+ it 'returns all set keys' do
124
+ expect(subject).to match_array [:key1, :key2]
125
+ end
126
+ end
127
+
115
128
  describe 'deleting' do
116
129
  before do
117
130
  config.set(:key, :value)
@@ -48,5 +48,16 @@ module Capistrano
48
48
  dsl.sudo(:my, :command)
49
49
  end
50
50
  end
51
+
52
+ describe '#local_user' do
53
+
54
+ before do
55
+ Etc.expects(:getlogin)
56
+ end
57
+
58
+ it 'delegates to Etc#getlogin' do
59
+ dsl.local_user
60
+ end
61
+ end
51
62
  end
52
63
  end
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.2.0
4
+ version: 3.2.1
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: 2014-04-15 00:00:00.000000000 Z
12
+ date: 2014-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sshkit