Module: Indexer::Attributes

Included in:
Metadata, Validator
Defined in:
lib/indexer/attributes.rb

Overview

The Attributes module defines all of the accepted metadata fields.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alternativesObject

A list of packages that provide more or less the same functionality. A good example is for a markdown library.

alternatives: - rdiscount - redcarpet - BlueCloth



118
119
120
# File 'lib/indexer/attributes.rb', line 118

def alternatives
  @alternatives
end

#authorsObject

The authors of the project The first author should be the primary contact.



72
73
74
# File 'lib/indexer/attributes.rb', line 72

def authors
  @authors
end

#categoriesObject

Categories can be used to help clarify the purpose of a project, e.g. testing or rest. There are no standard categories, just use common sense. Categories must be single-line strings. When comparisons are made they will be downcased.



131
132
133
# File 'lib/indexer/attributes.rb', line 131

def categories
  @categories
end

#codenameObject

The nick name for the particular version, e.g. "Lucid Lynx".



50
51
52
# File 'lib/indexer/attributes.rb', line 50

def codename
  @codename
end

#conflictsObject

The packages with which this project cannot function.



121
122
123
# File 'lib/indexer/attributes.rb', line 121

def conflicts
  @conflicts
end

#copyrightsObject

The copyrights and licenses of the project.



68
69
70
# File 'lib/indexer/attributes.rb', line 68

def copyrights
  @copyrights
end

#createdObject

The date the project was started.



141
142
143
# File 'lib/indexer/attributes.rb', line 141

def created
  @created
end

#customsObject

The names of any user-defined fields.



148
149
150
# File 'lib/indexer/attributes.rb', line 148

def customs
  @customs
end

#dateObject

The date of this version.



53
54
55
# File 'lib/indexer/attributes.rb', line 53

def date
  @date
end

#descriptionObject

The project description



62
63
64
# File 'lib/indexer/attributes.rb', line 62

def description
  @description
end

#enginesObject

List of language engine/version family supported.



98
99
100
# File 'lib/indexer/attributes.rb', line 98

def engines
  @engines
end

#install_messageObject

The post-installation message.



138
139
140
# File 'lib/indexer/attributes.rb', line 138

def install_message
  @install_message
end

#nameObject

The name of the project



44
45
46
# File 'lib/indexer/attributes.rb', line 44

def name
  @name
end

#namespaceObject

The toplevel namespace of API, e.g. module Foo or class Bar. NOTE: how to best handle this?



145
146
147
# File 'lib/indexer/attributes.rb', line 145

def namespace
  @namespace
end

#organizationsObject

The organizations involved with the project.



75
76
77
# File 'lib/indexer/attributes.rb', line 75

def organizations
  @organizations
end

#pathsObject

Map of path sets which can be used to identify paths within the project. The actual path keys largely depend on the project type, but in general should reflect the FHS,

For example, the lib path key is used by Ruby projects to designate which project paths to search within when requiring files.



95
96
97
# File 'lib/indexer/attributes.rb', line 95

def paths
  @paths
end

#platformsObject

List of platforms supported.



101
102
103
# File 'lib/indexer/attributes.rb', line 101

def platforms
  @platforms
end

#repositoriesObject

The repository URLs for the project.



81
82
83
# File 'lib/indexer/attributes.rb', line 81

def repositories
  @repositories
end

#requirementsObject

The packages this package requires to function.



108
109
110
# File 'lib/indexer/attributes.rb', line 108

def requirements
  @requirements
end

#resourcesObject

The resource locators for the project.



78
79
80
# File 'lib/indexer/attributes.rb', line 78

def resources
  @resources
end

#revisionObject

The revision of ruby meta specification.



31
32
33
# File 'lib/indexer/attributes.rb', line 31

def revision
  @revision
end

#sourcesObject

Files from which to import metadata.



41
42
43
# File 'lib/indexer/attributes.rb', line 41

def sources
  @sources
end

#suiteObject

The suite to which the project belongs.



65
66
67
# File 'lib/indexer/attributes.rb', line 65

def suite
  @suite
end

#summaryObject

The project summary



59
60
61
# File 'lib/indexer/attributes.rb', line 59

def summary
  @summary
end

#titleObject

The project title



56
57
58
# File 'lib/indexer/attributes.rb', line 56

def title
  @title
end

#typeObject

The type of ruby meta specification.



38
39
40
# File 'lib/indexer/attributes.rb', line 38

def type
  @type
end

#versionObject

The version of the project



47
48
49
# File 'lib/indexer/attributes.rb', line 47

def version
  @version
end

#webcvsObject

URI for linking to source code.



87
88
89
# File 'lib/indexer/attributes.rb', line 87

def webcvs
  @webcvs
end

Class Method Details

.attr_accessor(name) ⇒ Object

Define attribute, plus track it.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/indexer/attributes.rb', line 12

def self.attr_accessor(name)
  Indexer.attributes << name.to_sym

  class_eval %{
    def #{name}
      @data[:#{name}]
    end
    def #{name}=(val)
      @data[:#{name}] = val
    end
  }
end

Instance Method Details

#attributesObject



26
27
28
# File 'lib/indexer/attributes.rb', line 26

def attributes
  Indexer.attributes
end