Skip to content

Commit

Permalink
Fix lint warnings identified by RuboCop
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrictson committed Jan 23, 2016
1 parent 6084ffb commit 48ee87c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions lib/capistrano/configuration/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ def has_role?(role)
def select?(options)
options.each do |k,v|
callable = v.respond_to?(:call) ? v: ->(server){server.fetch(v)}
result = case k
when :filter, :select
callable.call(self)
when :exclude
!callable.call(self)
else
self.fetch(k) == v
end
result = \
case k
when :filter, :select
callable.call(self)
when :exclude
!callable.call(self)
else
self.fetch(k) == v
end
return false unless result
end
return true
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/capistrano/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def flags(*sets)

def command_line(*options)
options.each { |opt| ARGV << opt }
def subject.exit(*_args)
subject.define_singleton_method(:exit) do |*_args|
throw(:system_exit, :exit)
end
subject.run
Expand Down

0 comments on commit 48ee87c

Please sign in to comment.