Rails Console

    Hello,
I have a couple of questions on Rails console:
1.  Where can I find decent information on how to use Rails Console in Rubymine?  I am an experienced Rails developer so Rails console is not a problem for me, rather I am trying to see how jetbrains has enhanced it.
2.  The output in the upper window is not adjusted for color codes.  See a sample below:

=> [0;32mnil[0;0m
[#<PracticeStatus id: 1, name: "Active", created_at: "2009-05-27 21:31:02", updated_at: "2009-05-27 21:31:02">,
#<PracticeStatus id: 2, name: "Inactive", created_at: "2009-05-27 21:31:02", updated_at: "2009-05-27 21:31:02">]
=> [0;32mnil[0;0m

This is in response to my query:

pp PracticeStatus.find(:all)


What are these funny characters?

=> [0;32mnil[0;0m
=> [0;32mnil[0;0m

And how do I get rid of them?  I am on Ubuntu 8.10

Thanks.

Bharat

9 comments
Comment actions Permalink

Hello Bharat,

I have a couple of questions on Rails console:

1.  Where can I find decent information on how to use Rails Console in Rubymine?  I am an experienced Rails developer so Rails console is not a problem for me, rather I am trying to see how jetbrains has enhanced it.

Please use: Help | Help Topics. In search tab (with magnifier on it) type in Rails console.
Also I want to mention that we have action "Load selected file/text in IRB console" (Alt+Shift+L) from editor, which allows you to paste selected text from editor to IRB or Rails console.

2.  The output in the upper window is not adjusted for color codes.  See a sample below:


=> [0;32mnil[0;0m
[#<PracticeStatus id: 1, name: "Active", created_at: "2009-05-27 21:31:02", updated_at: "2009-05-27 21:31:02">,
#<PracticeStatus id: 2, name: "Inactive", created_at: "2009-05-27 21:31:02", updated_at: "2009-05-27 21:31:02">]
=> [0;32mnil[0;0m


This is in response to my query:


pp PracticeStatus.find(:all)


What are these funny characters?


=> [0;32mnil[0;0m
=> [0;32mnil[0;0m


And how do I get rid of them?  I am on Ubuntu 8.10

These are ANSI coloring characters. At the moment Rails console doesn't support it.
You are welcome to vote for the issue: http://www.jetbrains.net/jira/browse/RUBY-3658

Regards,
Oleg

0
Comment actions Permalink

Hello Bharat,

We've fix this. But actually I don't like highlighting of rails console's ANSI coloring. Just compare three screenshots:

1. Original highlighting which was shown in terminal
Picture 6.png
2. IRB which was launched from RubyMine. Notice, that RubyMine highlighted more code than was in terminal. RubyMine use colors from terminal and highlights only text which wasn't highlighted by terminal.
Picture 4.png
3. Launched from RubyMine, ANSI coloring was turned of. For highlighting RubyMine uses current editor's color scheme.
Picture 5.png

0
Comment actions Permalink

Hello Roman,
I like this!  but that is not what I see on Ubuntu 8.10.  May be I am missing some setting?
Thanks.
Bharat
p.s. by the way, good job on fixing the Diagram.  It looks really good now.  I also like the way that you can navigate to underlying model.  Keep up the good work.  I have just moved from Netbeans to Rubymine.  If you guys keep improving Rubymine at this rate, it will be hard to beat.  To give you my vote of confidence, I have already bought my copy .

0
Comment actions Permalink
I like this!  but that is not what I see on Ubuntu 8.10.  May be I am missing some setting?

RubyMine 1.1 doesn't include this fix. Will be available in coming versions (most likely 1.1.1)

Regards,
Oleg

0
Comment actions Permalink

I like this!  but that is not what I see on Ubuntu 8.10.  May be I am missing some setting?

Second variant will not work in RubyMine 1.1 because I've just fix it and it is only in our trunk version. Third variant you will see if you disable ANSI coloring support(e.g strings like [0;32mnil[0;0m) for Rails console. I don't know how you enabled it, because it is turned off by default.

0
Comment actions Permalink

OK.  No worries.  I will wait for 1.1.1.
Did you get a chance to look at the documentation bug/problem that I filed?

0
Comment actions Permalink

I have a follow up about rails console display. This is on OS X if it matters, using latest 2.0 RC.

The output window automatically scrolls horizontally to the right to the end of the line. That isn't really helpful in most cases since there'll be some long SQL output followed by a result I am interested in on the far left. As it is I have to move the horizontal scroll bar from far right to far left after most expressions I've typed. The same is true for the IRB console.

Is there a way to "lock" the horizontal position of the output window? I think that's a better default mode as well.

I also have a question about wirble-like code-completion for the console. I'd love to be able to use tab-completion as I do (via wirble) in terminal windows also in the RM consoles.
Is that something you've thought about?

While I'm on the topic I may as well include one more question: Is there a way to use the RM debug functionality in conjunction with the console? i.e. I set some break points and then I start a console and execute expressions and I'll get put into the debugger at break points etc.

Patrik

0
Comment actions Permalink

Hello Patrik,

I have a follow up about rails console display. This is on OS X if it matters, using latest 2.0 RC.

The output window automatically scrolls horizontally to the right to the end of the line. That isn't really helpful in most cases since there'll be some long SQL output followed by a result I am interested in on the far left. As it is I have to move the horizontal scroll bar from far right to far left after most expressions I've typed. The same is true for the IRB console.

Is there a way to "lock" the horizontal position of the output window? I think that's a better default mode as well.

Console scrolls to the end of the text automatically, however I've created an issue for this: http://youtrack.jetbrains.net/issue/RUBY-5419

I also have a question about wirble-like code-completion for the console. I'd love to be able to use tab-completion as I do (via wirble) in terminal windows also in the RM consoles.
Is that something you've thought about?

Some code completion is planned for IRB/Rails console, but not for the 2.0 version.

While I'm on the topic I may as well include one more question: Is there a way to use the RM debug functionality in conjunction with the console? i.e. I set some break points and then I start a console and execute expressions and I'll get put into the debugger at break points etc.

At the moment RubyMine doesn't support this functionality, but we already have a feauture request:http://youtrack.jetbrains.net/issue/RUBY-4982
Feel free to vote for it.

Best regards,
Oleg

0
Comment actions Permalink

Cool. Put in a vote/comment on both those issues.

Good to hear code completion for irb/console is in the plan.

Thanks

0

Please sign in to leave a comment.