diff --git a/.rubocop.yml b/.rubocop.yml index 8fac6d2..4db4f5b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ AllCops: SuggestExtensions: false Layout/SpaceBeforeBrackets: # (new in 1.7) Enabled: true -Layout/LineLength: +Layout/LineLength: Max: 350 Lint/AmbiguousAssignment: # (new in 1.7) Enabled: true @@ -110,4 +110,8 @@ Metrics/MethodLength: Metrics/CyclomaticComplexity: Max: 15 Metrics/PerceivedComplexity: - Max: 15 \ No newline at end of file + Max: 15 +Metrics/ClassLength: + Max: 150 +Metrics/ParameterLists: + Max: 6 \ No newline at end of file diff --git a/lib/puma/plugin/rabbit_carrots.rb b/lib/puma/plugin/rabbit_carrots.rb index 3344c16..79fd20f 100644 --- a/lib/puma/plugin/rabbit_carrots.rb +++ b/lib/puma/plugin/rabbit_carrots.rb @@ -1,4 +1,5 @@ # rabbit_carrots.rb +require 'English' require 'puma/plugin' require 'rabbit_carrots' @@ -7,7 +8,7 @@ Puma::Plugin.create do def start(launcher) @log_writer = launcher.log_writer - @puma_pid = $$ + @puma_pid = $PROCESS_ID @core_service = RabbitCarrots::Core.new(logger: log_writer) @@ -57,7 +58,7 @@ Puma::Plugin.create do loop do if send(process_dead) log message - Process.kill('TERM', $$) + Process.kill('TERM', $PROCESS_ID) break end sleep 2 diff --git a/lib/rabbit_carrots/configuration.rb b/lib/rabbit_carrots/configuration.rb index 29a2fd6..c72714c 100644 --- a/lib/rabbit_carrots/configuration.rb +++ b/lib/rabbit_carrots/configuration.rb @@ -24,8 +24,6 @@ module RabbitCarrots @orm ||= :activerecord end - def orm=(value) - @orm = value - end + attr_writer :orm end end diff --git a/lib/rabbit_carrots/connection.rb b/lib/rabbit_carrots/connection.rb index 81dfc95..032d0dd 100644 --- a/lib/rabbit_carrots/connection.rb +++ b/lib/rabbit_carrots/connection.rb @@ -3,6 +3,7 @@ require 'singleton' module RabbitCarrots class Connection include ::Singleton + attr_reader :connection def initialize