parent
996f51559b
commit
a73044320f
|
@ -27,3 +27,9 @@ You can find results under the `doc/code` directory.
|
||||||
```
|
```
|
||||||
bundle exec rake gitlab:generate_docs
|
bundle exec rake gitlab:generate_docs
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Generate API documentation for project services (e.g. Slack)
|
||||||
|
|
||||||
|
```
|
||||||
|
bundle exec rake services:doc
|
||||||
|
```
|
||||||
|
|
|
@ -44,11 +44,11 @@ DELETE /projects/:id/services/<%= service[:dashed_name] %>
|
||||||
ERB
|
ERB
|
||||||
|
|
||||||
namespace :services do
|
namespace :services do
|
||||||
task :doc do
|
task doc: :environment do
|
||||||
services = Service.available_services_names.map do |s|
|
services = Service.available_services_names.map do |s|
|
||||||
service_start = Time.now
|
service_start = Time.now
|
||||||
klass = "#{s}_service".classify.constantize
|
klass = "#{s}_service".classify.constantize
|
||||||
|
|
||||||
service = klass.new
|
service = klass.new
|
||||||
|
|
||||||
service_hash = {}
|
service_hash = {}
|
||||||
|
@ -62,7 +62,7 @@ namespace :services do
|
||||||
|
|
||||||
param_hash[:name] = p[:name]
|
param_hash[:name] = p[:name]
|
||||||
param_hash[:description] = p[:placeholder] || p[:title]
|
param_hash[:description] = p[:placeholder] || p[:title]
|
||||||
param_hash[:required] = klass.validators_on(p[:name].to_sym).any? do |v|
|
param_hash[:required] = klass.validators_on(p[:name].to_sym).any? do |v|
|
||||||
v.class == ActiveRecord::Validations::PresenceValidator
|
v.class == ActiveRecord::Validations::PresenceValidator
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue