summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <hans@degraaff.org>2009-12-01 19:34:05 +0100
committerHans de Graaff <hans@degraaff.org>2009-12-01 19:34:31 +0100
commit528f8455e8f82b9e76775c26d417c1b495de5881 (patch)
treed56275c1f411ec2a7c370b8ac34ec3cf8416a2d9
parentoutput the correct description for the check install phase (diff)
downloadruby-scripts-528f8455e8f82b9e76775c26d417c1b495de5881.tar.gz
ruby-scripts-528f8455e8f82b9e76775c26d417c1b495de5881.tar.bz2
ruby-scripts-528f8455e8f82b9e76775c26d417c1b495de5881.zip
Add documentation for all public methods.
-rw-r--r--ruby-ng-testbed/eclass/ruby-ng.eclass48
1 files changed, 43 insertions, 5 deletions
diff --git a/ruby-ng-testbed/eclass/ruby-ng.eclass b/ruby-ng-testbed/eclass/ruby-ng.eclass
index 243e0ca..3312618 100644
--- a/ruby-ng-testbed/eclass/ruby-ng.eclass
+++ b/ruby-ng-testbed/eclass/ruby-ng.eclass
@@ -91,8 +91,12 @@ ruby_implementation_depend() {
echo "$2${rubypn}$3${rubyslot}"
}
-# Convenience function to output requests for a package to have the
-# same rubylibs enabled.
+# @FUNCTION: ruby_samelib
+# @RETURN: use flag string with current ruby implementations
+# @DESCRIPTION: Convenience function to output the use dependency part
+# of a dependency. Used as a building block for ruby_add_rdepend() and
+# ruby_add_bdepend(), but may also be useful in an ebuild to specify
+# more complex dependencies.
ruby_samelib() {
local res=
for _ruby_implementation in $USE_RUBY; do
@@ -131,9 +135,14 @@ _ruby_add_rdepend() {
_ruby_add_bdepend "$atom" test
}
-# Parameters:
-# - (optional) space-separated list of conditions
-# - space-separated list of dependency atoms
+# @FUNCTION: ruby_add_rdepend
+# @USAGE: atom [conditions]
+# @DESCRIPTION: Adds the specified atom(s) with optional use
+# condition(s) to RDEPEND, taking the current set of ruby targets into
+# account. This makes sure that all ruby dependencies of the package
+# are installed for the same ruby targets. Use this function for all
+# ruby dependencies instead of setting RDEPEND yourself. Both atom and
+# conditions can be a space-separated list of atoms or conditions.
ruby_add_rdepend() {
local atoms=
local conditions=
@@ -155,6 +164,15 @@ ruby_add_rdepend() {
done
}
+# @FUNCTION: ruby_add_bdepend
+# @USAGE: atom [conditions]
+# @DESCRIPTION: Adds the specified atom(s) with optional use
+# condition(s) to both DEPEND and RDEPEND, taking the current set of
+# ruby targets into account. This makes sure that all ruby
+# dependencies of the package are installed for the same ruby
+# targets. Use this function for all ruby dependencies instead of
+# setting DEPEND and RDEPEND yourself. Both atom and conditions can be
+# a space-separated list of atoms or conditions.
ruby_add_bdepend() {
local atoms=
local conditions=
@@ -230,6 +248,8 @@ _ruby_each_implementation() {
[[ ${invoked} == "no" ]] && die "You need to select at least one Ruby implementation by setting RUBY_TARGETS in /etc/make.conf."
}
+# @FUNCTION: ruby-ng_pkg_setup
+# @DESCRIPTION: Check whether at least one ruby target implementation is present.
ruby-ng_pkg_setup() {
# This only checks that at least one implementation is present
# before doing anything; by leaving the parameters empty we know
@@ -237,6 +257,8 @@ ruby-ng_pkg_setup() {
_ruby_each_implementation
}
+# @FUNCTION: ruby-ng_src_unpack
+# @DESCRIPTION: Unpack the source archive, including gems.
ruby-ng_src_unpack() {
mkdir "${WORKDIR}"/all
pushd "${WORKDIR}"/all &>/dev/null
@@ -269,6 +291,10 @@ _ruby_source_copy() {
|| die "Unable to copy ${_ruby_implementation} environment"
}
+# @FUNCTION: ruby-ng_src_prepare
+# @DESCRIPTION:
+# Apply patches and prepare versions for each ruby target
+# implementation. Also carry out common clean up tasks.
ruby-ng_src_prepare() {
# Way too many Ruby packages are prepared on OSX without removing
# the extra data forks, we do it here to avoid repeating it for
@@ -284,6 +310,9 @@ ruby-ng_src_prepare() {
fi
}
+# @FUNCTION: ruby-ng_src_configure
+# @DESCRIPTION:
+# Configure the package.
ruby-ng_src_configure() {
if type each_ruby_configure &>/dev/null; then
_ruby_each_implementation each_ruby_configure
@@ -293,6 +322,9 @@ ruby-ng_src_configure() {
_ruby_invoke_environment all all_ruby_configure
}
+# @FUNCTION: ruby-ng_src_compile
+# @DESCRIPTION:
+# Compile the package.
ruby-ng_src_compile() {
if type each_ruby_compile &>/dev/null; then
_ruby_each_implementation each_ruby_compile
@@ -302,6 +334,9 @@ ruby-ng_src_compile() {
_ruby_invoke_environment all all_ruby_compile
}
+# @FUNCTION: ruby-ng_src_test
+# @DESCRIPTION:
+# Run tests for the package.
ruby-ng_src_test() {
if type each_ruby_test &>/dev/null; then
_ruby_each_implementation each_ruby_test
@@ -329,6 +364,9 @@ _each_ruby_check_install() {
fi
}
+# @FUNCTION: ruby-ng_src_install
+# @DESCRIPTION:
+# Install the package for each ruby target implementation.
ruby-ng_src_install() {
if type each_ruby_install &>/dev/null; then
_ruby_each_implementation each_ruby_install