Professional Web Applications Themes

Irb Ri integration (Was: An assimilators guide to Python?) - Ruby

Hi, At Thu, 5 Feb 2004 21:05:39 +0900, Gavri Savio Fernandez wrote in [ruby-talk:91613]:  > > it's a pending RCR > > http://rcrchive.net/rcr/RCR/RCR197 > Abstract: Add a help() function to irb that would invoke ri on any module.[/ref] A quick hack. Index: lib/irb/extend-command.rb ================================================== ================= RCS file: /cvs/ruby/src/ruby/lib/irb/extend-command.rb,v retrieving revision 1.4 diff -u -2 -p -d -r1.4 extend-command.rb --- lib/irb/extend-command.rb 29 Jul 2002 06:14:08 -0000 1.4 +++ lib/irb/extend-command.rb 5 Feb 2004 12:43:03 -0000 -101,4 +101,7 module IRB [:irb_kill, :Kill, "irb/cmd/subirb", [:kill, OVERRIDE_PRIVATE_ONLY]], + + [:irb_help, :Help, "irb/cmd/help", + [:help, NO_OVERRIDE]], ] Index: lib/irb/cmd/help.rb ================================================== ================= RCS file: lib/irb/cmd/help.rb diff -N ...

  1. #1

    Default Re: Irb Ri integration (Was: An assimilators guide to Python?)

    Hi,

    At Thu, 5 Feb 2004 21:05:39 +0900,
    Gavri Savio Fernandez wrote in [ruby-talk:91613]: 
    >
    > it's a pending RCR
    >
    > http://rcrchive.net/rcr/RCR/RCR197
    > Abstract: Add a help() function to irb that would invoke ri on any module.[/ref]

    A quick hack.


    Index: lib/irb/extend-command.rb
    ================================================== =================
    RCS file: /cvs/ruby/src/ruby/lib/irb/extend-command.rb,v
    retrieving revision 1.4
    diff -u -2 -p -d -r1.4 extend-command.rb
    --- lib/irb/extend-command.rb 29 Jul 2002 06:14:08 -0000 1.4
    +++ lib/irb/extend-command.rb 5 Feb 2004 12:43:03 -0000
    -101,4 +101,7 module IRB
    [:irb_kill, :Kill, "irb/cmd/subirb",
    [:kill, OVERRIDE_PRIVATE_ONLY]],
    +
    + [:irb_help, :Help, "irb/cmd/help",
    + [:help, NO_OVERRIDE]],
    ]

    Index: lib/irb/cmd/help.rb
    ================================================== =================
    RCS file: lib/irb/cmd/help.rb
    diff -N lib/irb/cmd/help.rb
    --- /dev/null 1 Jan 1970 00:00:00 -0000
    +++ lib/irb/cmd/help.rb 5 Feb 2004 12:48:02 -0000
    -0,0 +1,23
    +require 'rdoc/ri/ri_driver'
    +
    +module IRB
    + module ExtendCommand
    + module Help
    + begin
    + ri = RiDriver.new
    + rescue SystemExit
    + else
    + def self.execute(context, *names)
    + names.each do |name|
    + begin
    + ri.get_info_for(name.to_s)
    + rescue RiError
    + puts $!.message
    + end
    + end
    + nil
    + end
    + end
    + end
    + end
    +end


    --
    Nobu Nakada


    nobu.nokada@softhome.net Guest

  2. #2

    Default Re: Irb Ri integration (Was: An assimilators guide to Python?)

    Hi,

    In message "Re: Irb Ri integration (Was: An assimilators guide to Python?)"
    on 04/02/05, net <net> writes:
    |> http://rcrchive.net/rcr/RCR/RCR197
    |> Abstract: Add a help() function to irb that would invoke ri on any module.
    |
    |A quick hack.

    Interesting. Can you commit?

    matz.


    Yukihiro Guest

  3. #3

    Default Re: Irb Ri integration (Was: An assimilators guide to Python?)

    Hi,

    At Fri, 6 Feb 2004 00:21:40 +0900,
    Yukihiro Matsumoto wrote in [ruby-talk:91617]: 

    What about 1.8?

    --
    Nobu Nakada


    nobu.nokada@softhome.net Guest

  4. #4

    Default Re: Irb Ri integration (Was: An assimilators guide to Python?)

    Hi,

    In message "Re: Irb Ri integration (Was: An assimilators guide to Python?)"
    on 04/02/06, net <net> writes:

    |> Interesting. Can you commit?
    |
    |What about 1.8?

    Let us see a while before backporting.

    matz.


    Yukihiro Guest

Similar Threads

  1. PHP vs. Python for the web
    By Unknown in forum PHP Development
    Replies: 6
    Last Post: April 16th, 11:55 AM
  2. PYTHON, ODBC
    By mstory@uchicago.edu in forum PostgreSQL / PGSQL
    Replies: 5
    Last Post: January 9th, 07:47 PM
  3. An assimilators guide to Python?
    By Josef in forum Ruby
    Replies: 8
    Last Post: February 5th, 08:50 PM
  4. Python vs. Ruby
    By Fred in forum Ruby
    Replies: 39
    Last Post: September 3rd, 06:30 PM
  5. Replies: 1
    Last Post: August 23rd, 10:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139