diff options
author | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
commit | 62d7990b9bb30cf33ed87017c5c633d1cccc75c2 (patch) | |
tree | c3e1b69c58a412ba1c6f50a0337a23d9f9d6e1a4 /lib/api/project_export.rb | |
parent | f6453eca992a9c142268e78ac782cef98110d183 (diff) | |
download | gitlab-ce-tc-standard-gem.tar.gz |
Ran standardrb --fix on the whole codebasetc-standard-gem
Inspired by https://twitter.com/searls/status/1101137953743613952 I
decided to try https://github.com/testdouble/standard on our codebase.
It's opinionated, but at least it's a _standard_.
Diffstat (limited to 'lib/api/project_export.rb')
-rw-r--r-- | lib/api/project_export.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/api/project_export.rb b/lib/api/project_export.rb index e34ed0bdb44..8bd5813416e 100644 --- a/lib/api/project_export.rb +++ b/lib/api/project_export.rb @@ -8,47 +8,47 @@ module API end params do - requires :id, type: String, desc: 'The ID of a project' + requires :id, type: String, desc: "The ID of a project" end - resource :projects, requirements: { id: %r{[^/]+} } do - desc 'Get export status' do - detail 'This feature was introduced in GitLab 10.6.' + resource :projects, requirements: {id: %r{[^/]+}} do + desc "Get export status" do + detail "This feature was introduced in GitLab 10.6." success Entities::ProjectExportStatus end - get ':id/export' do + get ":id/export" do present user_project, with: Entities::ProjectExportStatus end - desc 'Download export' do - detail 'This feature was introduced in GitLab 10.6.' + desc "Download export" do + detail "This feature was introduced in GitLab 10.6." end - get ':id/export/download' do + get ":id/export/download" do if user_project.export_file_exists? present_carrierwave_file!(user_project.export_file) else - render_api_error!('404 Not found or has expired', 404) + render_api_error!("404 Not found or has expired", 404) end end - desc 'Start export' do - detail 'This feature was introduced in GitLab 10.6.' + desc "Start export" do + detail "This feature was introduced in GitLab 10.6." end params do - optional :description, type: String, desc: 'Override the project description' + optional :description, type: String, desc: "Override the project description" optional :upload, type: Hash do - optional :url, type: String, desc: 'The URL to upload the project' - optional :http_method, type: String, default: 'PUT', desc: 'HTTP method to upload the exported project' + optional :url, type: String, desc: "The URL to upload the project" + optional :http_method, type: String, default: "PUT", desc: "HTTP method to upload the exported project" end end - post ':id/export' do + post ":id/export" do project_export_params = declared_params(include_missing: false) after_export_params = project_export_params.delete(:upload) || {} export_strategy = if after_export_params[:url].present? - params = after_export_params.slice(:url, :http_method).symbolize_keys + params = after_export_params.slice(:url, :http_method).symbolize_keys - Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy.new(params) - end + Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy.new(params) + end if export_strategy&.invalid? render_validation_error!(export_strategy) |