diff --git a/Guardfile b/Guardfile index fc722665..f737f1e3 100644 --- a/Guardfile +++ b/Guardfile @@ -3,7 +3,7 @@ # More info at https://github.com/guard/guard#readme directories %w(lib spec) \ - .select { |d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist") } + .select { |d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist") } ## Note: if you are using the `directories` clause above and you are not ## watching the project directory ('.'), then you will want to move diff --git a/lib/mini_profiler/config.rb b/lib/mini_profiler/config.rb index f7a4d281..737399a0 100644 --- a/lib/mini_profiler/config.rb +++ b/lib/mini_profiler/config.rb @@ -97,7 +97,9 @@ def self.default # redefined - since the accessor defines it first undef :authorization_mode= + # rubocop:disable Lint/DuplicateMethods def authorization_mode=(mode) + # rubocop:enable Lint/DuplicateMethods if mode == :whitelist warn "[DEPRECATION] `:whitelist` authorization mode is deprecated. Please use `:allow_authorized` instead." diff --git a/lib/mini_profiler/snapshots_transporter.rb b/lib/mini_profiler/snapshots_transporter.rb index ee8537da..1d7160c4 100644 --- a/lib/mini_profiler/snapshots_transporter.rb +++ b/lib/mini_profiler/snapshots_transporter.rb @@ -9,9 +9,11 @@ class << self def transported_snapshots_count @@transported_snapshots_count end + def successful_http_requests_count @@successful_http_requests_count end + def failed_http_requests_count @@failed_http_requests_count end diff --git a/lib/mini_profiler/storage/file_store.rb b/lib/mini_profiler/storage/file_store.rb index 938f7153..b62ba2e1 100644 --- a/lib/mini_profiler/storage/file_store.rb +++ b/lib/mini_profiler/storage/file_store.rb @@ -91,8 +91,6 @@ def initialize(args = nil) end at_exit { t[:should_exit] = true } - - t end def save(page_struct) diff --git a/lib/mini_profiler/timer_struct/base.rb b/lib/mini_profiler/timer_struct/base.rb index 15a46982..508a0c3b 100644 --- a/lib/mini_profiler/timer_struct/base.rb +++ b/lib/mini_profiler/timer_struct/base.rb @@ -22,7 +22,6 @@ def [](name) def []=(name, val) attributes[name] = val - self end def to_json(*a) diff --git a/lib/mini_profiler/views.rb b/lib/mini_profiler/views.rb index bd27edb5..f5754b01 100644 --- a/lib/mini_profiler/views.rb +++ b/lib/mini_profiler/views.rb @@ -77,7 +77,7 @@ def get_profile_script(env) script = ::File.read(::File.expand_path('../html/profile_handler.js', ::File.dirname(__FILE__))) # replace the variables settings.each do |k, v| - regex = Regexp.new("\\{#{k.to_s}\\}") + regex = Regexp.new("\\{#{k}\\}") script.gsub!(regex, v.to_s) end