BigW Consortium Gitlab

Commit d8a40d8c by Sato Hiroyuki

Move graph module from lib or vendor directory to app directory.

Because not autoloading lib directory at development mode.
parent c9b1df12
......@@ -20,7 +20,7 @@ class GraphController < ProjectResourceController
respond_to do |format|
format.html
format.json do
graph = Gitlab::Graph::JsonBuilder.new(project, @ref, @commit)
graph = Graph::JsonBuilder.new(project, @ref, @commit)
render :json => graph.to_json
end
end
......
require Rails.root.join('lib', 'gitlab', 'graph', 'json_builder')
class ProjectsController < ProjectResourceController
skip_before_filter :project, only: [:new, :create]
skip_before_filter :repository, only: [:new, :create]
......
require "grit"
module Gitlab
module Graph
module Graph
class Commit
include ActionView::Helpers::TagHelper
......@@ -48,5 +47,4 @@ module Gitlab
@refs ||= []
end
end
end
end
require "grit"
module Gitlab
module Graph
module Graph
class JsonBuilder
attr_accessor :days, :commits, :ref_cache, :repo
......@@ -36,10 +35,10 @@ module Gitlab
@commits = Grit::Commit.find_all(repo, nil, {topo_order: true, max_count: self.class.max_count, skip: to_commit}).dup
# Decorate with app/models/commit.rb
@commits.map! { |commit| ::Commit.new(commit) }
@commits.map! { |commit| Commit.new(commit) }
# Decorate with lib/gitlab/graph/commit.rb
@commits.map! { |commit| Gitlab::Graph::Commit.new(commit) }
@commits.map! { |commit| Graph::Commit.new(commit) }
# add refs to each commit
@commits.each { |commit| commit.add_refs(ref_cache, repo) }
......@@ -264,5 +263,4 @@ module Gitlab
end
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment