diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-19 10:34:05 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-19 10:34:05 -0700 |
| commit | a594563919a2342e1ea542f8f18ed187ab9ecad3 (patch) | |
| tree | 59bb906fd3206ac58289f58ff80b9d59fe60ab4b /lib/puppet/interface | |
| parent | 9adcb194a75df4e0f0570c20bfa90686ed078265 (diff) | |
| parent | 4efba7148a79fcd099b4eb9bd17cbb2d785f5fb8 (diff) | |
| download | puppet-a594563919a2342e1ea542f8f18ed187ab9ecad3.tar.gz puppet-a594563919a2342e1ea542f8f18ed187ab9ecad3.tar.xz puppet-a594563919a2342e1ea542f8f18ed187ab9ecad3.zip | |
Merge branch 'bug/2.7.x/7132-a-summary-with-a-newline-is-accepted' into 2.7.x
Diffstat (limited to 'lib/puppet/interface')
| -rw-r--r-- | lib/puppet/interface/action.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb index 412e39449..f6273d1c2 100644 --- a/lib/puppet/interface/action.rb +++ b/lib/puppet/interface/action.rb @@ -24,8 +24,21 @@ class Puppet::Interface::Action attr_reader :name def to_s() "#{@face}##{@name}" end - attr_accessor :default, :summary + attr_accessor :default + ######################################################################## + # Documentation stuff, whee! + attr_accessor :summary, :description + def summary=(value) + value = value.to_s + value =~ /\n/ and + raise ArgumentError, "Face summary should be a single line; put the long text in 'description' instead." + + @summary = value + end + + + ######################################################################## # Initially, this was defined to allow the @action.invoke pattern, which is # a very natural way to invoke behaviour given our introspection # capabilities. Heck, our initial plan was to have the faces delegate to |
