puppetlabs/packaging — pull request #257 by MosesMendoza (2014-02-02 00:51:23+00:00)
Title: (RE-399) make build object properties accessible

It would be useful to have access from the rake entry point to all of the build
properties individually. This commit makes it so, by creating a new rake task,
pl:print_build_param[:param], where the passed parameter is the one to print.

Various forms of output running this new task:
```
[0] moses@mosesmac:hiera:(redirect)$ rake pl:print_build_param[version]
1.3.1-45-dirty
[0] moses@mosesmac:hiera:(redirect)$ rake pl:print_build_param[:version]
1.3.1-45-dirty
[0] moses@mosesmac:hiera:(redirect)$ rake pl:print_build_param[@version]
1.3.1-45-dirty
[0] moses@mosesmac:hiera:(redirect)$ rake pl:print_build_param[@foo]
rake aborted!
Could not locate a build parameter called @foo. For a list of available parameters, do `rake pl:print_build_params`
/Users/moses/development/hiera/ext/packaging/tasks/z_data_dump.rake:58:in `block (2 levels) in '
Tasks: TOP => pl:print_build_param
(See full trace by running task with --trace)
[1] moses@mosesmac:hiera:(redirect)$ rake pl:print_build_param[foo]
rake aborted!
Could not locate a build parameter called @foo. For a list of available parameters, do `rake pl:print_build_params`
/Users/moses/development/hiera/ext/packaging/tasks/z_data_dump.rake:58:in `block (2 levels) in '
Tasks: TOP => pl:print_build_param
(See full trace by running task with --trace)
[1] moses@mosesmac:hiera:(redirect)$ rake pl:print_build_param[:foo]
rake aborted!
Could not locate a build parameter called @foo. For a list of available parameters, do `rake pl:print_build_params`
/Users/moses/development/hiera/ext/packaging/tasks/z_data_dump.rake:58:in `block (2 levels) in '
Tasks: TOP => pl:print_build_param
(See full trace by running task with --trace)
[1] moses@mosesmac:hiera:(redirect)$ rake pl:print_build_param
rake aborted!
To print a build parameter, pass the param name as a rake argument. Ex: rake pl:print_build_param[:version]
/Users/moses/development/hiera/ext/packaging/tasks/z_data_dump.rake:61:in `block (2 levels) in '
Tasks: TOP => pl:print_build_param
(See full trace by running task with --trace)
[1] moses@mosesmac:hiera:(redirect)$
```
Signed-off-by: Moses Mendoza