@@ -94,13 +94,10 @@ def self.exists?(path=DEFAULT_PATH)
9494 #
9595 # Downloads the ruby-advisory-db.
9696 #
97- # @param [Hash] options
98- # Additional options.
99- #
100- # @option options [String] :path (DEFAULT_PATH)
97+ # @param [String] path
10198 # The destination path for the new ruby-advisory-db.
10299 #
103- # @option options [Boolean] : quiet
100+ # @param [Boolean] quiet
104101 # Specify whether `git` should be `--quiet`.
105102 #
106103 # @return [Dataase]
@@ -114,15 +111,9 @@ def self.exists?(path=DEFAULT_PATH)
114111 #
115112 # @since 0.8.0
116113 #
117- def self . download ( options = { } )
118- unless ( options . keys - [ :path , :quiet ] ) . empty?
119- raise ( ArgumentError , "Invalid option(s)" )
120- end
121-
122- path = options . fetch ( :path , DEFAULT_PATH )
123-
114+ def self . download ( path : DEFAULT_PATH , quiet : false )
124115 command = %w[ git clone ]
125- command << '--quiet' if options [ : quiet]
116+ command << '--quiet' if quiet
126117 command << URL << path
127118
128119 unless system ( *command )
@@ -135,36 +126,31 @@ def self.download(options={})
135126 #
136127 # Updates the ruby-advisory-db.
137128 #
138- # @param [Hash] options
139- # Additional options .
129+ # @param [Hash{Symbol => Object}] kwargs
130+ # Additional optional keyword arguments for {download} or {#update!} .
140131 #
141- # @option options [Boolean] :quiet
132+ # @option kwargs [Boolean] :quiet
142133 # Specify whether `git` should be `--quiet`.
143134 #
144135 # @return [Boolean]
145136 # Specifies whether the update was successful.
146137 #
147- # @raise [ArgumentError]
148- # Invalid options were given.
149- #
150138 # @note
151139 # Requires network access.
152140 #
153141 # @since 0.3.0
154142 #
155143 # @deprecated Use {#update!} instead.
156144 #
157- def self . update! ( options = { } )
158- raise "Invalid option(s)" unless ( options . keys - [ :quiet ] ) . empty?
159-
145+ def self . update! ( **kwargs )
160146 if File . directory? ( DEFAULT_PATH )
161147 begin
162- new ( DEFAULT_PATH ) . update! ( options )
148+ new ( DEFAULT_PATH ) . update! ( ** kwargs )
163149 rescue UpdateFailed then false
164150 end
165151 else
166152 begin
167- download ( options . merge ( path : DEFAULT_PATH ) )
153+ download ( ** kwargs , path : DEFAULT_PATH )
168154 rescue DownloadFailed then false
169155 end
170156 end
@@ -184,10 +170,7 @@ def git?
184170 #
185171 # Updates the ruby-advisory-db.
186172 #
187- # @param [Hash] options
188- # Additional options.
189- #
190- # @option options [Boolean] :quiet
173+ # @param [Boolean] quiet
191174 # Specify whether `git` should be `--quiet`.
192175 #
193176 # @return [true, nil]
@@ -201,11 +184,11 @@ def git?
201184 #
202185 # @since 0.8.0
203186 #
204- def update! ( options = { } )
187+ def update! ( quiet : false )
205188 if git?
206189 Dir . chdir ( @path ) do
207190 command = %w[ git pull ]
208- command << '--quiet' if options [ : quiet]
191+ command << '--quiet' if quiet
209192 command << 'origin' << 'master'
210193
211194 unless system ( *command )
0 commit comments