Fix a few more syntax-related rubocop issues manually
This commit is contained in:
@@ -251,7 +251,7 @@ class Homesick < Thor
|
|||||||
|
|
||||||
desc 'open CASTLE', 'Open your default editor in the root of the given castle'
|
desc 'open CASTLE', 'Open your default editor in the root of the given castle'
|
||||||
def open(castle = DEFAULT_CASTLE_NAME)
|
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
|
say_status :error, 'The $EDITOR environment variable must be set to use this command', :red
|
||||||
|
|
||||||
exit(1)
|
exit(1)
|
||||||
@@ -427,7 +427,7 @@ class Homesick < Thor
|
|||||||
home_path = home_dir.join(relative_dir).join(path)
|
home_path = home_dir.join(relative_dir).join(path)
|
||||||
|
|
||||||
yield(absolute_path, home_path)
|
yield(absolute_path, home_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
class Homesick
|
class Homesick
|
||||||
module Actions
|
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 = {})
|
def git_clone(repo, config = {})
|
||||||
config ||= {}
|
config ||= {}
|
||||||
destination = config[:destination] || File.basename(repo, '.git')
|
destination = config[:destination] || File.basename(repo, '.git')
|
||||||
|
|||||||
@@ -2,15 +2,9 @@
|
|||||||
# The point is for the user to remove these configuration records
|
# The point is for the user to remove these configuration records
|
||||||
# one by one as the offences are removed from the code base.
|
# one by one as the offences are removed from the code base.
|
||||||
|
|
||||||
BlockAlignment:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
ClassLength:
|
ClassLength:
|
||||||
Max: 350
|
Max: 350
|
||||||
|
|
||||||
CommentAnnotation:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
CyclomaticComplexity:
|
CyclomaticComplexity:
|
||||||
Max: 16
|
Max: 16
|
||||||
|
|
||||||
@@ -20,17 +14,8 @@ Documentation:
|
|||||||
Eval:
|
Eval:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
FavorUnlessOverNegatedIf:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
IndentationWidth:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
LineLength:
|
LineLength:
|
||||||
Max: 174
|
Max: 174
|
||||||
|
|
||||||
MethodLength:
|
MethodLength:
|
||||||
Max: 31
|
Max: 31
|
||||||
|
|
||||||
RegexpLiteral:
|
|
||||||
Enabled: false
|
|
||||||
|
|||||||
@@ -584,7 +584,7 @@ describe 'homesick' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'returns an error message when the given castle does not exist' do
|
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)
|
expect { homesick.cd 'castle_repo' }.to raise_error(SystemExit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -607,7 +607,7 @@ describe 'homesick' do
|
|||||||
|
|
||||||
it 'returns an error message when the given castle does not exist' 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
|
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)
|
expect { homesick.open 'castle_repo' }.to raise_error(SystemExit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user