Commit e03a018d authored by Sato Hiroyuki's avatar Sato Hiroyuki

Refactor: rename module and class names.

* Module: Graph -> Network
* Class: JsonBuilder -> Graph
parent 784aa266
...@@ -22,7 +22,7 @@ class GraphController < ProjectResourceController ...@@ -22,7 +22,7 @@ class GraphController < ProjectResourceController
format.html format.html
format.json do format.json do
@graph = Graph::JsonBuilder.new(project, @ref, @commit) @graph = Network::Graph.new(project, @ref, @commit)
end end
end end
end end
......
require "grit" require "grit"
module Graph module Network
class Commit class Commit
include ActionView::Helpers::TagHelper include ActionView::Helpers::TagHelper
......
require "grit" require "grit"
module Graph module Network
class JsonBuilder class Graph
attr_accessor :days, :commits, :ref_cache, :repo attr_accessor :days, :commits, :ref_cache, :repo
def self.max_count def self.max_count
...@@ -19,7 +19,7 @@ module Graph ...@@ -19,7 +19,7 @@ module Graph
@days = index_commits @days = index_commits
end end
protected protected
# Get commits from repository # Get commits from repository
# #
...@@ -30,8 +30,8 @@ module Graph ...@@ -30,8 +30,8 @@ module Graph
# Decorate with app/models/commit.rb # 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 # Decorate with app/model/network/commit.rb
@commits.map! { |commit| Graph::Commit.new(commit) } @commits.map! { |commit| Network::Commit.new(commit) }
# add refs to each commit # add refs to each commit
@commits.each { |commit| commit.add_refs(ref_cache, repo) } @commits.each { |commit| commit.add_refs(ref_cache, repo) }
......
...@@ -8,8 +8,8 @@ class ProjectNetworkGraph < Spinach::FeatureSteps ...@@ -8,8 +8,8 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
end end
When 'I visit project "Shop" network page' do When 'I visit project "Shop" network page' do
# Stub Graph::JsonBuilder max_size to speed up test (10 commits vs. 650) # Stub Graph max_size to speed up test (10 commits vs. 650)
Graph::JsonBuilder.stub(max_count: 10) Network::Graph.stub(max_count: 10)
project = Project.find_by_name("Shop") project = Project.find_by_name("Shop")
visit project_graph_path(project, "master") visit project_graph_path(project, "master")
...@@ -25,7 +25,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps ...@@ -25,7 +25,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
end end
end end
And 'I switch ref to "stable"' do When 'I switch ref to "stable"' do
page.select 'stable', :from => 'ref' page.select 'stable', :from => 'ref'
sleep 2 sleep 2
end end
...@@ -40,7 +40,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps ...@@ -40,7 +40,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
end end
end end
And 'I looking for a commit by SHA of "v2.1.0"' do When 'I looking for a commit by SHA of "v2.1.0"' do
within ".content .search" do within ".content .search" do
fill_in 'q', :with => '98d6492' fill_in 'q', :with => '98d6492'
find('button').click find('button').click
......
...@@ -142,8 +142,8 @@ module SharedPaths ...@@ -142,8 +142,8 @@ module SharedPaths
end end
Given "I visit my project's network page" do Given "I visit my project's network page" do
# Stub Graph::JsonBuilder max_size to speed up test (10 commits vs. 650) # Stub Graph max_size to speed up test (10 commits vs. 650)
Graph::JsonBuilder.stub(max_count: 10) Network::Graph.stub(max_count: 10)
visit project_graph_path(@project, root_ref) visit project_graph_path(@project, root_ref)
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