diff options
| author | Dominic Maraglia <dominic@puppetlabs.com> | 2011-08-03 15:43:20 -0700 |
|---|---|---|
| committer | Dominic Maraglia <dominic@puppetlabs.com> | 2011-08-03 15:43:20 -0700 |
| commit | e45f08bf1fef8842554ca0d8cb6fb13711e888e7 (patch) | |
| tree | 9bb476a0fe381d53060abc1f1c240cf1291b2ee4 /lib/puppet/interface.rb | |
| parent | a97c86e7d01384aa06f5d4d69da427fc355aebe7 (diff) | |
| parent | c833fde370d43023f52c8f2e11fd77e720d0f577 (diff) | |
| download | puppet-e45f08bf1fef8842554ca0d8cb6fb13711e888e7.tar.gz puppet-e45f08bf1fef8842554ca0d8cb6fb13711e888e7.tar.xz puppet-e45f08bf1fef8842554ca0d8cb6fb13711e888e7.zip | |
Merge branch 'master' of github.com:puppetlabs/puppet
Diffstat (limited to 'lib/puppet/interface.rb')
| -rw-r--r-- | lib/puppet/interface.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb index 6be8b6930..eba99d6be 100644 --- a/lib/puppet/interface.rb +++ b/lib/puppet/interface.rb @@ -2,6 +2,7 @@ require 'puppet' require 'puppet/util/autoload' require 'puppet/interface/documentation' require 'prettyprint' +require 'semver' class Puppet::Interface include FullDocs @@ -63,6 +64,10 @@ class Puppet::Interface end face end + + def find_action(name, action, version = :current) + Puppet::Interface::FaceCollection.get_action_for_face(name, action, version) + end end def set_default_format(format) @@ -84,12 +89,12 @@ class Puppet::Interface attr_reader :name, :version def initialize(name, version, &block) - unless Puppet::Interface::FaceCollection.validate_version(version) + unless SemVer.valid?(version) raise ArgumentError, "Cannot create face #{name.inspect} with invalid version number '#{version}'!" end @name = Puppet::Interface::FaceCollection.underscorize(name) - @version = version + @version = SemVer.new(version) # The few bits of documentation we actually demand. The default license # is a favour to our end users; if you happen to get that in a core face |
