hi,
im getting tired on this one.
i want to replace all forwardslashes with backwardslashes.
irb:
r = "C:/RAILS/"
r.gsub("/", "\\") or r.gsub("/")
{(''\''} both give me:
"C:\\RAILS\\"
how can i use gsub to display only one "\"?
regards
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/1AoQTd8WnJgJ.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 March 2012 10:36, Aaron Schmitz <a.schmitz703-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> hi, > > im getting tired on this one. > i want to replace all forwardslashes with backwardslashes. > > irb: > r = "C:/RAILS/" > r.gsub("/", "\\") or r.gsub("/") {(''\''} both give me: > "C:\\RAILS\\" > > how can i use gsub to display only one "\"?It''s escaping it to show in the console, the string does have only one backslash. => "\\".size>> 1;-) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
thank you....never thought about that..
next question! :D
when i put in mit shell : i_view32.exe C:\Rails\test.png
/convert=C:\Rails\test.jpg it works. but when i do
*system("i_view32.exe C:\Rails\test.png /convert=C:\Rails\test.jpg")*
it doesn''t work.
what am i doing wrong?i guess it is escaping instead of taking it as a
string. do i have to add three more "\" ?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/pC1Xx-8JDhwJ.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Does *system(''i_view32.exe'',
''C:\\Rails\\test.png'',
''/convert=C:\\Rails\\test.jpg'')* work for you?
On Fri, Mar 23, 2012 at 8:49 PM, Aaron Schmitz
<a.schmitz703-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>wrote:
> thank you....never thought about that..
> next question! :D
> when i put in mit shell : i_view32.exe C:\Rails\test.png
> /convert=C:\Rails\test.jpg it works. but when i do
> *system("i_view32.exe C:\Rails\test.png
/convert=C:\Rails\test.jpg")*
> it doesn''t work.
> what am i doing wrong?i guess it is escaping instead of taking it as a
> string. do i have to add three more "\" ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/pC1Xx-8JDhwJ.
>
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 March 2012 12:49, Aaron Schmitz <a.schmitz703-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> next question! :D > system("i_view32.exe C:\Rails\test.png /convert=C:\Rails\test.jpg") > doesn''t work.What happens when you try: system("i_view32.exe C:\\Rails\\test.png /convert=C:\\Rails\\test.jpg") ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
"=> nil"
i can start "calc.exe" from firefox via the controller that says
"*
system("calc.exe")*".
but i cannot start i_view32.exe or firefox.exe etc.
is it a permission issue on win xp?
the command is ok, i tested it in cmd.exe
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/9DhfKlyd6AIJ.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 March 2012 13:46, Aaron Schmitz <a.schmitz703-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> is it a permission issue on win xp? > the command is ok, i tested it in cmd.exeProbably... I recommend a nice Linux install (even just a VM... ;-) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
yep. i didnt escape the string twice...so i just got confused with the
irb-way to show the string.
so i used gsub("/", "\\\\") and it worked.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/vFpfEqjIzzUJ.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.