On Wed, Aug 29, 2012 at 10:51 AM, Joakim Langvand <[email protected]> wrote:
> Hi all
>
> I´m starting to laern Ruby, but i´ve encountered this strange problem.
> This is my code:
>
> pname = gets
> pname.chomp

You are missing an exclamation mark:
pname.chomp!

The method without returns a new object but does not modify your
pname.  You can see that by inserting

p pname

before creating the directory.

> Dir.mkdir(pname)
>
> If I enter test for pname, the resulting folder is named "test?". What
> am I doing wrong here?

See above.

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to