Load the metadata and set the @metadata instance variable.

 @raise [ArgumentError]
   if there is no metadata.rb

 @return [String]
   the path to the metadata file
975212
def load_metadata!
        metadata_path = File.join(path, 'metadata.rb')

        @metadata = Stove::Cookbook::Metadata.from_file(metadata_path)
        @name     = @metadata.name
        @version  = @metadata.version

        metadata_path
      end
839631
def complete(metadata = {}, options = {})
      unless completable? || options.fetch(:force, false)
        raise NotCompletable.new(not_completable_error_message)
      end
      with_hooks(:update, metadata, options) do
        with_hooks(:complete, metadata, options) do
          proceed_workitem
          log(:complete, metadata)
        end
      end
    end
543085
def meta(self):
        
        path = find_dataset_path(
            self.name, data_home=self.data_home, fname="meta.json", raises=False
        )
        if path is None:
            return None

        with open(path, 'r') as f:
            return json.load(f)
231033
def extract_metadata
      raise ArgumentError, "MIME type unspecified or not configured" if schema.blank?
      fn = "extract_#{schema.downcase}_metadata"
      raise ArgumentError, "Unsupported metadata standard: #{schema}" unless respond_to?(fn.to_sym)
      send(fn, metadata_xml)
    end
921523
def load_config_file(config_file = nil)
      curated_file = nil

      if config_file
        f = File.expand_path(config_file)
        if File.exists?(f)
          curated_file = f
        else
          raise "Supplied config file (#{config_file}) doesn't seem to exist"
        end
      else
        locations_to_try.each do |possible_conf_file|
          f = File.expand_path(possible_conf_file)
          if File.exists?(f)
            curated_file = f
            break
          end
        end

        if curated_file.nil?
          show_config_file_suggestion

          return YAML.load(get_example_config)
        end
      end

      YAML.load_file(curated_file).tap do |config|
        raise "This is an invalid configuration file!" unless config.class == Hash
      end
    end
510179
def _load(self):
        
        if self.is_exists():
            return open(self._ref, "rb").read()
        raise NotFoundError("File %s not found" % self._ref)
1125744
def load!(path, environment = nil)
      require 'yaml'
      environment ||= Rails.env
      conf = YAML.load(File.new(path).read).with_indifferent_access[environment]
      load_configuration(conf)
    end
166111
def get(self, url):
        
        self._load(url)
        self._flush()

        return self.metadata[url]
708794
def extract_metadata
      @metadata = {}

      convert do |current|
        current.each_line.drop_while do |line|
          next false if line !~ /^#\+([a-z_]+): (.*)/

          key, value = $1, $2
          @metadata[key.to_sym] = value
        end.join('')
      end
    end
309134
def metadata(self):
        """"""
        self.metadata_path = os.path.join(self.path, 'metadata.rb')
        if not os.path.isfile(self.metadata_path):
            raise ValueError("Cookbook needs metadata.rb, %s"
                             % self.metadata_path)

        if not self._metadata:
            self._metadata = MetadataRb(open(self.metadata_path, 'r+'))

        return self._metadata
588156
def metadata
      {:definitions => representer_attrs.grep(Definition).map {|definition| definition.name},
       :links => representer_attrs.grep(Link).map {|link| link.options[:as] ? {link.rel => {'as' => link.options[:as]}} : link.rel}
      }
    end
418052
def module_root
      metadata_path = find_upwards('metadata.json')
      if metadata_path
        File.dirname(metadata_path)
      elsif in_module_root?
        Dir.pwd
      else
        nil
      end
    end
1236086
def metadata=(metadata)
      @metadata = metadata.map { |k, str| [k, str.to_s] }.to_h
    end
680769
def add(path)
      return true unless File.exist?(path)

      metadata[path] = {
        "mtime" => File.mtime(path),
        "deps"  => [],
      }
      cache[path] = true
    end
1085001
def set_metadata(self, queue, metadata, clear=False):
        
        uri = "/%s/%s/metadata" % (self.uri_base, utils.get_id(queue))
        if clear:
            curr = {}
        else:
            curr = self.get_metadata(queue)
        curr.update(metadata)
        resp, resp_body = self.api.method_put(uri, body=curr)
1221709
def get_metadata(self):
        
        metadata_path = "{}/{}/{}".format(self.url,
                                          self.metadata_dir,
                                          self.metadata_file)
        metadata_sig_path = "{}/{}/{}.sig".format(self.url.rstrip('/'),
                                                  self.metadata_dir,
                                                  self.metadata_file)
        # load metadata
        req = requests.get(metadata_path)
        if req.status_code is 200:
            raw_metadata = req.content
        else:
            raise RepositoryError(metadata_path, ("status code not 200: "
                                                  "{}".format(req.status_code)))

        if self.gpg_verify:
            self.verify_data_signature(metadata_sig_path, metadata_path,
                                       raw_metadata)

        return self.parse_metadata(raw_metadata)
262033
def hash_attr(attr, metadata={})
      add_attribute(attr, :hash, metadata)
      define_method("#{attr}=") do |arg|
        instance_variable_set("@#{attr}", arg || {})
      end
    end