Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiculescu committed Jan 15, 2024
1 parent 3382430 commit cabf037
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ Style/HashTransformValues:

RSpec/ExampleLength:
Enabled: false

Gemspec/DevelopmentDependencies:
Enabled: false

Metrics/MethodLength:
Enabled: false
1 change: 1 addition & 0 deletions entangler.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
spec.add_dependency 'listen', '~> 3.7'
spec.add_dependency 'to_regexp', '~> 0.2.1'
spec.metadata['rubygems_mfa_required'] = 'true'
end
2 changes: 1 addition & 1 deletion lib/entangler/entangled_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def create_parent_directory

def write_contents
delete_file if file_exists? && File.directory?(full_path)
File.open(full_path, 'w') { |f| f.write(contents) }
File.write(full_path, contents)
File.utime(File.atime(full_path), desired_modtime, full_path)
end

Expand Down
8 changes: 4 additions & 4 deletions lib/entangler/executor/validation/master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ def validate_remote_entangler_version

res = `#{generate_ssh_command('entangler --version', source_rvm: true)}`
if res.empty?
msg = 'Entangler is not installed on the remote server.' \
' Install Entangler on the remote server (SSH in, then `gem install entangler`), then try again.'
msg = 'Entangler is not installed on the remote server. ' \
'Install Entangler on the remote server (SSH in, then `gem install entangler`), then try again.'
raise Entangler::NotInstalledOnRemoteError, msg
end

remote_version = Gem::Version.new(res.strip)
local_version = Gem::Version.new(Entangler::VERSION)
return unless major_version_mismatch?(local_version, remote_version)

msg = 'Entangler version too far apart, please update either local or remote Entangler.' \
" Local version is #{local_version} and remote version is #{remote_version}."
msg = 'Entangler version too far apart, please update either local or remote Entangler. ' \
"Local version is #{local_version} and remote version is #{remote_version}."
raise Entangler::VersionMismatchError, msg
end

Expand Down
2 changes: 1 addition & 1 deletion spec/entangler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

describe Entangler do
it 'has a version number' do
expect(Entangler::VERSION).not_to be nil
expect(Entangler::VERSION).not_to be_nil
end
end

0 comments on commit cabf037

Please sign in to comment.