summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-10-09 16:00:19 -0600
committerConnor Shea <connor.james.shea@gmail.com>2016-12-13 18:52:26 -0700
commit8f7553d3f8296004b520f093d195d77729566789 (patch)
tree7d4e9f248cd9a238cefbf319b0810c43d6b52585
parent3e8118d689824ef299c1069eff6150849046c0b5 (diff)
downloadgitlab-ce-8f7553d3f8296004b520f093d195d77729566789.tar.gz
Upgrade grape from 0.15.0 to 0.18.0.
Changelog: https://github.com/ruby-grape/grape/blob/2d34f29b52827157d3abf43a569f205783709212/CHANGELOG.md#0180-1072016 Upgrading: https://github.com/ruby-grape/grape/blob/2d34f29b52827157d3abf43a569f205783709212/UPGRADING.md#upgrading-to--0170
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock13
-rw-r--r--lib/api/helpers.rb2
-rw-r--r--lib/gitlab/metrics/rack_middleware.rb4
-rw-r--r--spec/lib/gitlab/metrics/rack_middleware_spec.rb4
5 files changed, 14 insertions, 11 deletions
diff --git a/Gemfile b/Gemfile
index 2cc7764e6b8..dec0bea2cb0 100644
--- a/Gemfile
+++ b/Gemfile
@@ -67,7 +67,7 @@ gem 'gollum-rugged_adapter', '~> 0.4.2', require: false
gem 'github-linguist', '~> 4.7.0', require: 'linguist'
# API
-gem 'grape', '~> 0.15.0'
+gem 'grape', '~> 0.18.0'
gem 'grape-entity', '~> 0.6.0'
gem 'rack-cors', '~> 0.4.0', require: 'rack/cors'
diff --git a/Gemfile.lock b/Gemfile.lock
index 3de1a7cbf26..574c6a3aa61 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -282,15 +282,15 @@ GEM
json
multi_json
request_store (>= 1.0)
- grape (0.15.0)
+ grape (0.18.0)
activesupport
builder
hashie (>= 2.1.0)
multi_json (>= 1.3.2)
multi_xml (>= 0.5.2)
+ mustermann-grape (~> 0.4.0)
rack (>= 1.3.0)
rack-accept
- rack-mount
virtus (>= 1.0.0)
grape-entity (0.6.0)
activesupport
@@ -385,6 +385,10 @@ GEM
multi_json (1.12.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
+ mustermann (0.4.0)
+ tool (~> 0.2)
+ mustermann-grape (0.4.0)
+ mustermann (= 0.4.0)
mysql2 (0.3.20)
net-ldap (0.12.1)
net-ssh (3.0.1)
@@ -495,8 +499,6 @@ GEM
rack-attack (4.4.1)
rack
rack-cors (0.4.0)
- rack-mount (0.8.3)
- rack (>= 1.0.0)
rack-oauth2 (1.2.3)
activesupport (>= 2.3)
attr_required (>= 0.0.5)
@@ -722,6 +724,7 @@ GEM
tilt (2.0.5)
timecop (0.8.1)
timfel-krb5-auth (0.8.3)
+ tool (0.2.3)
truncato (0.7.8)
htmlentities (~> 4.3.1)
nokogiri (~> 1.6.1)
@@ -840,7 +843,7 @@ DEPENDENCIES
gollum-lib (~> 4.2)
gollum-rugged_adapter (~> 0.4.2)
gon (~> 6.1.0)
- grape (~> 0.15.0)
+ grape (~> 0.18.0)
grape-entity (~> 0.6.0)
haml_lint (~> 0.18.2)
hamlit (~> 2.6.1)
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 746849ef4c0..4f3da8a035e 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -301,7 +301,7 @@ module API
header['X-Sendfile'] = path
body
else
- file FileStreamer.new(path)
+ file path
end
end
diff --git a/lib/gitlab/metrics/rack_middleware.rb b/lib/gitlab/metrics/rack_middleware.rb
index 01c96a6fe96..dfc0b34f4a9 100644
--- a/lib/gitlab/metrics/rack_middleware.rb
+++ b/lib/gitlab/metrics/rack_middleware.rb
@@ -70,8 +70,8 @@ module Gitlab
def tag_endpoint(trans, env)
endpoint = env[ENDPOINT_KEY]
- path = endpoint_paths_cache[endpoint.route.route_method][endpoint.route.route_path]
- trans.action = "Grape##{endpoint.route.route_method} #{path}"
+ path = endpoint_paths_cache[endpoint.route.request_method][endpoint.route.route_path]
+ trans.action = "Grape##{endpoint.route.request_method} #{path}"
end
private
diff --git a/spec/lib/gitlab/metrics/rack_middleware_spec.rb b/spec/lib/gitlab/metrics/rack_middleware_spec.rb
index bcaffd27909..90d8e574be2 100644
--- a/spec/lib/gitlab/metrics/rack_middleware_spec.rb
+++ b/spec/lib/gitlab/metrics/rack_middleware_spec.rb
@@ -33,7 +33,7 @@ describe Gitlab::Metrics::RackMiddleware do
end
it 'tags a transaction with the method and path of the route in the grape endpoint' do
- route = double(:route, route_method: "GET", route_path: "/:version/projects/:id/archive(.:format)")
+ route = double(:route, request_method: "GET", route_path: "/:version/projects/:id/archive(.:format)")
endpoint = double(:endpoint, route: route)
env['api.endpoint'] = endpoint
@@ -117,7 +117,7 @@ describe Gitlab::Metrics::RackMiddleware do
let(:transaction) { middleware.transaction_from_env(env) }
it 'tags a transaction with the method and path of the route in the grape endpount' do
- route = double(:route, route_method: "GET", route_path: "/:version/projects/:id/archive(.:format)")
+ route = double(:route, request_method: "GET", route_path: "/:version/projects/:id/archive(.:format)")
endpoint = double(:endpoint, route: route)
env['api.endpoint'] = endpoint