grape 1.6.0 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/CONTRIBUTING.md +2 -1
  4. data/README.md +9 -1
  5. data/UPGRADING.md +4 -4
  6. data/lib/grape/api.rb +12 -0
  7. data/lib/grape/dsl/headers.rb +5 -2
  8. data/lib/grape/dsl/helpers.rb +1 -1
  9. data/lib/grape/middleware/auth/dsl.rb +7 -1
  10. data/lib/grape/middleware/base.rb +1 -1
  11. data/lib/grape/util/strict_hash_configuration.rb +1 -1
  12. data/lib/grape/validations/validators/all_or_none.rb +7 -5
  13. data/lib/grape/validations/validators/allow_blank.rb +9 -7
  14. data/lib/grape/validations/validators/as.rb +7 -5
  15. data/lib/grape/validations/validators/at_least_one_of.rb +6 -4
  16. data/lib/grape/validations/validators/base.rb +73 -71
  17. data/lib/grape/validations/validators/coerce.rb +63 -75
  18. data/lib/grape/validations/validators/default.rb +36 -34
  19. data/lib/grape/validations/validators/exactly_one_of.rb +8 -6
  20. data/lib/grape/validations/validators/except_values.rb +13 -11
  21. data/lib/grape/validations/validators/multiple_params_base.rb +24 -22
  22. data/lib/grape/validations/validators/mutual_exclusion.rb +7 -5
  23. data/lib/grape/validations/validators/presence.rb +6 -4
  24. data/lib/grape/validations/validators/regexp.rb +7 -5
  25. data/lib/grape/validations/validators/same_as.rb +17 -15
  26. data/lib/grape/validations/validators/values.rb +59 -57
  27. data/lib/grape/validations.rb +6 -0
  28. data/lib/grape/version.rb +1 -1
  29. data/lib/grape.rb +2 -0
  30. data/spec/grape/api/custom_validations_spec.rb +77 -46
  31. data/spec/grape/api/deeply_included_options_spec.rb +3 -3
  32. data/spec/grape/api/defines_boolean_in_params_spec.rb +2 -1
  33. data/spec/grape/api/invalid_format_spec.rb +2 -0
  34. data/spec/grape/api/recognize_path_spec.rb +1 -1
  35. data/spec/grape/api/shared_helpers_exactly_one_of_spec.rb +9 -15
  36. data/spec/grape/api_remount_spec.rb +16 -15
  37. data/spec/grape/api_spec.rb +317 -193
  38. data/spec/grape/dsl/callbacks_spec.rb +1 -0
  39. data/spec/grape/dsl/headers_spec.rb +39 -9
  40. data/spec/grape/dsl/helpers_spec.rb +3 -2
  41. data/spec/grape/dsl/inside_route_spec.rb +6 -4
  42. data/spec/grape/dsl/logger_spec.rb +16 -18
  43. data/spec/grape/dsl/middleware_spec.rb +1 -0
  44. data/spec/grape/dsl/parameters_spec.rb +1 -0
  45. data/spec/grape/dsl/request_response_spec.rb +1 -0
  46. data/spec/grape/dsl/routing_spec.rb +9 -6
  47. data/spec/grape/endpoint/declared_spec.rb +12 -12
  48. data/spec/grape/endpoint_spec.rb +59 -50
  49. data/spec/grape/entity_spec.rb +13 -13
  50. data/spec/grape/exceptions/body_parse_errors_spec.rb +3 -0
  51. data/spec/grape/exceptions/invalid_accept_header_spec.rb +61 -22
  52. data/spec/grape/exceptions/validation_errors_spec.rb +13 -10
  53. data/spec/grape/exceptions/validation_spec.rb +5 -3
  54. data/spec/grape/extensions/param_builders/hash_spec.rb +7 -7
  55. data/spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb +8 -8
  56. data/spec/grape/extensions/param_builders/hashie/mash_spec.rb +8 -8
  57. data/spec/grape/integration/rack_sendfile_spec.rb +1 -1
  58. data/spec/grape/loading_spec.rb +8 -8
  59. data/spec/grape/middleware/auth/dsl_spec.rb +14 -5
  60. data/spec/grape/middleware/auth/strategies_spec.rb +60 -20
  61. data/spec/grape/middleware/base_spec.rb +24 -15
  62. data/spec/grape/middleware/error_spec.rb +1 -0
  63. data/spec/grape/middleware/exception_spec.rb +111 -161
  64. data/spec/grape/middleware/formatter_spec.rb +25 -4
  65. data/spec/grape/middleware/globals_spec.rb +7 -4
  66. data/spec/grape/middleware/stack_spec.rb +11 -11
  67. data/spec/grape/middleware/versioner/accept_version_header_spec.rb +2 -1
  68. data/spec/grape/middleware/versioner/header_spec.rb +14 -13
  69. data/spec/grape/middleware/versioner/param_spec.rb +7 -1
  70. data/spec/grape/middleware/versioner/path_spec.rb +5 -1
  71. data/spec/grape/middleware/versioner_spec.rb +1 -1
  72. data/spec/grape/parser_spec.rb +4 -0
  73. data/spec/grape/path_spec.rb +52 -52
  74. data/spec/grape/presenters/presenter_spec.rb +7 -6
  75. data/spec/grape/request_spec.rb +6 -4
  76. data/spec/grape/util/inheritable_setting_spec.rb +7 -7
  77. data/spec/grape/util/inheritable_values_spec.rb +3 -2
  78. data/spec/grape/util/reverse_stackable_values_spec.rb +3 -1
  79. data/spec/grape/util/stackable_values_spec.rb +7 -5
  80. data/spec/grape/validations/instance_behaivour_spec.rb +9 -10
  81. data/spec/grape/validations/multiple_attributes_iterator_spec.rb +1 -0
  82. data/spec/grape/validations/params_scope_spec.rb +9 -7
  83. data/spec/grape/validations/single_attribute_iterator_spec.rb +1 -0
  84. data/spec/grape/validations/types/primitive_coercer_spec.rb +2 -2
  85. data/spec/grape/validations/types_spec.rb +8 -8
  86. data/spec/grape/validations/validators/all_or_none_spec.rb +50 -56
  87. data/spec/grape/validations/validators/allow_blank_spec.rb +136 -140
  88. data/spec/grape/validations/validators/at_least_one_of_spec.rb +50 -56
  89. data/spec/grape/validations/validators/coerce_spec.rb +10 -12
  90. data/spec/grape/validations/validators/default_spec.rb +72 -78
  91. data/spec/grape/validations/validators/exactly_one_of_spec.rb +71 -77
  92. data/spec/grape/validations/validators/except_values_spec.rb +1 -1
  93. data/spec/grape/validations/validators/mutual_exclusion_spec.rb +71 -77
  94. data/spec/grape/validations/validators/presence_spec.rb +16 -1
  95. data/spec/grape/validations/validators/regexp_spec.rb +25 -31
  96. data/spec/grape/validations/validators/same_as_spec.rb +14 -20
  97. data/spec/grape/validations/validators/values_spec.rb +172 -171
  98. data/spec/grape/validations_spec.rb +45 -16
  99. data/spec/integration/eager_load/eager_load_spec.rb +2 -2
  100. data/spec/integration/multi_json/json_spec.rb +1 -1
  101. data/spec/integration/multi_xml/xml_spec.rb +1 -1
  102. data/spec/shared/versioning_examples.rb +10 -7
  103. data/spec/spec_helper.rb +11 -1
  104. metadata +102 -102
@@ -2,47 +2,49 @@
2
2
 
3
3
  module Grape
4
4
  module Validations
5
- class DefaultValidator < Base
6
- def initialize(attrs, options, required, scope, **opts)
7
- @default = options
8
- super
9
- end
5
+ module Validators
6
+ class DefaultValidator < Base
7
+ def initialize(attrs, options, required, scope, **opts)
8
+ @default = options
9
+ super
10
+ end
10
11
 
11
- def validate_param!(attr_name, params)
12
- params[attr_name] = if @default.is_a? Proc
13
- @default.call
14
- elsif @default.frozen? || !duplicatable?(@default)
15
- @default
16
- else
17
- duplicate(@default)
18
- end
19
- end
12
+ def validate_param!(attr_name, params)
13
+ params[attr_name] = if @default.is_a? Proc
14
+ @default.call
15
+ elsif @default.frozen? || !duplicatable?(@default)
16
+ @default
17
+ else
18
+ duplicate(@default)
19
+ end
20
+ end
20
21
 
21
- def validate!(params)
22
- attrs = SingleAttributeIterator.new(self, @scope, params)
23
- attrs.each do |resource_params, attr_name|
24
- next unless @scope.meets_dependency?(resource_params, params)
22
+ def validate!(params)
23
+ attrs = SingleAttributeIterator.new(self, @scope, params)
24
+ attrs.each do |resource_params, attr_name|
25
+ next unless @scope.meets_dependency?(resource_params, params)
25
26
 
26
- validate_param!(attr_name, resource_params) if resource_params.is_a?(Hash) && resource_params[attr_name].nil?
27
+ validate_param!(attr_name, resource_params) if resource_params.is_a?(Hash) && resource_params[attr_name].nil?
28
+ end
27
29
  end
28
- end
29
30
 
30
- private
31
+ private
31
32
 
32
- # return true if we might be able to dup this object
33
- def duplicatable?(obj)
34
- !obj.nil? &&
35
- obj != true &&
36
- obj != false &&
37
- !obj.is_a?(Symbol) &&
38
- !obj.is_a?(Numeric)
39
- end
33
+ # return true if we might be able to dup this object
34
+ def duplicatable?(obj)
35
+ !obj.nil? &&
36
+ obj != true &&
37
+ obj != false &&
38
+ !obj.is_a?(Symbol) &&
39
+ !obj.is_a?(Numeric)
40
+ end
40
41
 
41
- # make a best effort to dup the object
42
- def duplicate(obj)
43
- obj.dup
44
- rescue TypeError
45
- obj
42
+ # make a best effort to dup the object
43
+ def duplicate(obj)
44
+ obj.dup
45
+ rescue TypeError
46
+ obj
47
+ end
46
48
  end
47
49
  end
48
50
  end
@@ -4,13 +4,15 @@ require 'grape/validations/validators/multiple_params_base'
4
4
 
5
5
  module Grape
6
6
  module Validations
7
- class ExactlyOneOfValidator < MultipleParamsBase
8
- def validate_params!(params)
9
- keys = keys_in_common(params)
10
- return if keys.length == 1
11
- raise Grape::Exceptions::Validation.new(params: all_keys, message: message(:exactly_one)) if keys.length.zero?
7
+ module Validators
8
+ class ExactlyOneOfValidator < MultipleParamsBase
9
+ def validate_params!(params)
10
+ keys = keys_in_common(params)
11
+ return if keys.length == 1
12
+ raise Grape::Exceptions::Validation.new(params: all_keys, message: message(:exactly_one)) if keys.length.zero?
12
13
 
13
- raise Grape::Exceptions::Validation.new(params: keys, message: message(:mutual_exclusion))
14
+ raise Grape::Exceptions::Validation.new(params: keys, message: message(:mutual_exclusion))
15
+ end
14
16
  end
15
17
  end
16
18
  end
@@ -2,20 +2,22 @@
2
2
 
3
3
  module Grape
4
4
  module Validations
5
- class ExceptValuesValidator < Base
6
- def initialize(attrs, options, required, scope, **opts)
7
- @except = options.is_a?(Hash) ? options[:value] : options
8
- super
9
- end
5
+ module Validators
6
+ class ExceptValuesValidator < Base
7
+ def initialize(attrs, options, required, scope, **opts)
8
+ @except = options.is_a?(Hash) ? options[:value] : options
9
+ super
10
+ end
10
11
 
11
- def validate_param!(attr_name, params)
12
- return unless params.respond_to?(:key?) && params.key?(attr_name)
12
+ def validate_param!(attr_name, params)
13
+ return unless params.respond_to?(:key?) && params.key?(attr_name)
13
14
 
14
- excepts = @except.is_a?(Proc) ? @except.call : @except
15
- return if excepts.nil?
15
+ excepts = @except.is_a?(Proc) ? @except.call : @except
16
+ return if excepts.nil?
16
17
 
17
- param_array = params[attr_name].nil? ? [nil] : Array.wrap(params[attr_name])
18
- raise Grape::Exceptions::Validation.new(params: [@scope.full_name(attr_name)], message: message(:except_values)) if param_array.any? { |param| excepts.include?(param) }
18
+ param_array = params[attr_name].nil? ? [nil] : Array.wrap(params[attr_name])
19
+ raise Grape::Exceptions::Validation.new(params: [@scope.full_name(attr_name)], message: message(:except_values)) if param_array.any? { |param| excepts.include?(param) }
20
+ end
19
21
  end
20
22
  end
21
23
  end
@@ -2,34 +2,36 @@
2
2
 
3
3
  module Grape
4
4
  module Validations
5
- class MultipleParamsBase < Base
6
- def validate!(params)
7
- attributes = MultipleAttributesIterator.new(self, @scope, params)
8
- array_errors = []
9
-
10
- attributes.each do |resource_params, skip_value|
11
- next if skip_value
12
-
13
- begin
14
- validate_params!(resource_params)
15
- rescue Grape::Exceptions::Validation => e
16
- array_errors << e
5
+ module Validators
6
+ class MultipleParamsBase < Base
7
+ def validate!(params)
8
+ attributes = MultipleAttributesIterator.new(self, @scope, params)
9
+ array_errors = []
10
+
11
+ attributes.each do |resource_params, skip_value|
12
+ next if skip_value
13
+
14
+ begin
15
+ validate_params!(resource_params)
16
+ rescue Grape::Exceptions::Validation => e
17
+ array_errors << e
18
+ end
17
19
  end
18
- end
19
20
 
20
- raise Grape::Exceptions::ValidationArrayErrors.new(array_errors) if array_errors.any?
21
- end
21
+ raise Grape::Exceptions::ValidationArrayErrors.new(array_errors) if array_errors.any?
22
+ end
22
23
 
23
- private
24
+ private
24
25
 
25
- def keys_in_common(resource_params)
26
- return [] unless resource_params.is_a?(Hash)
26
+ def keys_in_common(resource_params)
27
+ return [] unless resource_params.is_a?(Hash)
27
28
 
28
- all_keys & resource_params.keys.map! { |attr| @scope.full_name(attr) }
29
- end
29
+ all_keys & resource_params.keys.map! { |attr| @scope.full_name(attr) }
30
+ end
30
31
 
31
- def all_keys
32
- attrs.map { |attr| @scope.full_name(attr) }
32
+ def all_keys
33
+ attrs.map { |attr| @scope.full_name(attr) }
34
+ end
33
35
  end
34
36
  end
35
37
  end
@@ -4,12 +4,14 @@ require 'grape/validations/validators/multiple_params_base'
4
4
 
5
5
  module Grape
6
6
  module Validations
7
- class MutualExclusionValidator < MultipleParamsBase
8
- def validate_params!(params)
9
- keys = keys_in_common(params)
10
- return if keys.length <= 1
7
+ module Validators
8
+ class MutualExclusionValidator < MultipleParamsBase
9
+ def validate_params!(params)
10
+ keys = keys_in_common(params)
11
+ return if keys.length <= 1
11
12
 
12
- raise Grape::Exceptions::Validation.new(params: keys, message: message(:mutual_exclusion))
13
+ raise Grape::Exceptions::Validation.new(params: keys, message: message(:mutual_exclusion))
14
+ end
13
15
  end
14
16
  end
15
17
  end
@@ -2,11 +2,13 @@
2
2
 
3
3
  module Grape
4
4
  module Validations
5
- class PresenceValidator < Base
6
- def validate_param!(attr_name, params)
7
- return if params.respond_to?(:key?) && params.key?(attr_name)
5
+ module Validators
6
+ class PresenceValidator < Base
7
+ def validate_param!(attr_name, params)
8
+ return if params.respond_to?(:key?) && params.key?(attr_name)
8
9
 
9
- raise Grape::Exceptions::Validation.new(params: [@scope.full_name(attr_name)], message: message(:presence))
10
+ raise Grape::Exceptions::Validation.new(params: [@scope.full_name(attr_name)], message: message(:presence))
11
+ end
10
12
  end
11
13
  end
12
14
  end
@@ -2,12 +2,14 @@
2
2
 
3
3
  module Grape
4
4
  module Validations
5
- class RegexpValidator < Base
6
- def validate_param!(attr_name, params)
7
- return unless params.respond_to?(:key?) && params.key?(attr_name)
8
- return if Array.wrap(params[attr_name]).all? { |param| param.nil? || param.to_s.match?((options_key?(:value) ? @option[:value] : @option)) }
5
+ module Validators
6
+ class RegexpValidator < Base
7
+ def validate_param!(attr_name, params)
8
+ return unless params.respond_to?(:key?) && params.key?(attr_name)
9
+ return if Array.wrap(params[attr_name]).all? { |param| param.nil? || param.to_s.match?((options_key?(:value) ? @option[:value] : @option)) }
9
10
 
10
- raise Grape::Exceptions::Validation.new(params: [@scope.full_name(attr_name)], message: message(:regexp))
11
+ raise Grape::Exceptions::Validation.new(params: [@scope.full_name(attr_name)], message: message(:regexp))
12
+ end
11
13
  end
12
14
  end
13
15
  end
@@ -2,24 +2,26 @@
2
2
 
3
3
  module Grape
4
4
  module Validations
5
- class SameAsValidator < Base
6
- def validate_param!(attr_name, params)
7
- confirmation = options_key?(:value) ? @option[:value] : @option
8
- return if params[attr_name] == params[confirmation]
5
+ module Validators
6
+ class SameAsValidator < Base
7
+ def validate_param!(attr_name, params)
8
+ confirmation = options_key?(:value) ? @option[:value] : @option
9
+ return if params[attr_name] == params[confirmation]
9
10
 
10
- raise Grape::Exceptions::Validation.new(
11
- params: [@scope.full_name(attr_name)],
12
- message: build_message
13
- )
14
- end
11
+ raise Grape::Exceptions::Validation.new(
12
+ params: [@scope.full_name(attr_name)],
13
+ message: build_message
14
+ )
15
+ end
15
16
 
16
- private
17
+ private
17
18
 
18
- def build_message
19
- if options_key?(:message)
20
- @option[:message]
21
- else
22
- format I18n.t(:same_as, scope: 'grape.errors.messages'), parameter: @option
19
+ def build_message
20
+ if options_key?(:message)
21
+ @option[:message]
22
+ else
23
+ format I18n.t(:same_as, scope: 'grape.errors.messages'), parameter: @option
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -2,84 +2,86 @@
2
2
 
3
3
  module Grape
4
4
  module Validations
5
- class ValuesValidator < Base
6
- def initialize(attrs, options, required, scope, **opts)
7
- if options.is_a?(Hash)
8
- @excepts = options[:except]
9
- @values = options[:value]
10
- @proc = options[:proc]
11
-
12
- warn '[DEPRECATION] The values validator except option is deprecated. ' \
13
- 'Use the except validator instead.' if @excepts
14
-
15
- raise ArgumentError, 'proc must be a Proc' if @proc && !@proc.is_a?(Proc)
16
-
17
- warn '[DEPRECATION] The values validator proc option is deprecated. ' \
18
- 'The lambda expression can now be assigned directly to values.' if @proc
19
- else
20
- @excepts = nil
21
- @values = nil
22
- @proc = nil
23
- @values = options
5
+ module Validators
6
+ class ValuesValidator < Base
7
+ def initialize(attrs, options, required, scope, **opts)
8
+ if options.is_a?(Hash)
9
+ @excepts = options[:except]
10
+ @values = options[:value]
11
+ @proc = options[:proc]
12
+
13
+ warn '[DEPRECATION] The values validator except option is deprecated. ' \
14
+ 'Use the except validator instead.' if @excepts
15
+
16
+ raise ArgumentError, 'proc must be a Proc' if @proc && !@proc.is_a?(Proc)
17
+
18
+ warn '[DEPRECATION] The values validator proc option is deprecated. ' \
19
+ 'The lambda expression can now be assigned directly to values.' if @proc
20
+ else
21
+ @excepts = nil
22
+ @values = nil
23
+ @proc = nil
24
+ @values = options
25
+ end
26
+ super
24
27
  end
25
- super
26
- end
27
28
 
28
- def validate_param!(attr_name, params)
29
- return unless params.is_a?(Hash)
29
+ def validate_param!(attr_name, params)
30
+ return unless params.is_a?(Hash)
30
31
 
31
- val = params[attr_name]
32
+ val = params[attr_name]
32
33
 
33
- return if val.nil? && !required_for_root_scope?
34
+ return if val.nil? && !required_for_root_scope?
34
35
 
35
- # don't forget that +false.blank?+ is true
36
- return if val != false && val.blank? && @allow_blank
36
+ # don't forget that +false.blank?+ is true
37
+ return if val != false && val.blank? && @allow_blank
37
38
 
38
- param_array = val.nil? ? [nil] : Array.wrap(val)
39
+ param_array = val.nil? ? [nil] : Array.wrap(val)
39
40
 
40
- raise validation_exception(attr_name, except_message) \
41
+ raise validation_exception(attr_name, except_message) \
41
42
  unless check_excepts(param_array)
42
43
 
43
- raise validation_exception(attr_name, message(:values)) \
44
+ raise validation_exception(attr_name, message(:values)) \
44
45
  unless check_values(param_array, attr_name)
45
46
 
46
- raise validation_exception(attr_name, message(:values)) \
47
+ raise validation_exception(attr_name, message(:values)) \
47
48
  if @proc && !param_array.all? { |param| @proc.call(param) }
48
- end
49
+ end
49
50
 
50
- private
51
+ private
51
52
 
52
- def check_values(param_array, attr_name)
53
- values = @values.is_a?(Proc) && @values.arity.zero? ? @values.call : @values
54
- return true if values.nil?
53
+ def check_values(param_array, attr_name)
54
+ values = @values.is_a?(Proc) && @values.arity.zero? ? @values.call : @values
55
+ return true if values.nil?
55
56
 
56
- begin
57
- return param_array.all? { |param| values.call(param) } if values.is_a? Proc
58
- rescue StandardError => e
59
- warn "Error '#{e}' raised while validating attribute '#{attr_name}'"
60
- return false
57
+ begin
58
+ return param_array.all? { |param| values.call(param) } if values.is_a? Proc
59
+ rescue StandardError => e
60
+ warn "Error '#{e}' raised while validating attribute '#{attr_name}'"
61
+ return false
62
+ end
63
+ param_array.all? { |param| values.include?(param) }
61
64
  end
62
- param_array.all? { |param| values.include?(param) }
63
- end
64
65
 
65
- def check_excepts(param_array)
66
- excepts = @excepts.is_a?(Proc) ? @excepts.call : @excepts
67
- return true if excepts.nil?
66
+ def check_excepts(param_array)
67
+ excepts = @excepts.is_a?(Proc) ? @excepts.call : @excepts
68
+ return true if excepts.nil?
68
69
 
69
- param_array.none? { |param| excepts.include?(param) }
70
- end
70
+ param_array.none? { |param| excepts.include?(param) }
71
+ end
71
72
 
72
- def except_message
73
- options = instance_variable_get(:@option)
74
- options_key?(:except_message) ? options[:except_message] : message(:except_values)
75
- end
73
+ def except_message
74
+ options = instance_variable_get(:@option)
75
+ options_key?(:except_message) ? options[:except_message] : message(:except_values)
76
+ end
76
77
 
77
- def required_for_root_scope?
78
- @required && @scope.root?
79
- end
78
+ def required_for_root_scope?
79
+ @required && @scope.root?
80
+ end
80
81
 
81
- def validation_exception(attr_name, message)
82
- Grape::Exceptions::Validation.new(params: [@scope.full_name(attr_name)], message: message)
82
+ def validation_exception(attr_name, message)
83
+ Grape::Exceptions::Validation.new(params: [@scope.full_name(attr_name)], message: message)
84
+ end
83
85
  end
84
86
  end
85
87
  end
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'grape/validations/attributes_iterator'
4
+ require 'grape/validations/single_attribute_iterator'
5
+ require 'grape/validations/multiple_attributes_iterator'
6
+ require 'grape/validations/params_scope'
7
+ require 'grape/validations/types'
8
+
3
9
  module Grape
4
10
  # Registry to store and locate known Validators.
5
11
  module Validations
data/lib/grape/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Grape
4
4
  # The current version of Grape.
5
- VERSION = '1.6.0'
5
+ VERSION = '1.6.2'
6
6
  end
data/lib/grape.rb CHANGED
@@ -7,7 +7,9 @@ require 'rack/accept'
7
7
  require 'rack/auth/basic'
8
8
  require 'rack/auth/digest/md5'
9
9
  require 'set'
10
+ require 'active_support'
10
11
  require 'active_support/version'
12
+ require 'active_support/isolated_execution_state' if ActiveSupport::VERSION::MAJOR > 6
11
13
  require 'active_support/core_ext/hash/indifferent_access'
12
14
  require 'active_support/core_ext/object/blank'
13
15
  require 'active_support/core_ext/array/extract_options'