~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to lib/puppet/interface.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
require 'puppet/util/autoload'
3
3
require 'puppet/interface/documentation'
4
4
require 'prettyprint'
 
5
require 'semver'
5
6
 
6
7
class Puppet::Interface
7
8
  include FullDocs
63
64
      end
64
65
      face
65
66
    end
 
67
 
 
68
    def find_action(name, action, version = :current)
 
69
      Puppet::Interface::FaceCollection.get_action_for_face(name, action, version)
 
70
    end
66
71
  end
67
72
 
68
73
  def set_default_format(format)
84
89
  attr_reader :name, :version
85
90
 
86
91
  def initialize(name, version, &block)
87
 
    unless Puppet::Interface::FaceCollection.validate_version(version)
 
92
    unless SemVer.valid?(version)
88
93
      raise ArgumentError, "Cannot create face #{name.inspect} with invalid version number '#{version}'!"
89
94
    end
90
95
 
91
96
    @name    = Puppet::Interface::FaceCollection.underscorize(name)
92
 
    @version = version
 
97
    @version = SemVer.new(version)
93
98
 
94
99
    # The few bits of documentation we actually demand.  The default license
95
100
    # is a favour to our end users; if you happen to get that in a core face