Class: Pallet
- Inherits:
-
Object
- Object
- Pallet
- Defined in:
- lib/pallet.rb,
lib/pallet/gem.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
'1.5.0'- NAMESPACE =
'package'- PACKAGE_DIR =
'pkg'
Instance Attribute Summary collapse
-
#author ⇒ Object
The name of the current project maintainer.
-
#description ⇒ Object
A longer, more detailed description of the package’s capabilities.
-
#email ⇒ Object
The maintainer’s email address.
-
#name ⇒ Object
The name of the project.
-
#packages ⇒ Object
An enumerable with the package definitions for each package type you wish to support in your project.
-
#preferred_format ⇒ Object
The preferred packaging format of your project.
-
#summary ⇒ Object
A short description of the package function.
-
#version ⇒ Object
The version number of the project to tag onto the package.
Instance Method Summary collapse
-
#initialize(name, version = %x{svnversion}.chomp) {|_self| ... } ⇒ Pallet
constructor
Initializes the pallet to a sane state, and creates all the necessary Rake tasks.
Constructor Details
#initialize(name, version = %x{svnversion}.chomp) {|_self| ... } ⇒ Pallet
Initializes the pallet to a sane state, and creates all the necessary Rake tasks. Passes a copy of itself to a block, if given, and uses that block for further initializiation. If no version is given, defaults to the output of svnversion.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/pallet.rb', line 46 def initialize(name, version = %x{svnversion}.chomp) # set up defaults self.name = name self.version = version self. = 'Anonymous' self.email = '[email protected]' self.summary = '' self.description = '' self.packages = [] # let block continue initialization, don't bother testing for # block_given? since we need a block yield self # check that we have _some_ package to build if packages.empty? raise TypeError, 'at least one package type must be specified' end # if no preferred format given, use the first one specified self.preferred_format ||= packages.first define_rake_tasks end |
Instance Attribute Details
#author ⇒ Object
The name of the current project maintainer.
26 27 28 |
# File 'lib/pallet.rb', line 26 def end |
#description ⇒ Object
A longer, more detailed description of the package’s capabilities.
23 24 25 |
# File 'lib/pallet.rb', line 23 def description @description end |
#email ⇒ Object
The maintainer’s email address.
29 30 31 |
# File 'lib/pallet.rb', line 29 def email @email end |
#name ⇒ Object
The name of the project.
14 15 16 |
# File 'lib/pallet.rb', line 14 def name @name end |
#packages ⇒ Object
An enumerable with the package definitions for each package type you wish to support in your project.
33 34 35 |
# File 'lib/pallet.rb', line 33 def packages @packages end |
#preferred_format ⇒ Object
The preferred packaging format of your project. rake package will build this format, but others can still be built with rake package:#{format}.
38 39 40 |
# File 'lib/pallet.rb', line 38 def preferred_format @preferred_format end |
#summary ⇒ Object
A short description of the package function.
20 21 22 |
# File 'lib/pallet.rb', line 20 def summary @summary end |
#version ⇒ Object
The version number of the project to tag onto the package.
17 18 19 |
# File 'lib/pallet.rb', line 17 def version @version end |