Permalink
Browse files

moved some things around

  • Loading branch information...
1 parent 87cf82d commit 0304be25d26664eca071ffa6916b51b825d38898 Conrad VanLandingham committed Aug 25, 2012
Showing with 9 additions and 9 deletions.
  1. +9 −9 lib/sinatra/ember.rb
View
@@ -8,6 +8,14 @@ def self.registered(app)
app.extend ClassMethods
end
+ def self.template_path(path, file)
+ unless root.blank?
+ file.gsub!(/^#{Regexp.quote(path)}\/?/, '')
+ end
+
+ file
+ end
+
module ClassMethods
# set ember options
def ember(&block)
@@ -36,7 +44,7 @@ def ember_init!
templates = paths.map do |path, files|
files.map do |file|
content = File.read(file)
- "Ember.TEMPLATES[#{template_path(path,file)}] = Ember.Handlebars.compile(#{content.inspect});"
+ "Ember.TEMPLATES[#{self.template_path(path,file)}] = Ember.Handlebars.compile(#{content.inspect});"
end
end
@@ -64,14 +72,6 @@ def ember_init!
end
end
end
- def template_path(path, file)
-
- unless root.blank?
- file.gsub!(/^#{Regexp.quote(path)}\/?/, '')
- end
-
- file
- end
end
class Options

0 comments on commit 0304be2

Please sign in to comment.