Hello community,
here is the log from the commit of package rubygem-capistrano for
openSUSE:Factory checked in at 2016-09-12 13:26:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-capistrano (Old)
and /work/SRC/openSUSE:Factory/.rubygem-capistrano.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-capistrano"
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-capistrano/rubygem-capistrano.changes
2016-08-25 09:55:48.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-capistrano.new/rubygem-capistrano.changes
2016-09-12 13:26:44.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Aug 24 04:30:43 UTC 2016 - [email protected]
+
+- updated to version 3.6.1
+ see installed CHANGELOG.md
+
+-------------------------------------------------------------------
Old:
----
capistrano-3.6.0.gem
New:
----
capistrano-3.6.1.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-capistrano.spec ++++++
--- /var/tmp/diff_new_pack.Qq8PYx/_old 2016-09-12 13:26:46.000000000 +0200
+++ /var/tmp/diff_new_pack.Qq8PYx/_new 2016-09-12 13:26:46.000000000 +0200
@@ -24,7 +24,7 @@
#
Name: rubygem-capistrano
-Version: 3.6.0
+Version: 3.6.1
Release: 0
%define mod_name capistrano
%define mod_full_name %{mod_name}-%{version}
++++++ capistrano-3.6.0.gem -> capistrano-3.6.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2016-07-27 01:48:46.000000000 +0200
+++ new/CHANGELOG.md 2016-08-24 02:41:57.000000000 +0200
@@ -4,10 +4,20 @@
## master
-https://github.com/capistrano/capistrano/compare/v3.6.0...HEAD
+https://github.com/capistrano/capistrano/compare/v3.6.1...HEAD
* Your contribution here!
+## `3.6.1` (2016-08-23)
+
+https://github.com/capistrano/capistrano/compare/v3.6.0...v3.6.1
+
+### Fixes:
+
+* Restore compatibility with older versions of Rake (< 11.0.0) (@troelskn)
+* Fix `NoMethodError: undefined method gsub` when setting `:application` to a
Proc. The original fix released in 3.6.0 worked for values specified with
blocks, but not for those specified with procs or lambdas (the latter syntax is
much more common). [#1681](https://github.com/capistrano/capistrano/issues/1681)
+* Fix a bug where deploy would fail if `:local_user` contained a space; spaces
are now replaced with dashes when computing the git-ssh suffix. (@will_in_wi)
+
## `3.6.0` (2016-07-26)
https://github.com/capistrano/capistrano/compare/v3.5.0...v3.6.0
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/capistrano/configuration/validated_variables.rb
new/lib/capistrano/configuration/validated_variables.rb
--- old/lib/capistrano/configuration/validated_variables.rb 2016-07-27
01:48:46.000000000 +0200
+++ new/lib/capistrano/configuration/validated_variables.rb 2016-08-24
02:41:57.000000000 +0200
@@ -7,9 +7,9 @@
# user-supplied validation rules. Each rule for a given key is invoked
# immediately whenever `set` is called with a value for that key.
#
- # If `set` is called with a block, validation is not performed immediately.
- # Instead, the validation rules are invoked the first time `fetch` is used
- # to access the value.
+ # If `set` is called with a callable value or a block, validation is not
+ # performed immediately. Instead, the validation rules are invoked the
first
+ # time `fetch` is used to access the value.
#
# A rule is simply a block that accepts two arguments: key and value. It is
# up to the rule to raise an exception when it deems the value is invalid
@@ -31,10 +31,17 @@
# Decorate Variables#set to add validation behavior.
def set(key, value=nil, &block)
- if value.nil? && callable_without_parameters?(block)
- super(key, nil, &assert_valid_later(key, &block))
+ assert_value_or_block_not_both(value, block)
+
+ # Skip validation behavior if no validators are registered for this key
+ return super unless validators.key?(key)
+
+ value_to_evaluate = block || value
+
+ if callable_without_parameters?(value_to_evaluate)
+ super(key, assert_valid_later(key, value_to_evaluate), &nil)
else
- assert_valid_now(key, block || value)
+ assert_valid_now(key, value_to_evaluate)
super
end
end
@@ -50,26 +57,55 @@
attr_reader :validators
- # Wrap a block with a proc that validates the value of the block. This
- # allows us to defer validation until the time the value is requested.
- def assert_valid_later(key)
- lambda do
- value = yield
+ # Given a callable that provides a value, wrap the callable with another
+ # object that responds to `call`. This new object will perform validation
+ # and then return the original callable's value.
+ #
+ # If the callable is a `Question`, the object returned by this method
will
+ # also be a `Question` (a `ValidatedQuestion`, to be precise). This
+ # ensures that `is_a?(Question)` remains true even after the validation
+ # wrapper is applied. This is needed so that `Configuration#is_question?`
+ # works as expected.
+ #
+ def assert_valid_later(key, callable)
+ validation_callback = lambda do
+ value = callable.call
assert_valid_now(key, value)
value
end
+
+ if callable.is_a?(Question)
+ ValidatedQuestion.new(validation_callback)
+ else
+ validation_callback
+ end
end
# Runs all validation rules registered for the given key against the
# user-supplied value for that variable. If no validator raises an
# exception, the value is assumed to be valid.
def assert_valid_now(key, value)
- return unless validators.key?(key)
-
validators[key].each do |validator|
validator.call(key, value)
end
end
+
+ def assert_value_or_block_not_both(value, block)
+ unless value.nil? || block.nil?
+ raise Capistrano::ValidationError,
+ "Value and block both passed to Configuration#set"
+ end
+ end
+
+ class ValidatedQuestion < Question
+ def initialize(validator)
+ @validator = validator
+ end
+
+ def call
+ @validator.call
+ end
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/capistrano/configuration/variables.rb
new/lib/capistrano/configuration/variables.rb
--- old/lib/capistrano/configuration/variables.rb 2016-07-27
01:48:46.000000000 +0200
+++ new/lib/capistrano/configuration/variables.rb 2016-08-24
02:41:57.000000000 +0200
@@ -35,7 +35,6 @@
end
def set(key, value=nil, &block)
- assert_value_or_block_not_both(value, block)
@trusted_keys << key if trusted?
remember_location(key)
values[key] = block || value
@@ -104,13 +103,6 @@
(locations[key] ||= []) << location
end
- def assert_value_or_block_not_both(value, block)
- unless value.nil? || block.nil?
- raise Capistrano::ValidationError,
- "Value and block both passed to Configuration#set"
- end
- end
-
def trace_set(key)
return unless fetch(:print_config_variables, false)
puts "Config variable set: #{key.inspect} => #{values[key].inspect}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/capistrano/dsl.rb new/lib/capistrano/dsl.rb
--- old/lib/capistrano/dsl.rb 2016-07-27 01:48:46.000000000 +0200
+++ new/lib/capistrano/dsl.rb 2016-08-24 02:41:57.000000000 +0200
@@ -13,7 +13,8 @@
def invoke(task_name, *args)
task = Rake::Task[task_name]
- if task && task.already_invoked
+ # NOTE: We access instance variable since the accessor was only added
recently. Once Capistrano depends on rake 11+, we can revert the following line
+ if task && task.instance_variable_get(:@already_invoked)
file, line, = caller.first.split(":")
colors = SSHKit::Color.new($stderr)
$stderr.puts colors.colorize("Skipping task `#{task_name}'.", :yellow)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/capistrano/tasks/git.rake
new/lib/capistrano/tasks/git.rake
--- old/lib/capistrano/tasks/git.rake 2016-07-27 01:48:46.000000000 +0200
+++ new/lib/capistrano/tasks/git.rake 2016-08-24 02:41:57.000000000 +0200
@@ -6,7 +6,7 @@
set :git_wrapper_path, lambda {
# Try to avoid permissions issues when multiple users deploy the same app
# by using different file names in the same dir for each deployer and
stage.
- suffix = [:application, :stage, :local_user].map { |key| fetch(key).to_s
}.join("-")
+ suffix = [:application, :stage, :local_user].map { |key| fetch(key).to_s
}.join("-").gsub(/\s+/, "-")
"#{fetch(:tmp_dir)}/git-ssh-#{suffix}.sh"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/capistrano/version.rb
new/lib/capistrano/version.rb
--- old/lib/capistrano/version.rb 2016-07-27 01:48:46.000000000 +0200
+++ new/lib/capistrano/version.rb 2016-08-24 02:41:57.000000000 +0200
@@ -1,3 +1,3 @@
module Capistrano
- VERSION = "3.6.0".freeze
+ VERSION = "3.6.1".freeze
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2016-07-27 01:48:46.000000000 +0200
+++ new/metadata 2016-08-24 02:41:57.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: capistrano
version: !ruby/object:Gem::Version
- version: 3.6.0
+ version: 3.6.1
platform: ruby
authors:
- Tom Clements
@@ -9,7 +9,7 @@
autorequire:
bindir: bin
cert_chain: []
-date: 2016-07-26 00:00:00.000000000 Z
+date: 2016-08-24 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: airbrussh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/lib/capistrano/configuration_spec.rb
new/spec/lib/capistrano/configuration_spec.rb
--- old/spec/lib/capistrano/configuration_spec.rb 2016-07-27
01:48:46.000000000 +0200
+++ new/spec/lib/capistrano/configuration_spec.rb 2016-08-24
02:41:57.000000000 +0200
@@ -154,19 +154,29 @@
config.set(:key, "longer_value")
end
- it "validates proc without error" do
+ it "validates block without error" do
config.set(:key) { "longer_value" }
expect(config.fetch(:key)).to eq "longer_value"
end
+ it "validates lambda without error" do
+ config.set :key, -> { "longer_value" }
+ expect(config.fetch(:key)).to eq "longer_value"
+ end
+
it "raises an exception on invalid string" do
expect { config.set(:key, "sho") }.to
raise_error(Capistrano::ValidationError)
end
- it "raises an exception on invalid string provided by proc" do
+ it "raises an exception on invalid string provided by block" do
config.set(:key) { "sho" }
expect { config.fetch(:key) }.to
raise_error(Capistrano::ValidationError)
end
+
+ it "raises an exception on invalid string provided by lambda" do
+ config.set :key, -> { "sho" }
+ expect { config.fetch(:key) }.to
raise_error(Capistrano::ValidationError)
+ end
end
context "appending" do