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


112
113
114
# File 'lib/indexer/attributes.rb', line 112

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.



125
126
127
# File 'lib/indexer/attributes.rb', line 125

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.



115
116
117
# File 'lib/indexer/attributes.rb', line 115

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.



135
136
137
# File 'lib/indexer/attributes.rb', line 135

def created
  @created
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.



92
93
94
# File 'lib/indexer/attributes.rb', line 92

def engines
  @engines
end

#install_messageObject

The post-installation message.



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

def install_message
  @install_message
end

#load_pathObject

The directories to search within the project when requiring files



89
90
91
# File 'lib/indexer/attributes.rb', line 89

def load_path
  @load_path
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?



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

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

#platformsObject

List of platforms supported.



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

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.



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

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.



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

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