def load_metadata
      version = if respond_to?(:chef_version)
                  chef_version
                else
                  Linter::DEFAULT_CHEF_VERSION
                end
      metadata_path = [version, version.sub(/\.[a-z].*/, ""),
        Linter::DEFAULT_CHEF_VERSION].map do |ver|
          metadata_path(ver)
        end.find { |m| File.exist?(m) }
      @dsl_metadata ||= FFI_Yajl::Parser.parse(IO.read(metadata_path),
                                           symbolize_keys: true)
    end
def load_metadata
      version = if respond_to?(:chef_version)
                  chef_version
                else
                  Linter::DEFAULT_CHEF_VERSION
                end
      metadata_path = [version, version.sub(/\.[a-z].*/, ""),
        Linter::DEFAULT_CHEF_VERSION].map do |ver|
          metadata_path(ver)
        end.find { |m| File.exist?(m) }
      @dsl_metadata ||= FFI_Yajl::Parser.parse(IO.read(metadata_path),
                                           symbolize_keys: true)
    end
To avoid the runtime hit of loading the Chef gem and its dependencies
 we load the DSL metadata from a JSON file shipped with our gem.

 The DSL metadata doesn't necessarily reflect the version of Chef in the
 local user gemset.