diff --git a/.travis.yml b/.travis.yml index 1939eb156..134679cfe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,10 @@ matrix: gemfile: gemfiles/rails_5.gemfile - rvm: 2.7.1 gemfile: gemfiles/rails_6.gemfile + - rvm: 2.7.1 + gemfile: Gemfile + script: + - bundle exec rspec spec/integration/eager_load - rvm: 2.7.1 gemfile: gemfiles/multi_json.gemfile script: diff --git a/CHANGELOG.md b/CHANGELOG.md index 37928bf29..05a0cf331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ #### Features +* [#2072](https://github.com/ruby-grape/grape/pull/2072): Fix eager loading due to ServeStream rename - [@stanhu](https://github.com/stanhu). * [#1520](https://github.com/ruby-grape/grape/pull/1520): Un-deprecate stream-like objects - [@urkle](https://github.com/urkle). * [#2060](https://github.com/ruby-grape/grape/pull/2060): Drop support for Ruby 2.4 - [@dblock](https://github.com/dblock). * [#2060](https://github.com/ruby-grape/grape/pull/2060): Upgraded Rubocop to 0.84.0 - [@dblock](https://github.com/dblock). @@ -10,9 +11,10 @@ #### Fixes -* Your contribution here. * [#2067](https://github.com/ruby-grape/grape/pull/2067): Coerce empty string to nil for all primitive types except String - [@petekinnecom](https://github.com/petekinnecom). * [#2064](https://github.com/ruby-grape/grape/pull/2064): Fix Ruby 2.7 deprecation warning in `Grape::Middleware::Base#initialize` - [@skarger](https://github.com/skarger). +* [#2072](https://github.com/ruby-grape/grape/pull/2072): Fix `Grape.eager_load!` and `compile!` - [@stanhu](https://github.com/stanhu). +* Your contribution here. ### 1.3.3 (2020/05/23) diff --git a/lib/grape/eager_load.rb b/lib/grape/eager_load.rb index 91baa9e57..ef7bc3ec7 100644 --- a/lib/grape/eager_load.rb +++ b/lib/grape/eager_load.rb @@ -16,5 +16,5 @@ Grape::DSL.eager_load! Grape::API.eager_load! Grape::Presenters.eager_load! -Grape::ServeFile.eager_load! +Grape::ServeStream.eager_load! Rack::Head # AutoLoads the Rack::Head diff --git a/spec/integration/eager_load/eager_load_spec.rb b/spec/integration/eager_load/eager_load_spec.rb new file mode 100644 index 000000000..94b78e3e0 --- /dev/null +++ b/spec/integration/eager_load/eager_load_spec.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib')) +require 'grape' + +describe Grape do + it 'eager_load!' do + require 'grape/eager_load' + expect { Grape.eager_load! }.to_not raise_error + end + + it 'compile!' do + expect { Class.new(Grape::API).compile! }.to_not raise_error + end +end