maca / arguments

You don't have to wait until Ruby 2.0 to get (named|keyword) arguments. Has been tested with 1.8.6 and 1.9.1. Plausible alternative to options hash.

This URL has Read+Write access

arguments / History.txt
100644 23 lines (15 sloc) 0.897 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
== 0.4 2009-06-30
 
* 1 major enhancement:
  * Initial release
  * Works with Ruby 1.8.6 and 1.9.1
 
== 0.4.2 2009-07-03
 
* Fixed a Bug where not passing arguments would rise try to call #key? on nil
 
== 0.4.3 2009-07-07
 
* Fixed a serious bug where default values could not be overriden by passing arguments without keyword
 
== 0.6 2009-08-06
 
* Fixed a bug where converting a block to proc argument using ampersand would blow method call
* Passing a keyword not corresponding to an argument name raises an error
* Using RubyParser in Ruby 1.9.1 instead of Regexp to extract argument names and default values
* Method definition that uses splat operator is now ignored
* Last Hash argument is not used for assigning argument values if total number of arguments has been passed
* named_arguments_for can be called passing a Class method name eg: named_args_for :instance_method, 'self.class_method'