summaryrefslogtreecommitdiffstats
path: root/lib/puppet/interface.rb
diff options
context:
space:
mode:
authorMichael Stahnke <stahnma@puppetlabs.com>2011-08-05 09:23:49 -0700
committerMichael Stahnke <stahnma@puppetlabs.com>2011-08-05 09:23:49 -0700
commit3daea902b29cfd8e126ed64247ddf28aa5ad3d76 (patch)
treecda7fff4d06c7f3607a84b260fd71adfd9704e3b /lib/puppet/interface.rb
parentc8835ad0275c350b57884b81e485d9fc16699a21 (diff)
parent2185bb2804aeef6b419667951b2157b01404c694 (diff)
downloadpuppet-3daea902b29cfd8e126ed64247ddf28aa5ad3d76.tar.gz
puppet-3daea902b29cfd8e126ed64247ddf28aa5ad3d76.tar.xz
puppet-3daea902b29cfd8e126ed64247ddf28aa5ad3d76.zip
Merge branch '2.7.x' into 2.7rc
Diffstat (limited to 'lib/puppet/interface.rb')
-rw-r--r--lib/puppet/interface.rb9
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