lib/locat/command.rb
# Access to .index metadata. This only really cares about
# the `title` field (at this point). If no `.index` file
# is found, the title is set to the basename of the current
# working directory.
Access to .index metadata. This only really cares about
the `title` field (at this point). If no `.index` file
is found, the title is set to the basename of the current
working directory.
Access to . index metadata . This only really cares about the ` title ` field ( at this point ) . If no ` . index ` file is found the title is set to the basename of the current working directory .
def metadata
      @metadata ||= (
        if File.file?('.index')
          data = YAML.load(File.new('.index'))
        else
          data = {}
        end
        data['title'] = title if title
        data
      )
    end
def metadata @metadata ||= ( if File . file? ( '.index' ) data = YAML . load ( File . new ( '.index' ) ) else data = { } end data [ 'title' ] = title if title data ) end
Access to .index metadata.
Access to . index metadata .