From 12244abb568d84efbf082007a0b51a09f1c2b93a Mon Sep 17 00:00:00 2001 From: Nicolas McCurdy Date: Sat, 4 Jan 2014 22:09:28 -0500 Subject: [PATCH] Fix a few more syntax-related rubocop issues manually --- lib/homesick.rb | 4 ++-- lib/homesick/actions.rb | 2 +- rubocop-todo.yml | 15 --------------- spec/homesick_spec.rb | 4 ++-- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/lib/homesick.rb b/lib/homesick.rb index 68bd9f1..a4fdc18 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -251,7 +251,7 @@ class Homesick < Thor desc 'open CASTLE', 'Open your default editor in the root of the given castle' def open(castle = DEFAULT_CASTLE_NAME) - if !ENV['EDITOR'] + unless ENV['EDITOR'] say_status :error, 'The $EDITOR environment variable must be set to use this command', :red exit(1) @@ -427,7 +427,7 @@ class Homesick < Thor home_path = home_dir.join(relative_dir).join(path) yield(absolute_path, home_path) - end + end end end diff --git a/lib/homesick/actions.rb b/lib/homesick/actions.rb index 2dc3488..bf20a9e 100644 --- a/lib/homesick/actions.rb +++ b/lib/homesick/actions.rb @@ -1,7 +1,7 @@ # -*- encoding : utf-8 -*- class Homesick module Actions - # TODO move this to be more like thor's template, empty_directory, etc + # TODO: move this to be more like thor's template, empty_directory, etc def git_clone(repo, config = {}) config ||= {} destination = config[:destination] || File.basename(repo, '.git') diff --git a/rubocop-todo.yml b/rubocop-todo.yml index f5174f3..7ecb968 100644 --- a/rubocop-todo.yml +++ b/rubocop-todo.yml @@ -2,15 +2,9 @@ # The point is for the user to remove these configuration records # one by one as the offences are removed from the code base. -BlockAlignment: - Enabled: false - ClassLength: Max: 350 -CommentAnnotation: - Enabled: false - CyclomaticComplexity: Max: 16 @@ -20,17 +14,8 @@ Documentation: Eval: Enabled: false -FavorUnlessOverNegatedIf: - Enabled: false - -IndentationWidth: - Enabled: false - LineLength: Max: 174 MethodLength: Max: 31 - -RegexpLiteral: - Enabled: false diff --git a/spec/homesick_spec.rb b/spec/homesick_spec.rb index 05e7626..6c68f16 100644 --- a/spec/homesick_spec.rb +++ b/spec/homesick_spec.rb @@ -584,7 +584,7 @@ describe 'homesick' do end it 'returns an error message when the given castle does not exist' do - homesick.should_receive('say_status').once.with(:error, /Could not cd castle_repo, expected \/tmp\/construct_container.* exist and contain dotfiles/, :red) + homesick.should_receive('say_status').once.with(:error, %r{Could not cd castle_repo, expected /tmp/construct_container.* exist and contain dotfiles}, :red) expect { homesick.cd 'castle_repo' }.to raise_error(SystemExit) end end @@ -607,7 +607,7 @@ describe 'homesick' do it 'returns an error message when the given castle does not exist' do ENV.stub(:[]).with('EDITOR').and_return('vim') # Set a default just in case none is set - homesick.should_receive('say_status').once.with(:error, /Could not open castle_repo, expected \/tmp\/construct_container.* exist and contain dotfiles/, :red) + homesick.should_receive('say_status').once.with(:error, %r{Could not open castle_repo, expected /tmp/construct_container.* exist and contain dotfiles}, :red) expect { homesick.open 'castle_repo' }.to raise_error(SystemExit) end end