From 5f8e7c2cc98a6288f9f85a2f5e8d2159a7f3bee4 Mon Sep 17 00:00:00 2001 From: William Johnston Date: Tue, 1 Mar 2016 09:36:05 -0600 Subject: [PATCH 1/3] Enable SpecialGlobalVars cop --- .rubocop.yml | 2 -- capistrano.gemspec | 2 +- features/support/vagrant_helpers.rb | 2 +- spec/support/test_app.rb | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 6e1f8d25..764f5944 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -61,8 +61,6 @@ Style/WhileUntilModifier: Enabled: false Style/RescueModifier: Enabled: false -Style/SpecialGlobalVars: - Enabled: false Style/ModuleFunction: Enabled: false Style/DotPosition: diff --git a/capistrano.gemspec b/capistrano.gemspec index cda85487..4ac404d0 100644 --- a/capistrano.gemspec +++ b/capistrano.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |gem| gem.summary = "Capistrano - Welcome to easy deployment with Ruby over SSH" gem.homepage = "http://capistranorb.com/" - gem.files = `git ls-files`.split($/) + gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) gem.executables = %w(cap capify) gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] diff --git a/features/support/vagrant_helpers.rb b/features/support/vagrant_helpers.rb index f2474c17..c9f276f6 100644 --- a/features/support/vagrant_helpers.rb +++ b/features/support/vagrant_helpers.rb @@ -19,7 +19,7 @@ module VagrantHelpers puts "[vagrant] #{line}" end end - $? + $CHILD_STATUS end def run_vagrant_command(command) diff --git a/spec/support/test_app.rb b/spec/support/test_app.rb index 894c0893..0770825c 100644 --- a/spec/support/test_app.rb +++ b/spec/support/test_app.rb @@ -91,7 +91,7 @@ module TestApp Dir.chdir(test_app_path) do output = %x[#{command}] end - [$?.success?, output] + [$CHILD_STATUS.success?, output] end def stage From a22b5865fb4a9a6c4f5fbf56c955f19638e9a36e Mon Sep 17 00:00:00 2001 From: William Johnston Date: Tue, 1 Mar 2016 09:51:47 -0600 Subject: [PATCH 2/3] Add english require to affected files. --- capistrano.gemspec | 2 ++ features/support/vagrant_helpers.rb | 2 ++ spec/support/test_app.rb | 1 + 3 files changed, 5 insertions(+) diff --git a/capistrano.gemspec b/capistrano.gemspec index 4ac404d0..a46feb32 100644 --- a/capistrano.gemspec +++ b/capistrano.gemspec @@ -3,6 +3,8 @@ lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "capistrano/version" +require "English" + Gem::Specification.new do |gem| gem.name = "capistrano" gem.version = Capistrano::VERSION diff --git a/features/support/vagrant_helpers.rb b/features/support/vagrant_helpers.rb index c9f276f6..9a30d116 100644 --- a/features/support/vagrant_helpers.rb +++ b/features/support/vagrant_helpers.rb @@ -1,3 +1,5 @@ +require "English" + module VagrantHelpers extend self diff --git a/spec/support/test_app.rb b/spec/support/test_app.rb index 0770825c..6af53815 100644 --- a/spec/support/test_app.rb +++ b/spec/support/test_app.rb @@ -1,3 +1,4 @@ +require "English" require "fileutils" require "pathname" From 3f664fc72e74cafd54663489fa818b95ccb0448b Mon Sep 17 00:00:00 2001 From: William Johnston Date: Tue, 1 Mar 2016 09:53:17 -0600 Subject: [PATCH 3/3] Modify gemspec for safer, non-English option. --- capistrano.gemspec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/capistrano.gemspec b/capistrano.gemspec index a46feb32..9491348b 100644 --- a/capistrano.gemspec +++ b/capistrano.gemspec @@ -3,8 +3,6 @@ lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "capistrano/version" -require "English" - Gem::Specification.new do |gem| gem.name = "capistrano" gem.version = Capistrano::VERSION @@ -14,7 +12,7 @@ Gem::Specification.new do |gem| gem.summary = "Capistrano - Welcome to easy deployment with Ruby over SSH" gem.homepage = "http://capistranorb.com/" - gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) + gem.files = `git ls-files -z`.split("\x0") gem.executables = %w(cap capify) gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"]