简体   繁体   中英

escape character for shoes in ruby

So I'm attempting to print a show an image of a url using the 'image' command in shoes. The issue is that my url contains % characters. This would not be an issue most of the time since I could just escape it but Shoes does not behave like I would expect it to. I've looked through the manual and other sources from Shoes but none seem to mention how to print use special characters.

Essentially right now alert yields...

alert "%D"  --> 2743522352

alert "\%D" --> 3439909232

but what I really want is

alert "%D"  -->%D

how can I make this happen?

I am not able to reproduce this problem on red shoes. But I guess, to solve the problem, you should use single quotes instead of double quotes.

alert '%D'  -->%D

Because in ruby, single quotes escape everything inside it. Hope it helps :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM