Re: [PATCH v2 14/44] ruby: bind dwim_ref()
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Sep 29, 2013, 05:24 UTC
- Message-ID
- <CAMP44s2Kd0xUXfRQ07qJ1yvXiUkOmXCMA67wrk4Vg9oN8TRMGQ@mail.gmail.com>
- In-Reply-To
- <CALkWK0mutBpqvu31uZARUFtGzN6zwP4A=915u=xBoc+PXQp+_A@mail.gmail.com>
On Sun, Sep 29, 2013 at 12:17 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 11 quoted lines
> Felipe Contreras wrote:
>> static void git_ruby_init(void)
>> {
>> rb_define_global_function("setup_git_directory", git_rb_setup_git_directory, 0);
>> rb_define_global_function("for_each_ref", git_rb_for_each_ref, 0);
>> + rb_define_global_function("dwim_ref", git_rb_dwim_ref, 1);
>> }
>
> At this point, global functions is probably the way to go. We might
> like to put them in classes to create a beautiful Rugged-inspired API
> in the future.We might, for certain things, but as I explained before, we can't really do the same.
test1 = Rugged::Repository.new("test1") test2 = Rugged::Repository.new("test2")
How are we supposed to do this with Git's code? If Git's code can only work with one repository at a time, I think the Ruby bindings should reflect that as well.
-- Felipe Contreras