Module: Geoffrey
- Defined in:
- lib/geoffrey/reporter.rb,
lib/geoffrey.rb,
lib/geoffrey/cli.rb,
lib/geoffrey/plist.rb,
lib/geoffrey/package.rb,
lib/geoffrey/version.rb,
lib/geoffrey/template.rb,
lib/geoffrey/file_helper.rb
Overview
/H4X
Defined Under Namespace
Modules: FileHelper, Reporter Classes: CLI, DecompressionError, NotFoundError, Package, Plist, Template
Constant Summary collapse
- VERSION =
"1.1.3"
Class Method Summary collapse
- .environment ⇒ Object
- .environment=(value) ⇒ Object
-
.package(&block) ⇒ Object
Define a package installation from the URL specified.
-
.plist(&block) ⇒ Object
Help you configure an application editing its
.plist
file.
Class Method Details
.environment ⇒ Object
11 12 13 |
# File 'lib/geoffrey.rb', line 11 def environment @@environment ||= :production end |
.environment=(value) ⇒ Object
8 9 10 |
# File 'lib/geoffrey.rb', line 8 def environment=(value) @@environment = value if value end |
.package(&block) ⇒ Object
Define a package installation from the URL specified. It will download the file, and if it’s compressed, it will decompress it.It currently supports zip, tar.gz, .gz and .dmg files. Once extracted it will look for a .pkg or a .app file and try to install it.
Some options can be defined:
-
:sudo
if it has to be executed as sudo. Generally .pkg files that ask for a password will require this. -
:unless
a Proc defining if it doesn’t have to try to install it. -
:if
inverse of inverse -
:file
what file has to be installed from all of the ones that came in the compressed file. -
:filename
set the name of the file you are downloading.
If what you’re going to test to see if you have to install something or not is the existance of a file (most likely), you can just specify the path in a creates statement (see examples).
If you don’t want to install a .pkg but do something else, you can just override the install method. See the examples
54 55 56 57 58 |
# File 'lib/geoffrey.rb', line 54 def package(&block) package = Package.new package.instance_eval &block package.process end |
.plist(&block) ⇒ Object
Help you configure an application editing its .plist
file.
You specify the file and then act on it through options
as if it were a simple hash.
Some OSX applications dump their settings into the plist file when they quit, so you might want to stop them before applying changes. Geoffrey can do it for you with affects
.
84 85 86 87 88 |
# File 'lib/geoffrey.rb', line 84 def plist(&block) plist = Plist.new plist.instance_eval &block plist.save end |