File tree Expand file tree Collapse file tree 7 files changed +19
-24
lines changed Expand file tree Collapse file tree 7 files changed +19
-24
lines changed Original file line number Diff line number Diff line change @@ -528,11 +528,6 @@ Style/DefWithParentheses:
528
528
StyleGuide : ' https://github.com/bbatsov/ruby-style-guide#method-parens'
529
529
Enabled : false
530
530
531
- Style/DeprecatedHashMethods :
532
- Description : ' Checks for use of deprecated Hash methods.'
533
- StyleGuide : ' https://github.com/bbatsov/ruby-style-guide#hash-key'
534
- Enabled : false
535
-
536
531
Style/Documentation :
537
532
Description : ' Document classes and non-namespace modules.'
538
533
Enabled : false
@@ -716,7 +711,7 @@ Style/LineEndConcatenation:
716
711
line end.
717
712
Enabled : false
718
713
719
- Style/MethodCallParentheses :
714
+ Style/MethodCallWithoutArgsParentheses :
720
715
Description : ' Do not use parentheses for method calls with no arguments.'
721
716
StyleGuide : ' https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
722
717
Enabled : false
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def self.run_postconditions
40
40
self . up_systemd_services if @@handle_systemd_services
41
41
end
42
42
43
- def self . handle_error ( command_output )
43
+ def self . handle_error ( _command_output )
44
44
puts "[DEBUG] handling dnsmasq start error" if Dory ::Config . debug?
45
45
# If we've already tried to handle failure, prevent infinite recursion
46
46
if @@first_attempt_failed
@@ -101,16 +101,16 @@ def self.domain_addr_arg_string
101
101
end
102
102
end
103
103
104
- def self . run_command ( domains = self . domains )
104
+ def self . run_command
105
105
"docker run -d -p #{ self . port } :#{ self . port } /tcp -p #{ self . port } :#{ self . port } /udp " \
106
106
"--name=#{ Shellwords . escape ( self . container_name ) } " \
107
107
"--cap-add=NET_ADMIN #{ Shellwords . escape ( self . dnsmasq_image_name ) } " \
108
108
"#{ self . domain_addr_arg_string } "
109
109
end
110
110
111
- def self . check_port ( port_num )
112
- puts "Requesting sudo to check if something is bound to port #{ self . port } " . green
113
- ret = Sh . run_command ( "sudo lsof -i :#{ self . port } " )
111
+ def self . check_port ( port_num = self . port )
112
+ puts "Requesting sudo to check if something is bound to port #{ port_num } " . green
113
+ ret = Sh . run_command ( "sudo lsof -i :#{ port_num } " )
114
114
return [ ] unless ret . success?
115
115
116
116
list = ret . stdout . split ( "\n " )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def run_postconditions
21
21
return true
22
22
end
23
23
24
- def handle_error ( command_output )
24
+ def handle_error ( _command_output )
25
25
# Override to provide error handling
26
26
return false
27
27
end
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def self.certs_arg
31
31
def self . tls_arg
32
32
if [ :tls_enabled , :ssl_enabled , :https_enabled ] . any? { |s |
33
33
Dory ::Config . settings [ :dory ] [ :nginx_proxy ] [ s ]
34
- }
34
+ }
35
35
"-p 443:443"
36
36
else
37
37
''
Original file line number Diff line number Diff line change 166
166
end
167
167
168
168
context "knows if we've edited the file" do
169
- let ( :comment ) { '# added by dory' }
169
+ let ( :comment ) { '# added by dory' }
170
170
171
- let ( :stub_resolv ) do
171
+ let ( :stub_resolv ) do
172
172
-> ( nameserver , file_comment = comment ) do
173
173
allow ( Dory ::Resolv ::Linux ) . to receive ( :nameserver ) { nameserver }
174
- allow ( Dory ::Resolv ::Linux ) . to receive ( :file_comment ) { comment }
174
+ allow ( Dory ::Resolv ::Linux ) . to receive ( :file_comment ) { file_comment }
175
175
expect ( Dory ::Resolv ::Linux . nameserver ) . to eq ( nameserver )
176
- expect ( Dory ::Resolv ::Linux . file_comment ) . to eq ( comment )
176
+ expect ( Dory ::Resolv ::Linux . file_comment ) . to eq ( file_comment )
177
177
end
178
178
end
179
179
Original file line number Diff line number Diff line change 180
180
end
181
181
182
182
context "knows if we've edited the file" do
183
- let ( :comment ) { '# added by dory' }
183
+ let ( :comment ) { '# added by dory' }
184
184
185
- let ( :stub_resolv ) do
185
+ let ( :stub_resolv ) do
186
186
-> ( nameserver , file_comment = comment ) do
187
187
allow ( Dory ::Resolv ::Macos ) . to receive ( :nameserver ) { nameserver }
188
- allow ( Dory ::Resolv ::Macos ) . to receive ( :file_comment ) { comment }
188
+ allow ( Dory ::Resolv ::Macos ) . to receive ( :file_comment ) { file_comment }
189
189
expect ( Dory ::Resolv ::Macos . nameserver ) . to eq ( nameserver )
190
- expect ( Dory ::Resolv ::Macos . file_comment ) . to eq ( comment )
190
+ expect ( Dory ::Resolv ::Macos . file_comment ) . to eq ( file_comment )
191
191
end
192
192
end
193
193
194
- let ( :contents ) do
194
+ let ( :contents ) do
195
195
-> ( nameserver , port ) do
196
196
<<-EOF . gsub ( ' ' * 10 , '' )
197
197
# added by dory
201
201
end
202
202
end
203
203
204
- let ( :stub_the_things ) do
204
+ let ( :stub_the_things ) do
205
205
-> ( nameserver , port ) do
206
206
allow ( Dory ::Resolv ::Macos ) . to receive ( :file_nameserver_line ) { "nameserver #{ nameserver } " }
207
207
allow ( Dory ::Resolv ::Macos ) . to receive ( :port ) { port }
Original file line number Diff line number Diff line change 13
13
let ( :stub_sh ) do
14
14
-> ( success , stdout ) do
15
15
allow ( Dory ::Sh ) . to receive ( :run_command ) do
16
- OpenStruct . new ( success? : true , stdout : stdout )
16
+ OpenStruct . new ( success? : success , stdout : stdout )
17
17
end
18
18
end
19
19
end
You can’t perform that action at this time.
0 commit comments