Skip to content

Commit

Permalink
Fix a Ruby warning in File::WriteOptions
Browse files Browse the repository at this point in the history
The warning was:

```
lib/sugar_utils/file/write_options.rb:42: warning: instance variable @existing_owner not initialized
```

I have added some explicit initialization for the instance variables.
  • Loading branch information
acant committed Oct 28, 2022
1 parent 7311ba9 commit 476722c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/sugar_utils/file/write_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ class WriteOptions
# @parma filename [String]
# @param options [Hash]
def initialize(filename, options)
@filename = filename
@options = options
@filename = filename
@options = options
@existing_owner = nil
@existing_group = nil

return unless filename && ::File.exist?(filename)

Expand Down

0 comments on commit 476722c

Please sign in to comment.