Permalink
Browse files

reorder so calsses can be found

  • Loading branch information...
1 parent 07eb314 commit bd16716b67316a1f64efe270b0c8d9b8b11edaa8 @hollow hollow committed Apr 15, 2012
Showing with 30 additions and 30 deletions.
  1. +30 −30 lib/madvertise/ext/config.rb
@@ -1,36 +1,6 @@
require 'yaml'
require 'madvertise/ext/hash'
-##
-# The Configuration class provides a simple interface to configuration stored
-# inside of YAML files.
-#
-class Configuration < Section
-
- # Create a new {Configuration} object.
- #
- # @param [Symbol] mode The mode to load from the configurtion file
- # (production, development, etc)
- # @yield [config] The new configuration object.
- def initialize(mode = :development)
- @mode = mode
- yield self if block_given?
- end
-
- # Load given mixins from +path+.
- #
- # @param [String] path The path to mixin files.
- # @param [Array] mixins_to_use A list of mixins to load from +path+.
- # @return [void]
- def load_mixins(path, mixins_to_use)
- mixins_to_use.map do |mixin_name|
- File.join(path, "#{mixin_name}.yml")
- end.each do |mixin_file|
- mixin(mixin_file)
- end
- end
-end
-
##
# A {Configuration} consists of one or more Sections. A section is a hash-like
# object that responds to all keys in the hash as if they were methods:
@@ -111,6 +81,36 @@ def method_missing(name, *args)
end
end
+##
+# The Configuration class provides a simple interface to configuration stored
+# inside of YAML files.
+#
+class Configuration < Section
+
+ # Create a new {Configuration} object.
+ #
+ # @param [Symbol] mode The mode to load from the configurtion file
+ # (production, development, etc)
+ # @yield [config] The new configuration object.
+ def initialize(mode = :development)
+ @mode = mode
+ yield self if block_given?
+ end
+
+ # Load given mixins from +path+.
+ #
+ # @param [String] path The path to mixin files.
+ # @param [Array] mixins_to_use A list of mixins to load from +path+.
+ # @return [void]
+ def load_mixins(path, mixins_to_use)
+ mixins_to_use.map do |mixin_name|
+ File.join(path, "#{mixin_name}.yml")
+ end.each do |mixin_file|
+ mixin(mixin_file)
+ end
+ end
+end
+
##
# A NilSection is returned for all missing/empty values in the config file. This
# allows for terse code when accessing values that have not been configured by

0 comments on commit bd16716

Please sign in to comment.