Sha256: 9fa66e67dbf651cfcf9bd5588e93a68f2bdbb25a60a6e938e1836d5cf47b54be
Contents?: true
Size: 512 Bytes
Versions: 1
Compression:
Stored size: 512 Bytes
Contents
module Git::Webby module ViewerHelpers include GitHelpers end class Viewer < Controller require "json" helpers ViewerHelpers set :project_root, File.expand_path("#{File.dirname(__FILE__)}/git") mime_type :json, "application/json" get %r{/(.*?)/(.*?/{0,1}.*)$} do |name, path| content_type :json path = path.split("/") ref = path.shift tree = repository.tree(ref, path.join("/")) tree.to_json(:max_nesting => tree.size*6) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
git-webby-0.2.0 | lib/git/webby/viewer.rb |