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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
39484136
Commit
39484136
authored
Jul 14, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:gitlabhq/gitlabhq
parents
26556a5c
3c059697
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
4 deletions
+40
-4
doc/api/projects.md
doc/api/projects.md
+2
-0
doc/update/5.4-to-6.0.md
doc/update/5.4-to-6.0.md
+1
-1
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/projects.rb
lib/api/projects.rb
+6
-2
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+30
-0
No files found.
doc/api/projects.md
View file @
39484136
...
@@ -189,6 +189,7 @@ Parameters:
...
@@ -189,6 +189,7 @@ Parameters:
+
`merge_requests_enabled`
(optional)
+
`merge_requests_enabled`
(optional)
+
`wiki_enabled`
(optional)
+
`wiki_enabled`
(optional)
+
`snippets_enabled`
(optional)
+
`snippets_enabled`
(optional)
+
`public`
(optional)
**Project access levels**
**Project access levels**
...
@@ -221,6 +222,7 @@ Parameters:
...
@@ -221,6 +222,7 @@ Parameters:
+
`merge_requests_enabled`
(optional)
+
`merge_requests_enabled`
(optional)
+
`wiki_enabled`
(optional)
+
`wiki_enabled`
(optional)
+
`snippets_enabled`
(optional)
+
`snippets_enabled`
(optional)
+
`public`
(optional)
...
...
doc/update/5.4-to-6.0.md
View file @
39484136
...
@@ -36,7 +36,7 @@ sudo -u git -H bundle install --without development test mysql --deployment
...
@@ -36,7 +36,7 @@ sudo -u git -H bundle install --without development test mysql --deployment
sudo
-u
git
-H
bundle
exec
rake db:migrate
RAILS_ENV
=
production
sudo
-u
git
-H
bundle
exec
rake db:migrate
RAILS_ENV
=
production
sudo
-u
git
-H
bundle
exec
rake migrate_groups
RAILS_ENV
=
production
sudo
-u
git
-H
bundle
exec
rake migrate_groups
RAILS_ENV
=
production
sudo
-u
git
-H
bundle
exec
rake migrate_global_projects
RAILS_ENV
=
production
sudo
-u
git
-H
bundle
exec
rake migrate_global_projects
RAILS_ENV
=
production
sudo
-u
git
-H
bundle
exec
rake migrate_
global_
keys
RAILS_ENV
=
production
sudo
-u
git
-H
bundle
exec
rake migrate_keys
RAILS_ENV
=
production
```
```
...
...
lib/api/entities.rb
View file @
39484136
...
@@ -36,7 +36,7 @@ module API
...
@@ -36,7 +36,7 @@ module API
expose
:owner
,
using:
Entities
::
UserBasic
expose
:owner
,
using:
Entities
::
UserBasic
expose
:name
,
:name_with_namespace
expose
:name
,
:name_with_namespace
expose
:path
,
:path_with_namespace
expose
:path
,
:path_with_namespace
expose
:issues_enabled
,
:merge_requests_enabled
,
:wall_enabled
,
:wiki_enabled
,
:snippets_enabled
,
:created_at
,
:last_activity_at
expose
:issues_enabled
,
:merge_requests_enabled
,
:wall_enabled
,
:wiki_enabled
,
:snippets_enabled
,
:created_at
,
:last_activity_at
,
:public
expose
:namespace
expose
:namespace
expose
:forked_from_project
,
using:
Entities
::
ForkedFromProject
,
:if
=>
lambda
{
|
project
,
options
|
project
.
forked?
}
expose
:forked_from_project
,
using:
Entities
::
ForkedFromProject
,
:if
=>
lambda
{
|
project
,
options
|
project
.
forked?
}
end
end
...
...
lib/api/projects.rb
View file @
39484136
...
@@ -67,6 +67,7 @@ module API
...
@@ -67,6 +67,7 @@ module API
# wiki_enabled (optional)
# wiki_enabled (optional)
# snippets_enabled (optional)
# snippets_enabled (optional)
# namespace_id (optional) - defaults to user namespace
# namespace_id (optional) - defaults to user namespace
# public (optional) - false by default
# Example Request
# Example Request
# POST /projects
# POST /projects
post
do
post
do
...
@@ -79,7 +80,8 @@ module API
...
@@ -79,7 +80,8 @@ module API
:merge_requests_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
:wiki_enabled
,
:snippets_enabled
,
:snippets_enabled
,
:namespace_id
]
:namespace_id
,
:public
]
@project
=
::
Projects
::
CreateContext
.
new
(
current_user
,
attrs
).
execute
@project
=
::
Projects
::
CreateContext
.
new
(
current_user
,
attrs
).
execute
if
@project
.
saved?
if
@project
.
saved?
present
@project
,
with:
Entities
::
Project
present
@project
,
with:
Entities
::
Project
...
@@ -103,6 +105,7 @@ module API
...
@@ -103,6 +105,7 @@ module API
# merge_requests_enabled (optional)
# merge_requests_enabled (optional)
# wiki_enabled (optional)
# wiki_enabled (optional)
# snippets_enabled (optional)
# snippets_enabled (optional)
# public (optional)
# Example Request
# Example Request
# POST /projects/user/:user_id
# POST /projects/user/:user_id
post
"user/:user_id"
do
post
"user/:user_id"
do
...
@@ -115,7 +118,8 @@ module API
...
@@ -115,7 +118,8 @@ module API
:wall_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
:wiki_enabled
,
:snippets_enabled
]
:snippets_enabled
,
:public
]
@project
=
::
Projects
::
CreateContext
.
new
(
user
,
attrs
).
execute
@project
=
::
Projects
::
CreateContext
.
new
(
user
,
attrs
).
execute
if
@project
.
saved?
if
@project
.
saved?
present
@project
,
with:
Entities
::
Project
present
@project
,
with:
Entities
::
Project
...
...
spec/requests/api/projects_spec.rb
View file @
39484136
...
@@ -104,6 +104,21 @@ describe API::API do
...
@@ -104,6 +104,21 @@ describe API::API do
json_response
[
k
.
to_s
].
should
==
v
json_response
[
k
.
to_s
].
should
==
v
end
end
end
end
it
"should set a project as public"
do
project
=
attributes_for
(
:project
,
{
public:
true
})
post
api
(
"/projects"
,
user
),
project
json_response
[
'public'
].
should
be_true
end
it
"should set a project as private"
do
project
=
attributes_for
(
:project
,
{
public:
false
})
post
api
(
"/projects"
,
user
),
project
json_response
[
'public'
].
should
be_false
end
end
end
describe
"POST /projects/user/:id"
do
describe
"POST /projects/user/:id"
do
...
@@ -144,6 +159,21 @@ describe API::API do
...
@@ -144,6 +159,21 @@ describe API::API do
json_response
[
k
.
to_s
].
should
==
v
json_response
[
k
.
to_s
].
should
==
v
end
end
end
end
it
"should set a project as public"
do
project
=
attributes_for
(
:project
,
{
public:
true
})
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
json_response
[
'public'
].
should
be_true
end
it
"should set a project as private"
do
project
=
attributes_for
(
:project
,
{
public:
false
})
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
json_response
[
'public'
].
should
be_false
end
end
end
describe
"GET /projects/:id"
do
describe
"GET /projects/:id"
do
...
...
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