[#97678] [Ruby master Feature#16752] :private param for const_set — bughitgithub@...
Issue #16752 has been reported by bughit (bug hit).
5 messages
2020/04/02
[ruby-core:97901] [Ruby master Bug#16790] string format and refinements
From:
dsisnero@...
Date:
2020-04-15 23:25:03 UTC
List:
ruby-core #97901
Issue #16790 has been reported by dsisnero (Dominic Sisneros).
----------------------------------------
Bug #16790: string format and refinements
https://bugs.ruby-lang.org/issues/16790
* Author: dsisnero (Dominic Sisneros)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
require 'pathname'
module PathRefinement
refine Pathname do
def to_s
'"%s"' % self
end
end
end
module Builder
using PathRefinement
def call(s,params)
cmd = s % params
puts cmd
system(cmd)
end
module_function :call
end
file = Pathname($0).expand_path
Builder.call("cat %s", file)
-------------------
C:\Users\Dominic E Sisneros\source\repos\ruby\refine_pathname>ruby system_refinement.rb
cat C:/Users/Dominic E Sisneros/source/repos/ruby/refine_pathname/system_refinement.rb
cat: 'C:/Users/Dominic': No such file or directory
cat: E: No such file or directory
cat: Sisneros/source/repos/ruby/refine_pathname/system_refinement.rb: No such file or directory
expected
cat \"C:/Users/Dominic E Sisneros/source/repos/ruby/refine_pathname/system_refinement.rb\"
because format %s is supposed to call to_s
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>