lib/makura/layout.rb in makura-2010.08.26 vs lib/makura/layout.rb in makura-2011.01.21
- old
+ new
@@ -5,11 +5,11 @@
PATH = [
'./couch',
File.join(Makura::ROOT, '../couch')
]
- def initialize(name, design = nil)
+ def initialize(name, design)
@name, @design = name, design
@design[name] = self
@map = @reduce = nil
@options = {}
end
@@ -35,10 +35,11 @@
end
def common_load(type, file_or_function)
return unless file_or_function
- if file_or_function =~ /function\(.*\)/
+ case file_or_function
+ when /function\(.*\)/, /^_(sum|count|stats)$/
function = file_or_function
else
parts = file_or_function.to_s.split('::')
file = parts.pop
filename = File.join(parts, type.to_s, "#{file}.js")