[#30589] [Bug #3391] Use single exclamation mark instead of double exclamation mark for IRB — Diego Viola <redmine@...>

Bug #3391: Use single exclamation mark instead of double exclamation mark for IRB

10 messages 2010/06/04

[#30672] [Bug #3411] Time.local 1916,5,1 #=> 1916-04-30 23:00:00 +0100 — Benoit Daloze <redmine@...>

Bug #3411: Time.local 1916,5,1 #=> 1916-04-30 23:00:00 +0100

12 messages 2010/06/08

[#30699] [Bug #3419] 1.9.2-preview3 possible bug with Rails 3 active_record sqlite_adapter — Joe Sak <redmine@...>

Bug #3419: 1.9.2-preview3 possible bug with Rails 3 active_record sqlite_adapter

9 messages 2010/06/09

[#30734] [Bug #3428] ri outputs ansi escape sequences even when stdout is not a tty — caleb clausen <redmine@...>

Bug #3428: ri outputs ansi escape sequences even when stdout is not a tty

11 messages 2010/06/11

[#30756] [Feature #3436] Spawn the timer thread lazily — Maximilian Gass <redmine@...>

Feature #3436: Spawn the timer thread lazily

15 messages 2010/06/13
[#32686] [Ruby 1.9-Feature#3436] Spawn the timer thread lazily — Mark Somerville <redmine@...> 2010/10/04

Issue #3436 has been updated by Mark Somerville.

[ruby-core:30722] [Feature #3424] Source code interaction. [new ideas for ruby 2]

From: Eloy Esp <redmine@...>
Date: 2010-06-10 22:27:16 UTC
List: ruby-core #30722
Feature #3424: Source code interaction. [new ideas for ruby 2]
http://redmine.ruby-lang.org/issues/show/3424

Author: Eloy Esp
Status: Open, Priority: Low
Category: core

I have some ideas that I think can do Ruby even better, but I cannot implement those, because I'm not C programer and I cannot do it. (sorry about that).

Resumed: In general my idea is to implement some methods in Ruby core to interact with the source code.
This could enhance irb, and could develop the idea of *interactive programing*, which means you would write your programs interacting with it.

Some things I would like to see in ruby:
---------------------------------------
Ruby is an scripting language, meaning it does not compile to work, then there are certain things that are possible, like irb, this is, you can write ruby in a console like sistem. This is good, but could be better.

First idea: Source integration with ruby.

supose I wrote:

# dog.rb
class Dog
  # Make the dog happy
  def bark
    puts "Dog is barking"
  end
end

Now, what I do to read about the class Dog? I have to open dog.rb in a text editor. But ruby is reading the source. There could be a method in the class Dog (in Object I thing) that give me access to the source code, something like:

# reading.rb
puts Dog.source
=> "def bark ; puts "Dog is barking" ; end"

Think about using this in IRB in a rails proyect, where the classes are defined in 30 files or more, and you have to look through files that ruby have read, know perfectly when a method has been re-defined, etc.

It don't look like usefull? Then I can think some more usefullness...

Second: Rdoc integration

# help.rb
Dog.method(:bark).RDoc
=> "Make the dog barking"

We have to remember that the source code is right there, it has not been compiled and probably never will, so are the comments.

---
Thanks for reading, and sorry if it is not the place, feel free to correct or delete this message.

El_Hoy

postscript: I think ruby could be the next standard shell and in this way is my mind thinking to improve irb. Also I thinking that the idea of interactive programing could become realy interesting.


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next