Sha256: 465629121e1635f4277ee4d6b939b9a5e637c0d0e8f3198c396d38d8707928ba

Contents?: true

Size: 821 Bytes

Versions: 1

Compression:

Stored size: 821 Bytes

Contents

require "yaml" unless defined?(YAML)

module LVM
  module Attributes
    VERSION = "0.3.11".freeze

    def load(version, name)
      cwd = __dir__

      # was going to be symlinks, but RubyGems didn't seem to want to package
      # them
      if version == "2.02.28"
        version = "2.02.27"
      elsif ((31..39).map { |x| "2.02.#{x}" }).include?(version)
        version = "2.02.30"
      end

      file = File.join(cwd, "attributes", version, name)

      begin
        YAML.load_file(file)
      rescue Errno::ENOENT => e
        raise ArgumentError.new("Unable to load lvm attributes [#{name}] for version [#{version}]. " \
          "The version/object may not be supported or you may need to upgrade the chef-ruby-lvm-attrib gem. Error [#{e.message}]")
      end
    end
    module_function :load
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chef-ruby-lvm-attrib-0.3.11 lib/lvm/attributes.rb