fix rubocop warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
diff --git a/.rubocop.yml b/.rubocop.yml
index e75ab57..7bef84d 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,4 +1,7 @@
-Metrics/LineLength:
+AllCops:
+ NewCops: enable
+
+Layout/LineLength:
Max: 120
Metrics/AbcSize:
diff --git a/.ruby-version b/.ruby-version
deleted file mode 100644
index 57cf282..0000000
--- a/.ruby-version
+++ /dev/null
@@ -1 +0,0 @@
-2.6.5
diff --git a/lib/mpd_client.rb b/lib/mpd_client.rb
index 0cf86d5..82b9655 100644
--- a/lib/mpd_client.rb
+++ b/lib/mpd_client.rb
@@ -251,10 +251,10 @@ module MPD
@mutex.synchronize do
write_command(command, *args)
- if !@command_list.nil?
- @command_list << retval
- else
+ if @command_list.nil?
eval retval
+ else
+ @command_list << retval
end
end
end
diff --git a/mpd_client.gemspec b/mpd_client.gemspec
index b38d65d..7cee0d3 100644
--- a/mpd_client.gemspec
+++ b/mpd_client.gemspec
@@ -14,10 +14,11 @@ Gem::Specification.new do |gem|
gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.required_ruby_version = '>= 2.6.0'
gem.name = 'mpd_client'
gem.require_paths = ['lib']
gem.version = MPD::Client::VERSION
gem.license = 'MIT'
- gem.add_development_dependency 'bundler', '~> 1.16'
+ gem.add_development_dependency 'bundler'
end