Sha256: d0c9b8fd367f18be3ce310c59e177d3b1b8adaea686872bc2bfce56331b663d6

Contents?: true

Size: 846 Bytes

Versions: 1

Compression:

Stored size: 846 Bytes

Contents

require "yaml"

module LVM
  module Attributes
    VERSION = "0.3.1".freeze

    def load(version, name)
      cwd = File.dirname(__FILE__)

      # 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 # module Attributes
end # module LVM

Version data entries

1 entries across 1 versions & 1 rubygems

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