-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the boot process to use the new configuration class and remov…
…ed old configuration directives. Updated specs to reflect internal changes. Cleaned up default configurations. [#38 state:resolved]
- Loading branch information
Showing
12 changed files
with
197 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module Halcyon | ||
class Application | ||
|
||
# Helper that provides access to setting and running hooks. | ||
# | ||
module Hooks | ||
|
||
# Extends the target with the class methods necessary. | ||
def self.included(target) | ||
target.extend(ClassMethods) | ||
end | ||
|
||
module ClassMethods | ||
|
||
# Sets the startup hook to the proc. | ||
# | ||
# Use this to initialize application-wide resources, such as database | ||
# connections. | ||
# | ||
# Use initializers where possible. | ||
# | ||
def startup &hook | ||
Halcyon.hooks[:startup] << hook | ||
end | ||
|
||
# Sets the shutdown hook to the proc. | ||
# | ||
# Close any resources opened in the +startup+ hook. | ||
# | ||
def shutdown &hook | ||
Halcyon.hooks[:shutdown] << hook | ||
end | ||
|
||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.