[#393742] Getting the class of an object. — Ralph Shnelvar <ralphs@...32.com>

Consider;

14 messages 2012/03/06

[#393815] arcadia IDE requires tcl/tk and ruby-tk — Thufir Hawat <hawat.thufir@...>

which or where tcl and tk does arcadia require? Is this a gem which I

13 messages 2012/03/13

[#393952] What’s the best way to check if a feature/class has been loaded? — Nikolai Weibull <now@...>

Hi!

18 messages 2012/03/21
[#393953] Re: What’s the best way to check if a feature/class has been loaded? — Xavier Noria <fxn@...> 2012/03/21

Active Support has recently added qualified_const_* methods to Module

[#393954] Re: What’s the best way to check if a feature/class has been loaded? — Xavier Noria <fxn@...> 2012/03/21

Ah, that won't work in 1.8.

[#393959] Re: What’s the best way to check if a feature/class has been loaded? — Nikolai Weibull <now@...> 2012/03/21

On Wed, Mar 21, 2012 at 16:43, Xavier Noria <fxn@hashref.com> wrote:

[#393960] Re: What’s the best way to check if a feature/class has been loaded? — Xavier Noria <fxn@...> 2012/03/21

On Wed, Mar 21, 2012 at 8:17 PM, Nikolai Weibull <now@bitwi.se> wrote:

[#393961] Re: What’s the best way to check if a feature/class has been loaded? — Nikolai Weibull <now@...> 2012/03/21

On Wed, Mar 21, 2012 at 20:48, Xavier Noria <fxn@hashref.com> wrote:

[#393962] Re: What’s the best way to check if a feature/class has been loaded? — Xavier Noria <fxn@...> 2012/03/21

On Wed, Mar 21, 2012 at 9:51 PM, Nikolai Weibull <now@bitwi.se> wrote:

[#393967] Re: What’s the best way to check if a feature/class has been loaded? — Nikolai Weibull <now@...> 2012/03/22

On Wed, Mar 21, 2012 at 22:11, Xavier Noria <fxn@hashref.com> wrote:

[#393969] Re: What’s the best way to check if a feature/class has been loaded? — Xavier Noria <fxn@...> 2012/03/22

On Thu, Mar 22, 2012 at 6:15 AM, Nikolai Weibull <now@bitwi.se> wrote:

[#394154] uninitialized constant SOCKSSocket — Resident Moron <lists@...>

I am running ruby 1.9.3 on a linux box. I would like to use

10 messages 2012/03/29

[#394160] Why z = Complex(1,2) rather than z = Complex.new(1,2)? — Ori Ben-Dor <lists@...>

What's this syntax, z = Complex(1,2), as opposed to z =

14 messages 2012/03/29

[#394175] shoes no such file to load -- rubygems — Mr theperson <lists@...>

I have installed shoes to develop GUI applications but when I try and

13 messages 2012/03/29

[#394201] Can't open url with a subdomain with an underscore — Jeroen van Ingen <lists@...>

I try to open the following URL: http://auto_diversen.marktplaza.nl/

10 messages 2012/03/30

[#394222] Ruby openssl ECC help plz — no name <lists@...>

I am confused on how to properly export public ECC key. I can see it

13 messages 2012/03/31

rib 1.0.4 released

From: "Lin Jen-Shin (godfat)" <godfat@...>
Date: 2012-03-19 19:35:49 UTC
List: ruby-talk #393937
## Rib <https://github.com/godfat/rib>

by Lin Jen-Shin ([godfat](http://godfat.org))

## DESCRIPTION:

Ruby-Interactive-ruBy -- Yet another interactive Ruby shell

Rib is based on the design of [ripl] and the work of [ripl-rc], some
of
the features are also inspired by [pry]. The aim of Rib is to be fully
featured and yet very easy to opt-out or opt-in other features. It
shall
be simple, lightweight and modular so that everyone could customize
Rib.

[ripl]: https://github.com/cldwalker/ripl
[ripl-rc]: https://github.com/godfat/ripl-rc
[pry]: https://github.com/pry/pry

## INSTALLATION:

    gem install rib

### SYNOPSIS:

https://github.com/godfat/rib/raw/master/screenshot.png

### As an interactive shell

As IRB (reads `~/.rib/config.rb` writes `~/.rib/history.rb`)

    rib

As Rails console

    rib rails

You could also run in production and pass arguments normally as you'd
do in
`rails console` or `./script/console`

    rib rails production --sandbox --debugger

Note: You might need to add ruby-debug or ruby-debug19 to your Gemfile
if
you're passing --debugger and using bundler together.

As Ramaze console

    rib ramaze

As a console for whichever the app in the current path
it should be (for now, it's either Rails or Ramaze)

    rib auto

If you're trying to use `rib auto` for a Rails app, you could also
pass
arguments as if you were using `rib rails`. `rib auto` is merely
passing
arguments.

    rib auto production --sandbox --debugger

As a fully featured interactive Ruby shell (as ripl-rc)

    rib all

As a fully featured app console (yes, some commands could be used
together)

    rib all auto # or `rib auto all`, the order doesn't really matter

You can customize Rib's behaviour by setting a config file located at
`~/.rib/config.rb` or `~/.config/rib/config.rb`, or `$RIB_HOME/
config.rb` by
setting `$RIB_HOME` environment variable. Since it's merely a Ruby
script
which would be loaded into memory before launching Rib shell session,
You can
put any customization or monkey patch there. Personally, I use all
plugins
provided by Rib.

<https://github.com/godfat/dev-tool/blob/master/.config/rib/config.rb>

As you can see, putting `require 'rib/all'` into config file is
exactly the
same as running `rib all` without a config file. What `rib all` would
do is
merely require the file, and that file is also merely requiring all
plugins,
but without **extra plugins**, which you should enable them one by
one. This
is because most extra plugins are depending on other gems, or hard to
work
with other plugins, or having strong personal tastes, so you won't
want to
enable them all. Suppose you only want to use the core plugins and
color
plugin, you'll put this into your config file:

    require 'rib/core'
    require 'rib/more/color'

You can also write your plugins there. Here's another example:

    require 'rib/core'
    require 'pp'
    Rib.config[:prompt] = '$ '

    module RibPP
      Rib::Shell.send(:include, self)

      def format_result result
        result_prompt + result.pretty_inspect
      end
    end

So that we override the original format_result to pretty_inspect the
result.
You can also build your own gem and then simply require it in your
config
file. To see a list of overridable API, please read [api.rb][]

Currently, there are two **extra plugins**.

* `require 'rib/extra/autoindent'` This plugin is depending on:

  1. [readline_buffer][]
  2. readline plugin
  3. multiline plugin

* `require 'rib/extra/hirb'` This plugin is depending on:

  1. [hirb][]

[api.rb]: https://github.com/godfat/rib/blob/master/lib/rib/api.rb
[readline_buffer]: https://github.com/godfat/readline_buffer
[hirb]: https://github.com/cldwalker/hirb

#### Basic configuration

Rib.config                 | Functionality
-------------------------- |
-------------------------------------------------
ENV['RIB_HOME']            | Specify where Rib should store config and
history
Rib.config[:config]        | The path where config should be located
Rib.config[:name]          | The name of this shell
Rib.config[:result_prompt] | Default is "=>"
Rib.config[:prompt]        | Default is ">>"
Rib.config[:binding]       | Context, default: TOPLEVEL_BINDING
Rib.config[:exit]          | Commands to exit, default [nil] # control
+d

#### Plugin specific configuration

Rib.config                     | Functionality
------------------------------ |
---------------------------------------------
Rib.config[:completion]        | Completion: Bond config
Rib.config[:history_file]      | Default is "~/.rib/config/history.rb"
Rib.config[:history_size]      | Default is 500
Rib.config[:color]             | A hash of Class => :color mapping
Rib.config[:autoindent_spaces] | How to indent? Default is two spaces:
'  '

### As a debugging/interacting tool

Rib could be used as a kind of debugging tool which you can set break
point
in the source program.

    require 'rib/config' # This would load your Rib config
    require 'rib/more/anchor'
                         # If you enabled anchor in config, then
needed not
    Rib.anchor binding   # This would give you an interactive shell
                         # when your program has been executed here.
    Rib.anchor 123       # You can also anchor on an object.

But this might be called in a loop, you might only want to
enter the shell under certain circumstance, then you'll do:

    require 'rib/debug'
    Rib.enable_anchor do
      # Only `Rib.anchor` called in the block would launch a shell
    end

    Rib.anchor binding # No effect (no-op) outside the block

Anchor could also be nested. The level would be shown on the prompt,
starting from 1.

### In place editing

Whenever you called:

    require 'rib/more/edit'
    Rib.edit

Rib would open an editor according to $EDITOR (`ENV['EDITOR']`) for
you.
After save and leave the editor, Rib would evaluate what you had
input.
This also works inside an anchor. To use it, require either rib/more/
edit
or rib/more or rib/all.

### As a shell framework

The essence is:

    require 'rib'

All others are optional. The core plugins are lying in `rib/core/
*.rb`, and
more plugins are lying in `rib/more/*.rb`. You can read `rib/app/
ramaze.rb`
and `bin/rib-ramaze` as a Rib App reference implementation, because
it's very
simple, simpler than rib-rails.

## CHANGES:

### Rib 1.0.4 -- 2012-03-20

* [core/multiline] Fixed a corner case:

      1/1.to_i +
      1

* [rib] Do not crash because of a loop error. Try to relaunch the
shell.

In This Thread

Prev Next