Skip to content

Commit be8459e

Browse files
committed
Fix rubocop warns
1 parent 1aaa1c9 commit be8459e

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,3 @@ Metrics/PerceivedComplexity:
3939
# Offense count: 45
4040
Style/Documentation:
4141
Enabled: false
42-
43-
# Offense count: 7
44-
# Cop supports --auto-correct.
45-
# Configuration parameters: EnforcedStyle.
46-
# SupportedStyles: compact, exploded
47-
Style/RaiseArgs:
48-
Exclude:
49-
- 'lib/ferrum/browser/client.rb'
50-
- 'lib/ferrum/browser/command.rb'
51-
- 'lib/ferrum/browser/process.rb'
52-
- 'lib/ferrum/browser/xvfb.rb'
53-
- 'lib/ferrum/frame/runtime.rb'

lib/ferrum/browser/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ def raise_browser_error(error)
8585
# Node has disappeared while we were trying to get it
8686
when "No node with given id found",
8787
"Could not find node with given id"
88-
raise NodeNotFoundError.new(error)
88+
raise NodeNotFoundError, error
8989
# Context is lost, page is reloading
9090
when "Cannot find context with specified id"
91-
raise NoExecutionContextError.new(error)
91+
raise NoExecutionContextError, error
9292
when "No target with given id found"
9393
raise NoSuchPageError
9494
when /Could not compute content quads/
9595
raise CoordinatesNotFoundError
9696
else
97-
raise BrowserError.new(error)
97+
raise BrowserError, error
9898
end
9999
end
100100
end

lib/ferrum/browser/command.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initialize(defaults, options, user_data_dir)
3030
@options = options
3131
@user_data_dir = user_data_dir
3232
@path = options[:browser_path] || ENV["BROWSER_PATH"] || defaults.detect_path
33-
raise Cliver::Dependency::NotFound.new(NOT_FOUND) unless @path
33+
raise Cliver::Dependency::NotFound, NOT_FOUND unless @path
3434

3535
merge_options
3636
end

lib/ferrum/browser/xvfb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def self.xvfb_path
1818

1919
def initialize(options)
2020
@path = self.class.xvfb_path
21-
raise Cliver::Dependency::NotFound.new(NOT_FOUND) unless @path
21+
raise Cliver::Dependency::NotFound, NOT_FOUND unless @path
2222

2323
@screen_size = "#{options.fetch(:window_size, [1024, 768]).join('x')}x24"
2424
@display_id = (Time.now.to_f * 1000).to_i % 100_000_000

0 commit comments

Comments
 (0)