~ubuntu-branches/ubuntu/precise/facter/precise

« back to all changes in this revision

Viewing changes to lib/facter.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-11-06 00:52:19 UTC
  • mfrom: (1.1.6 upstream) (3.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091106005219-6ccua0q7b885z2ad
Tags: 1.5.6-2ubuntu1
* Merge from debian testing, remaining changes:
  - Use bind9-host9 only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    include Comparable
28
28
    include Enumerable
29
29
 
30
 
    FACTERVERSION = '1.5.4'
31
 
        # = Facter
 
30
    FACTERVERSION = '1.5.6'
 
31
    # = Facter
32
32
    # Functions as a hash of 'facts' you might care about about your
33
33
    # system, such as mac address, IP address, Video card, etc.
34
34
    # returns them dynamically
35
35
 
36
 
        # == Synopsis
37
 
        #
 
36
    # == Synopsis
 
37
    #
38
38
    # Generally, treat <tt>Facter</tt> as a hash:
39
39
    # == Example
40
40
    # require 'facter'
49
49
    RESET = ""
50
50
    @@debug = 0
51
51
 
52
 
        # module methods
 
52
    # module methods
53
53
 
54
54
    def self.collection
55
55
        unless defined?(@collection) and @collection
147
147
        Facter.reset
148
148
    end
149
149
 
150
 
        # Set debugging on or off.
151
 
        def self.debugging(bit)
152
 
                if bit
 
150
    # Set debugging on or off.
 
151
    def self.debugging(bit)
 
152
        if bit
153
153
            case bit
154
154
            when TrueClass; @@debug = 1
155
155
            when FalseClass; @@debug = 0
168
168
            else
169
169
                @@debug = 0
170
170
            end
171
 
                else
172
 
                        @@debug = 0
173
 
                end
174
 
        end
 
171
        else
 
172
            @@debug = 0
 
173
        end
 
174
    end
175
175
 
176
176
    # Remove them all.
177
177
    def self.reset