Permalink
Browse files

load mixin files from subdirectories

  • Loading branch information...
1 parent 2f1f260 commit 019679aa6718f29cdc7abeb7d330222d03a6c128 @icaruswings committed Aug 9, 2010
Showing with 15 additions and 6 deletions.
  1. +13 −5 LICENSE
  2. +2 −1 lib/gizmo/helpers.rb
View
@@ -6,15 +6,23 @@ a copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+The following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
+Except as contained in this notice, neither the names of the above
+copyright holders nor sponsors in relation to the Software (REA Group
+or its subsidiaries) shall be used in advertising or otherwise to
+promote the sale, use or other dealings in the Software without prior
+written authorization.
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OR
+SPONSORS IN RELATION TO THE SOFTWARE (REA GROUP LIMITED OR ITS
+SUBSIDIARIES) OR THEIR RELATED PERSONS BE LIABLE FOR ANY CLAIM, DAMAGES
+OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
@@ -25,7 +25,8 @@ def load_mixin! mixin_name
begin
mixin_dir = Gizmo.configuration.mixin_dir
const_name = "PageWith#{mixin_name.to_s.camelize}"
- require "#{mixin_dir}/page_with_#{mixin_name}.rb" unless Object.const_defined?(const_name)
+ mixin = Dir["#{mixin_dir}/**/page_with_#{mixin_name}.rb"].first
+ require (mixin || "#{mixin_dir}/page_with_#{mixin_name}.rb") unless Object.const_defined?(const_name)
Object.const_get(const_name)
rescue LoadError
raise MixinNotFoundError, "Expected a page mixin file at #{mixin_dir}/page_with_#{mixin_name}.rb generate one with `gizmo -g #{mixin_name}`"

0 comments on commit 019679a

Please sign in to comment.