lib/jets/builders/shim_vars/app.rb in jets-1.1.5 vs lib/jets/builders/shim_vars/app.rb in jets-1.2.0
- old
+ new
@@ -4,13 +4,13 @@
# @vars.handler_for(function_name)
# end
#
# Implements:
#
-# functions
-# handler_for(function_name)
-# js_path
+# functions: IE [:index, :show]
+# handler_for(function_name): IE handlers/controllers/posts_controller.index
+# js_path: IE: handlers/controllers/posts_controller.js
#
module Jets::Builders::ShimVars
class App < Base
# Allow user to specify relative or full path. The right path gets used
# internally. Example paths:
@@ -59,9 +59,10 @@
def lang(meth)
klass.tasks.find
end
# This gets called in the node shim js template
+ # IE handlers/controllers/posts_controller.index
def handler_for(meth)
# possibly not include _function
underscored_name = @relative_path.sub(%r{app/(\w+)/},'').sub('.rb','')
"handlers/#{process_type.pluralize}/#{underscored_name}.#{meth}"
end