Gem Help - Newbie Question

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.

···

--
Posted via http://www.ruby-forum.com/.

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

···

On Mon, May 6, 2013 at 9:19 PM, Michael Tepfer <lists@ruby-forum.com> wrote:

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.

--
Posted via http://www.ruby-forum.com/\.

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 Mon, May 6, 2013 at 10:19 PM, Michael Tepfer <lists@ruby-forum.com> wrote:

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.

--
Posted via http://www.ruby-forum.com/\.

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.

···

--
Posted via http://www.ruby-forum.com/.

Is there a syntax highlighting editor that allows me to run one line of
code at a time like IRB?

···

--
Posted via http://www.ruby-forum.com/.

I have tried it but there was no syntax highlighting at all.

···

--
Posted via http://www.ruby-forum.com/.

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.

···

--
Posted via http://www.ruby-forum.com/.

Not sure what you're after with that, but there is an auto-complete
option in Notepad++

Settings -> Preferences -> Backup/Auto-Completion

···

--
Posted via http://www.ruby-forum.com/.

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

···

On May 7, 2013, at 10:19 PM, Michael Tepfer <lists@ruby-forum.com> wrote:

Is there a free windows irb-like app that performs syntax highlighting
as the user types their input.

Maybe look at pry? I have no clue whether it runs on windows.

···

On Tue, May 7, 2013 at 9:59 PM, Michael Tepfer <lists@ruby-forum.com> wrote:

Is there a syntax highlighting editor that allows me to run one line of
code at a time like IRB?

Some googling: it looks like by default you can't (
ANSI escape code - Wikipedia) but that you
can if you use the right dll (https://github.com/adoxa/ansicon/\)

-Josh

···

On Tue, May 7, 2013 at 8:19 PM, Michael Tepfer <lists@ruby-forum.com> wrote:

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.

--
Posted via http://www.ruby-forum.com/\.

Joel Pearson 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. :slight_smile:

But it is not happening in my editor.

Thanks

···

--
Posted via http://www.ruby-forum.com/\.

Joel Pearson 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 :frowning:

···

--
Posted via http://www.ruby-forum.com/\.

I used pry on Windows XP and it worked fine, syntax highlighting included.

···

Am 08.05.2013 04:19, schrieb Michael Tepfer:

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.

--
<https://github.com/stomar/&gt;

unknown wrote in post #1108316:

···

Am 08.05.2013 04:19, schrieb Michael Tepfer:

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`?

--
Posted via http://www.ruby-forum.com/\.

Could you give the installation link of `pry`?

I went to the command prompt and typed 'gem install pry'

···

--
Posted via http://www.ruby-forum.com/\.

No. What's so difficult about searching for 'pry installation'???

···

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`?

--
<https://github.com/stomar/&gt;