Sha256: 1097d02c06f4a38c716289f95fd030f6aadb7ebb965ff60be6b5f076ec75edf0

Contents?: true

Size: 862 Bytes

Versions: 26

Compression:

Stored size: 862 Bytes

Contents

# This provides an alias for RbConfig to Config for versions of Ruby older then
# version 1.8.5. This allows us to use RbConfig in place of the older Config in
# our code and still be compatible with at least Ruby 1.8.1.
require 'rbconfig'
require 'enumerator'

unless defined? ::RbConfig
  ::RbConfig = ::Config
end

module Facter
  module Util
    module MonkeyPatches
      module Lines
        def lines(separator = $/)
          if block_given?
            self.each_line(separator) {|line| yield line }
            return self
          else
            return enum_for(:each_line, separator)
          end
        end
      end
    end
  end
end

public
class String
  unless method_defined? :lines
    include Facter::Util::MonkeyPatches::Lines
  end
end

class IO
  unless method_defined? :lines
    include Facter::Util::MonkeyPatches::Lines
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
facter-1.7.6 lib/facter/util/monkey_patches.rb
facter-1.7.5 lib/facter/util/monkey_patches.rb
facter-1.7.5.rc2 lib/facter/util/monkey_patches.rb
facter-1.7.5.rc1 lib/facter/util/monkey_patches.rb
facter-1.7.4 lib/facter/util/monkey_patches.rb
facter-1.7.4.rc1 lib/facter/util/monkey_patches.rb
facter-1.7.3 lib/facter/util/monkey_patches.rb
facter-1.7.3.rc1 lib/facter/util/monkey_patches.rb
facter-1.7.2 lib/facter/util/monkey_patches.rb
facter-1.7.2.rc1 lib/facter/util/monkey_patches.rb
facter-1.7.1 lib/facter/util/monkey_patches.rb
facter-1.7.1.rc1 lib/facter/util/monkey_patches.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/lib/facter/util/monkey_patches.rb
facter-1.7.0 lib/facter/util/monkey_patches.rb
facter-1.7.0.rc2 lib/facter/util/monkey_patches.rb
facter-1.7.0.rc1 lib/facter/util/monkey_patches.rb
facter-1.6.18 lib/facter/util/monkey_patches.rb
facter-1.6.18.rc1 lib/facter/util/monkey_patches.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/lib/facter/util/monkey_patches.rb
facter-1.6.17 lib/facter/util/monkey_patches.rb