Skip to content

Commit abfdaea

Browse files
committed
Rename lint_api! to lint!
1 parent e4d5c35 commit abfdaea

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

lib/grape.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def self.deprecator
7575

7676
configure do |config|
7777
config.param_builder = :hash_with_indifferent_access
78-
config.lint_api = false
78+
config.lint = false
7979
config.compile_methods!
8080
end
8181
end

lib/grape/dsl/routing.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def do_not_route_options!
8181
namespace_inheritable(:do_not_route_options, true)
8282
end
8383

84-
def lint_api!
85-
namespace_inheritable(:lint_api, true)
84+
def lint!
85+
namespace_inheritable(:lint, true)
8686
end
8787

8888
def do_not_document!

lib/grape/endpoint.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def build_stack(helpers)
358358
format = namespace_inheritable(:format)
359359

360360
stack.use Rack::Head
361-
stack.use Rack::Lint if lint_api?
361+
stack.use Rack::Lint if lint?
362362
stack.use Class.new(Grape::Middleware::Error),
363363
helpers: helpers,
364364
format: format,
@@ -410,8 +410,8 @@ def build_response_cookies
410410
end
411411
end
412412

413-
def lint_api?
414-
namespace_inheritable(:lint_api) || Grape.config.lint_api
413+
def lint?
414+
namespace_inheritable(:lint) || Grape.config.lint
415415
end
416416
end
417417
end

spec/grape/api_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4739,20 +4739,20 @@ def uniqe_id_route
47394739
end
47404740
end
47414741

4742-
describe '.lint_api!' do
4742+
describe '.lint!' do
47434743
let(:app) do
47444744
Class.new(described_class) do
4745-
lint_api!
4745+
lint!
47464746
get '/' do
47474747
status 42
47484748
end
47494749
end
47504750
end
47514751

47524752
around do |example|
4753-
Grape.config.lint_api = false
4753+
Grape.config.lint = false
47544754
example.run
4755-
Grape.config.lint_api = true
4755+
Grape.config.lint = true
47564756
end
47574757

47584758
it 'raises a Rack::Lint error' do

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
end
1414
end
1515

16-
Grape.config.lint_api = true # lint all apis by default
16+
Grape.config.lint = true # lint all apis by default
1717
Grape::Util::Registry.include(Deregister)
1818
# issue with ruby 2.7 with ^. We need to extend it again
1919
Grape::Validations.extend(Grape::Util::Registry) if Gem::Version.new(RUBY_VERSION).release < Gem::Version.new('3.0')

0 commit comments

Comments
 (0)