From: Junior Linux on
well my doubt is:

I want to make a ruby program that number in a URL and checks if the url
has a forum. for exemple :

puts("enter an address");
endereco =gets()
@forum = "/forum"
system("firefox "+ endereco+ @forum);

the code does not work, it opens the page with the site but the variable
@ forum runs only after I close the open page, and as command not found
(like I try to use the command / forum)

how can i put it all together and make url.com / forum?


PS : Sorry for my spelling errors, I'm from Brazil :D
--
Posted via http://www.ruby-forum.com/.

From: pharrington on
On Dec 31, 9:41 pm, Junior Linux <andre.ros...(a)gmail.com> wrote:
> well my doubt is:
>
> I want to make a ruby program that number in a URL and checks if the url
> has a forum. for exemple :
>
> puts("enter an address");
> endereco =gets()
> @forum = "/forum"
> system("firefox "+ endereco+ @forum);
>
> the code does not work, it opens the page with the site but the variable
> @ forum runs only after I close the open page, and as command not found
> (like I try to use the command / forum)
>
> how can i put it all together and make url.com / forum?
>
> PS : Sorry for my spelling errors, I'm from Brazil :D
> --
> Posted viahttp://www.ruby-forum.com/.

gets() retains the newline when the user presses enter
try stripping the newline (endereco = gets().chomp)
 | 
Pages: 1
Prev: Happy new Year
Next: Ruby & IRC