[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r28018 - trunk/subversion/bindings/swig/ruby/svn

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2007-11-26 11:39:45 CET

Hi,

In <ae6cb1100711251637v5399039fn3dd4e0893f776d0a@mail.gmail.com>
  "Re: svn commit: r28018 - trunk/subversion/bindings/swig/ruby/svn" on Sun, 25 Nov 2007 16:37:23 -0800,
  "Joe Swatosh" <joe.swatosh@gmail.com> wrote:

> > Author: joeswatosh
> > Date: Sun Nov 25 16:20:47 2007
> > New Revision: 28018
> >
> > Log:
> > Duplication reduction by using Svn::Wc::AdmAccess#update_editor2 to implement
> > update_editor, and Svn::Wc::AdmAccess#switch_editor2 to implement
> > switch_editor.
> >
> > * subversion/bindings/swig/ruby/svn/wc.rb
> > (Svn::Wc::AdmAccess#update_editor): Implement with update_editor2.
> > (Svn::Wc::AdmAccess#switch_editor): Implement with switch_editor2.
>
> This is better, but it still duplicates the defaults. Maybe we should
> consider the defaults as a constant hash again?

What about that we change all default argument values of
update_editor to nil and remove nil value argument from
update_editor2 arguments?

  def update_editor(xxx, yyy=nil, zzz=nil, ...)
    update_editor2(:xxx => xxx, :yyy => yyy, :zzz => zzz, ...)
  end

  def update_editor2(arguments={})
    ...
    arguments = arguments.reject {|k, v| v.nil?}
    arguments = optional_arguments_defaults.merge(arguments)
    ...
  end

Thanks,

--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 26 11:40:04 2007

This is an archived mail posted to the Subversion Dev mailing list.