Hi,
I’ve just started using Ruby today and I am reading through the tutorial
and the tutorial shows the code in the IRB with syntax highlighting.
I installed a gem called Wirble which is supposed to do that for me.
How do I get the gem to work?
I am using Windows 7.
Based on the docs at http://pablotron.org/software/wirble/
You should be able to get it to work by typing:
require ‘wirble’
Wirble.enable
Wirble.colourize
To avoid having to type that each time you load irb, you can put it in a
file named .irbrc, located in your home directory. I don’t know what the
home directory is for Windows, but if you load irb and run require 'etc'; Dir.home(Etc.getlogin)
, it will probably say (if that doesn’t work, try
ENV['HOME']
)
-Josh
Hi Michael ~
I used wirble when I first started exploring ruby and experimenting
with customizing irb. As josh mentioned you’ll want to create a .irbrc
file which will be read and run when you execute irb in your shell.
You may want to dig deeper and explore how to configure your own color
theme as well which also would be put into the rc file as well.
If you are interested in an alternative repl to the ruby core irb
program pry is a decent option which has color on by default and some
vary exotic extentions in and unto itself with step debugging, emacs
like editing from the repl and manual help pages and code exploration
built in.
Enjoy your discovery of the language and happy hacking.
~Stu
On May 7, 2013, at 10:19 PM, Michael T. [email protected]
wrote:
Is there a free windows irb-like app that performs syntax highlighting
as the user types their input.
Sounds like you are looking for a syntax highlighting editor. I know
that Sublime Text 2 and Notepad++ run on Windows and support code
highlighting. There are likely many many others.
Robert Jackson
– twitter: rwjblue
– github: rjackson
Thank you both for your help.
I got wirble working.
However, it did not do what I thought it would.
Is there a free windows irb-like app that performs syntax highlighting
as the user types their input.
Is there a syntax highlighting editor that allows me to run one line of
code at a time like IRB?
I have tried it but there was no syntax highlighting at all.
On Tue, May 7, 2013 at 9:59 PM, Michael T. [email protected]
wrote:
Is there a syntax highlighting editor that allows me to run one line of
code at a time like IRB?
Maybe look at pry? I have no clue whether it runs on windows.
I’m writing Ruby code on Windows 7, and I use Notepad++
It does syntax highlighting and with a minor tweak you can set up a
shortcut key which will execute the code within the file you’re
currently editing.
The best thing to do with that is usually write out your code in
Notepad++ and then copy-paste a line or block at a time into IRB.
That approach will make it easier to edit the code, as it can be awkward
recovering long lines of code from IRB after writing them in.
Not sure what you’re after with that, but there is an auto-complete
option in Notepad++
Settings -> Preferences -> Backup/Auto-Completion
Am 08.05.2013 04:19, schrieb Michael T.:
Thank you both for your help.
I got wirble working.
However, it did not do what I thought it would.
Is there a free windows irb-like app that performs syntax highlighting
as the user types their input.
I used pry on Windows XP and it worked fine, syntax highlighting
included.
Joel P. wrote in post #1108193:
I’m writing Ruby code on Windows 7, and I use Notepad++
It does syntax highlighting and with a minor tweak you can set up a
shortcut key which will execute the code within the file you’re
currently editing.
I am also using Notepad++. But automatic code insertion is not possible
in notepad++. Only I am able to set auto close of brackets.
If you are aware of the settings of auto-code insertion like say when I
would write:
class A
- <~~ cursor should blink here.
let me know.
But it is not happening in my editor.
Thanks
Joel P. wrote in post #1108243:
Not sure what you’re after with that, but there is an auto-complete
option in Notepad++
Settings -> Preferences -> Backup/Auto-Completion
Tried it earlier but no luck
Could you give the installation link of pry
?
I went to the command prompt and typed ‘gem install pry’
unknown wrote in post #1108316:
Am 08.05.2013 04:19, schrieb Michael T.:
Thank you both for your help.
I got wirble working.
However, it did not do what I thought it would.
Is there a free windows irb-like app that performs syntax highlighting
as the user types their input.
I used pry on Windows XP and it worked fine, syntax highlighting
included.
Could you give the installation link of pry
?
Am 09.05.2013 07:43, schrieb Love U Ruby:
I used pry on Windows XP and it worked fine, syntax highlighting
included.
Could you give the installation link of pry
?
No. What’s so difficult about searching for ‘pry installation’???