I ask a question 'Why need this line?' to the author of the line.

  rb_const_remove(rb_cObject, rb_intern_const("TMP_RUBY_PREFIX"));
  
https://github.com/ruby/ruby/commit/1dcf1174ea2a803e6905a04760121fe1426035b3#L2R1094

He answer:
  It shouldn't be shown at the script level because TMP_RUBY_PREFIX is
used in internal mechanism.

On Nov 14, 12:28 am, mattn <[email protected]> wrote:
> Ah, I notice that code was removed in latest.
> Then, patch become following.
>
> Thanks.
>
> diff -r fae782ef63dd src/if_ruby.c
> --- a/src/if_ruby.c     Thu Sep 30 21:47:56 2010 +0200
> +++ b/src/if_ruby.c     Wed Oct 06 14:20:19 2010 +0900
> @@ -216,6 +216,9 @@
>  # define rb_enc_find_index             dll_rb_enc_find_index
>  # define rb_enc_find                   dll_rb_enc_find
>  # define rb_enc_str_new                        dll_rb_enc_str_new
> +# define rb_intern2                    dll_rb_intern2
> +# define rb_const_remove               dll_rb_const_remove
> +# define Init_prelude                  dll_Init_prelude
>  # define rb_sprintf                    dll_rb_sprintf
>  # define ruby_init_stack               dll_ruby_init_stack
>  #endif
> @@ -302,6 +305,9 @@
>  static int (*dll_rb_enc_find_index) (const char*);
>  static rb_encoding* (*dll_rb_enc_find) (const char*);
>  static VALUE (*dll_rb_enc_str_new) (const char*, long,
> rb_encoding*);
> +static ID (*dll_rb_intern2) (const char*, long);
> +static void (*dll_Init_prelude) (void);
> +static VALUE (*dll_rb_const_remove) (VALUE, ID);
>  static VALUE (*dll_rb_sprintf) (const char*, ...);
>  static void (*ruby_init_stack)(VALUE*);
>  #endif
> @@ -409,6 +415,9 @@
>      {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index},
>      {"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find},
>      {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new},
> +    {"rb_intern2", (RUBY_PROC*)&dll_rb_intern2},
> +    {"rb_const_remove", (RUBY_PROC*)&dll_rb_const_remove},
> +    {"Init_prelude", (RUBY_PROC*)&dll_Init_prelude},
>      {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf},
>      {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
>  #endif
> @@ -646,6 +655,10 @@
>             ruby_io_init();
>  #ifdef RUBY19_OR_LATER
>             rb_enc_find_index("encdb");
> +
> +           rb_define_module("Gem");
> +           Init_prelude();
>  #endif
>             ruby_vim_init();
>             ruby_initialized = 1;
>
> On Nov 11, 9:39 am, mattn <[email protected]> wrote:
>
>
>
>
>
>
>
> > This code is included in 'ruby.c'. Perhaps, cause is similarly
> > following (I guess).
>
> >    http://osdir.com/ml/ruby-core/2010-03/msg00337.html
>
> > This workaround code remove the const for re-define one. (I guess)
>
> > - Yasuhiro Matsumoto
>
> > On Nov 11, 2:56 am, Bram Moolenaar <[email protected]> wrote:
>
> > > Yasuhiro Matsumoto wrote:
> > > > TMP_RUBY_PREFIX is sets incorrect values in gem prelude when ruby is
> > > > installed
> > > > in HOME.
>
> > > That sounds like a bit of a hack.  Can you explain this further?
>
> > > The Ruby interface (like the Python interface) is a bit brittle, since a
> > > lot of this code isn't properly documented and is changed by people who
> > > don't know about or don't care about integration of the interpreter in
> > > other programs.  We need to be careful.
>
> > > --
> > > It is illegal for a driver to be blindfolded while operating a vehicle.
> > >                 [real standing law in Alabama, United States of America]
>
> > >  /// Bram Moolenaar -- [email protected] --http://www.Moolenaar.net \\\
> > > ///        sponsor Vim, vote for features --http://www.Vim.org/sponsor/\\\
> > > \\\        download, build and distribute --http://www.A-A-P.org      ///
> > >  \\\            help me help AIDS victims --http://ICCF-Holland.org  ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui