diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-19 18:22:03 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-20 13:31:49 -0700 |
| commit | 33b5580ef6b6c851beb6852e56659afea8bb0b04 (patch) | |
| tree | 527808c32b7dff61d603492aec981f932c44e641 /lib/puppet | |
| parent | 40a5bca736a31784d341aef389edfdde915938ec (diff) | |
| download | puppet-33b5580ef6b6c851beb6852e56659afea8bb0b04.tar.gz puppet-33b5580ef6b6c851beb6852e56659afea8bb0b04.tar.xz puppet-33b5580ef6b6c851beb6852e56659afea8bb0b04.zip | |
maint: move method comments outside the comment.
The comment discussing the purpose of the wrapper and related details rightly
belongs outside the method; move it there so it doesn't perturb the functional
changes that follow.
Reviewed-By: Max Martin <max@puppetlabs.com>
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/interface/action.rb | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb index 23366b407..e644d8999 100644 --- a/lib/puppet/interface/action.rb +++ b/lib/puppet/interface/action.rb @@ -129,27 +129,26 @@ class Puppet::Interface::Action # @face.send(name, *args, &block) # end + + # We need to build an instance method as a wrapper, using normal code, to be + # able to expose argument defaulting between the caller and definer in the + # Ruby API. An extra method is, sadly, required for Ruby 1.8 to work since + # it doesn't expose bind on a block. + # + # Hopefully we can improve this when we finally shuffle off the last of Ruby + # 1.8 support, but that looks to be a few "enterprise" release eras away, so + # we are pretty stuck with this for now. + # + # Patches to make this work more nicely with Ruby 1.9 using runtime version + # checking and all are welcome, provided that they don't change anything + # outside this little ol' bit of code and all. + # + # Incidentally, we though about vendoring evil-ruby and actually adjusting + # the internal C structure implementation details under the hood to make + # this stuff work, because it would have been cleaner. Which gives you an + # idea how motivated we were to make this cleaner. Sorry. + # --daniel 2011-03-31 def when_invoked=(block) - # We need to build an instance method as a wrapper, using normal code, to - # be able to expose argument defaulting between the caller and definer in - # the Ruby API. An extra method is, sadly, required for Ruby 1.8 to work. - # - # In future this also gives us a place to hook in additional behaviour - # such as calling out to the action instance to validate and coerce - # parameters, which avoids any exciting context switching and all. - # - # Hopefully we can improve this when we finally shuffle off the last of - # Ruby 1.8 support, but that looks to be a few "enterprise" release eras - # away, so we are pretty stuck with this for now. - # - # Patches to make this work more nicely with Ruby 1.9 using runtime - # version checking and all are welcome, but they can't actually help if - # the results are not totally hidden away in here. - # - # Incidentally, we though about vendoring evil-ruby and actually adjusting - # the internal C structure implementation details under the hood to make - # this stuff work, because it would have been cleaner. Which gives you an - # idea how motivated we were to make this cleaner. Sorry. --daniel 2011-03-31 internal_name = "#{@name} implementation, required on Ruby 1.8".to_sym file = __FILE__ + "+eval" |
