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

Re: [patch] Use hash for optional args with long argument list in Ruby bindings

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2007-11-13 12:54:37 CET

Hi,

In <ae6cb1100711121923yeb154f8ib3975e34d21a9281@mail.gmail.com>
  "[patch] Use hash for optional args with long argument list in Ruby bindings" on Mon, 12 Nov 2007 19:23:13 -0800,
  "Joe Swatosh" <joe.swatosh@gmail.com> wrote:

> Although I didn't modify Hash for checking like the example from ActiveSupport
> that you showed. It didn't seem right to modify a standard class from the SVN
> bindings.

OK. I agree with you.
I want to define them in Svn::Util.

> Here's hoping this is more like what you had in mind.

Please commit but I have some comments.

> Index: subversion/bindings/swig/ruby/svn/wc.rb
> ===================================================================
> --- subversion/bindings/swig/ruby/svn/wc.rb (revision 27776)
> +++ subversion/bindings/swig/ruby/svn/wc.rb (working copy)
> @@ -307,25 +307,37 @@
> editor
> end
>
> - def update_editor2(target_revision, target, use_commit_times=true,
> - depth=nil, allow_unver_obstruction=false, diff3_cmd=nil,
> - notify_func=nil, cancel_func=nil, traversal_info=nil,
> - preserved_exts=nil)
> - preserved_exts ||= []
> - traversal_info ||= _traversal_info
> + def update_editor2(target_revision, target, options={})

We doesn't need to keep the current update_editor2 API
because 1.4 doesn't have update_editor2 API. If you want to
keep the current update_editor2 API, what about the
following?

  def update_editor2(*args, &block)
    update_editor3(*args, &block) if args.size != 1 and !args.is_a?(Hash)
    options = args[0]
    ... # your code
  end

  def update_editor3(target_revision, target, use_commit_times, ...)
    # the current update_editor3 API
  end

> - def switch_editor2(target_revision, target, switch_url,
> - use_commit_times=true, depth=nil,
> - allow_unver_obstruction=false, diff3_cmd=nil,
> - notify_func=nil, cancel_func=nil, traversal_info=nil,
> - preserved_exts=nil)
> + def switch_editor2(target_revision, target, switch_url, options={})

Same as update_editor2.

Thanks,

--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 13 13:14:53 2007

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.