module History
History
is a Wire::App
for accessing the history of versioned content @author Bryan T. Meyers
Public Instance Methods
configure(conf)
click to toggle source
Configure this History
with a log template @param [Hash] conf the raw configuration @return [Hash] post-processed configuration
# File lib/app/history.rb, line 27 def configure(conf) conf['log'] = Tilt.new(conf['log'], 1) conf end
do_read(actions, context)
click to toggle source
Get the history of a single file or directory @param [Hash] context the context for this request @return [Response] the history, or status code
# File lib/app/history.rb, line 35 def do_read(actions, context) list = get_log(context.closet.repos[context.config['repo']], context.resource, context.id) if list == 404 return [404, {}, "File Not Found"] end template = context.config['log'] template.render(self, actions: actions, context: context, list: list) end
invoke(actions, context)
click to toggle source
Proxy method used when routing @param [Array] actions the allowed actions for this URI @param [Hash] context the context for this request @return [Response] a Rack Response triplet, or status code
# File lib/app/history.rb, line 50 def invoke(actions, context) return 404 unless context.resource case context.action when :read do_read(actions, context) else 403 end end