Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
e03a018d
Commit
e03a018d
authored
Mar 07, 2013
by
Sato Hiroyuki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor: rename module and class names.
* Module: Graph -> Network * Class: JsonBuilder -> Graph
parent
784aa266
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
+13
-13
app/controllers/graph_controller.rb
app/controllers/graph_controller.rb
+1
-1
app/models/network/commit.rb
app/models/network/commit.rb
+1
-1
app/models/network/graph.rb
app/models/network/graph.rb
+5
-5
features/steps/project/project_network_graph.rb
features/steps/project/project_network_graph.rb
+4
-4
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+2
-2
No files found.
app/controllers/graph_controller.rb
View file @
e03a018d
...
...
@@ -22,7 +22,7 @@ class GraphController < ProjectResourceController
format
.
html
format
.
json
do
@graph
=
Graph
::
JsonBuilder
.
new
(
project
,
@ref
,
@commit
)
@graph
=
Network
::
Graph
.
new
(
project
,
@ref
,
@commit
)
end
end
end
...
...
app/models/
graph
/commit.rb
→
app/models/
network
/commit.rb
View file @
e03a018d
require
"grit"
module
Graph
module
Network
class
Commit
include
ActionView
::
Helpers
::
TagHelper
...
...
app/models/
graph/json_builder
.rb
→
app/models/
network/graph
.rb
View file @
e03a018d
require
"grit"
module
Graph
class
JsonBuilder
module
Network
class
Graph
attr_accessor
:days
,
:commits
,
:ref_cache
,
:repo
def
self
.
max_count
...
...
@@ -19,7 +19,7 @@ module Graph
@days
=
index_commits
end
protected
protected
# Get commits from repository
#
...
...
@@ -30,8 +30,8 @@ module Graph
# Decorate with app/models/commit.rb
@commits
.
map!
{
|
commit
|
Commit
.
new
(
commit
)
}
# Decorate with
lib/gitlab/graph
/commit.rb
@commits
.
map!
{
|
commit
|
Graph
::
Commit
.
new
(
commit
)
}
# Decorate with
app/model/network
/commit.rb
@commits
.
map!
{
|
commit
|
Network
::
Commit
.
new
(
commit
)
}
# add refs to each commit
@commits
.
each
{
|
commit
|
commit
.
add_refs
(
ref_cache
,
repo
)
}
...
...
features/steps/project/project_network_graph.rb
View file @
e03a018d
...
...
@@ -8,8 +8,8 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
end
When
'I visit project "Shop" network page'
do
# Stub Graph
::JsonBuilder
max_size to speed up test (10 commits vs. 650)
Graph
::
JsonBuilder
.
stub
(
max_count:
10
)
# Stub Graph max_size to speed up test (10 commits vs. 650)
Network
::
Graph
.
stub
(
max_count:
10
)
project
=
Project
.
find_by_name
(
"Shop"
)
visit
project_graph_path
(
project
,
"master"
)
...
...
@@ -25,7 +25,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
end
end
And
'I switch ref to "stable"'
do
When
'I switch ref to "stable"'
do
page
.
select
'stable'
,
:from
=>
'ref'
sleep
2
end
...
...
@@ -40,7 +40,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
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
fill_in
'q'
,
:with
=>
'98d6492'
find
(
'button'
).
click
...
...
features/steps/shared/paths.rb
View file @
e03a018d
...
...
@@ -142,8 +142,8 @@ module SharedPaths
end
Given
"I visit my project's network page"
do
# Stub Graph
::JsonBuilder
max_size to speed up test (10 commits vs. 650)
Graph
::
JsonBuilder
.
stub
(
max_count:
10
)
# Stub Graph max_size to speed up test (10 commits vs. 650)
Network
::
Graph
.
stub
(
max_count:
10
)
visit
project_graph_path
(
@project
,
root_ref
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment