File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ def csrf_tag(path=request.path)
410
410
411
411
def button_opts ( value , opts )
412
412
opts = Hash [ template_opts ] . merge! ( opts )
413
- _merge_fixed_locals_opts ( opts , '(value:, opts:)' )
413
+ _merge_fixed_locals_opts ( opts , button_fixed_locals )
414
414
opts [ :locals ] = { :value => value , :opts => opts }
415
415
opts [ :cache ] = cache_templates
416
416
opts [ :cache_key ] = :rodauth_button
@@ -563,6 +563,20 @@ def _process_raw_hmac(hmac)
563
563
s
564
564
end
565
565
566
+ if RUBY_VERSION >= '2.1'
567
+ def button_fixed_locals
568
+ '(value:, opts:)'
569
+ end
570
+ # :nocov:
571
+ else
572
+ # Work on Ruby 2.0 when using Tilt 2.6+, as Ruby 2.0 does
573
+ # not support required keyword arguments.
574
+ def button_fixed_locals
575
+ '(value: nil, opts: nil)'
576
+ end
577
+ end
578
+ # :nocov:
579
+
566
580
def database_function_password_match? ( name , hash_id , password , salt )
567
581
db . get ( Sequel . function ( function_name ( name ) , hash_id , password_hash_using_salt ( password , salt ) ) )
568
582
end
You can’t perform that action at this time.
0 commit comments