Decouple and refactor GraphCommit

This commit is contained in:
randx 2012-11-04 23:43:33 +02:00
parent f8e27b92bf
commit f082c8ae2a
7 changed files with 393 additions and 201 deletions

View file

@ -1,4 +1,4 @@
require Rails.root.join('lib', 'gitlab', 'graph_commit')
require Rails.root.join('lib', 'gitlab', 'graph', 'json_builder')
class ProjectsController < ProjectResourceController
skip_before_filter :project, only: [:new, :create]
@ -79,7 +79,9 @@ class ProjectsController < ProjectResourceController
end
def graph
@days_json, @commits_json = Gitlab::GraphCommit.to_graph(project)
graph = Gitlab::Graph::JsonBuilder.new(project)
@days_json, @commits_json = graph.days_json, graph.commits_json
end
def destroy