@@ -23,19 +23,18 @@ class << self
23
23
opts = FileUtils . options_of name
24
24
default_options = [ ]
25
25
if opts . include? ( "verbose" )
26
- default_options << ": verbose => FileUtilsExt.verbose_flag"
26
+ default_options << "verbose: FileUtilsExt.verbose_flag"
27
27
end
28
28
if opts . include? ( "noop" )
29
- default_options << ": noop => FileUtilsExt.nowrite_flag"
29
+ default_options << "noop: FileUtilsExt.nowrite_flag"
30
30
end
31
31
32
32
next if default_options . empty?
33
33
module_eval ( <<-EOS , __FILE__ , __LINE__ + 1 )
34
- def #{ name } ( *args, &block )
35
- super(
36
- *rake_merge_option(args,
37
- #{ default_options . join ( ', ' ) }
38
- ), &block)
34
+ def #{ name } (*args, **options, &block)
35
+ super(*args,
36
+ #{ default_options . join ( ', ' ) } ,
37
+ **options, &block)
39
38
end
40
39
EOS
41
40
end
@@ -113,16 +112,6 @@ def when_writing(msg=nil)
113
112
end
114
113
end
115
114
116
- # Merge the given options with the default values.
117
- def rake_merge_option ( args , defaults )
118
- if Hash === args . last
119
- defaults . update ( args . last )
120
- args . pop
121
- end
122
- args . push defaults
123
- args
124
- end
125
-
126
115
# Send the message to the default rake output (which is $stderr).
127
116
def rake_output_message ( message )
128
117
$stderr. puts ( message )
0 commit comments