Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moved some things around

  • Loading branch information...
commit 0304be25d26664eca071ffa6916b51b825d38898 1 parent 87cf82d
Conrad VanLandingham authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 lib/sinatra/ember.rb
View
18 lib/sinatra/ember.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.