From 1ea0dd0ffc37232d27f4fa1350af6ebb3b5439f2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 25 Oct 2012 11:59:41 +0300 Subject: App docs --- doc/app/RefsController.html | 638 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 638 insertions(+) create mode 100644 doc/app/RefsController.html (limited to 'doc/app/RefsController.html') diff --git a/doc/app/RefsController.html b/doc/app/RefsController.html new file mode 100644 index 00000000000..a8248da0ec0 --- /dev/null +++ b/doc/app/RefsController.html @@ -0,0 +1,638 @@ + + + + + + +class RefsController - Rails Application Documentation + + + + + + + + + + + + + + + + +
+

class RefsController

+ +
+ +
+ + + + +
+ + + + + + + + + + +
+

Public Instance Methods

+ + +
+ +
+ logs_tree() + click to toggle source +
+ + +
+ + + + + +
+
# File app/controllers/refs_controller.rb, line 31
+def logs_tree
+  contents = @tree.contents
+  @logs = contents.map do |content|
+    file = params[:path] ? File.join(params[:path], content.name) : content.name
+    last_commit = @project.commits(@commit.id, file, 1).last
+    last_commit = CommitDecorator.decorate(last_commit)
+    {
+      file_name: content.name,
+      commit: last_commit
+    }
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+ switch() + click to toggle source +
+ + +
+ + + + + +
+
# File app/controllers/refs_controller.rb, line 12
+def switch
+  respond_to do |format|
+    format.html do
+      new_path = if params[:destination] == "tree"
+                   project_tree_path(@project, @ref)
+                 else
+                   project_commits_path(@project, @ref)
+                 end
+
+      redirect_to new_path
+    end
+    format.js do
+      @ref = params[:ref]
+      define_tree_vars
+      render "tree"
+    end
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+

Protected Instance Methods

+ + +
+ +
+ define_tree_vars() + click to toggle source +
+ + +
+ + + + + +
+
# File app/controllers/refs_controller.rb, line 46
+def define_tree_vars
+  params[:path] = nil if params[:path].blank?
+
+  @repo = project.repo
+  @commit = project.commit(@ref)
+  @commit = CommitDecorator.decorate(@commit)
+  @tree = Tree.new(@commit.tree, project, @ref, params[:path])
+  @tree = TreeDecorator.new(@tree)
+  @hex_path = Digest::SHA1.hexdigest(params[:path] || "")
+
+  if params[:path]
+    @logs_path = logs_file_project_ref_path(@project, @ref, params[:path])
+  else
+    @logs_path = logs_tree_project_ref_path(@project, @ref)
+  end
+rescue
+  return render_404
+end
+
+ +
+ + + + +
+ + +
+ +
+ ref() + click to toggle source +
+ + +
+ + + + + +
+
# File app/controllers/refs_controller.rb, line 65
+def ref
+  @ref = params[:id] || params[:ref]
+end
+
+ +
+ + + + +
+ + +
+ +
+ +
+ + + + -- cgit v1.2.1