grape 0.19.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grape might be problematic. Click here for more details.

Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Appraisals +8 -0
  3. data/CHANGELOG.md +40 -22
  4. data/Gemfile +1 -0
  5. data/Gemfile.lock +58 -59
  6. data/LICENSE +1 -1
  7. data/README.md +94 -49
  8. data/Rakefile +1 -0
  9. data/UPGRADING.md +89 -0
  10. data/benchmark/simple_with_type_coercer.rb +22 -0
  11. data/gemfiles/multi_json.gemfile +36 -0
  12. data/gemfiles/multi_xml.gemfile +36 -0
  13. data/gemfiles/rack_1.5.2.gemfile +1 -0
  14. data/gemfiles/rack_edge.gemfile +1 -0
  15. data/gemfiles/rails_3.gemfile +1 -0
  16. data/gemfiles/rails_4.gemfile +1 -0
  17. data/gemfiles/rails_5.gemfile +1 -0
  18. data/gemfiles/rails_edge.gemfile +1 -0
  19. data/grape.gemspec +0 -3
  20. data/lib/grape.rb +40 -17
  21. data/lib/grape/dsl/helpers.rb +32 -18
  22. data/lib/grape/dsl/inside_route.rb +2 -2
  23. data/lib/grape/dsl/parameters.rb +26 -0
  24. data/lib/grape/dsl/routing.rb +1 -1
  25. data/lib/grape/dsl/settings.rb +1 -1
  26. data/lib/grape/endpoint.rb +20 -16
  27. data/lib/grape/error_formatter/json.rb +1 -1
  28. data/lib/grape/error_formatter/txt.rb +1 -1
  29. data/lib/grape/extensions/active_support/hash_with_indifferent_access.rb +26 -0
  30. data/lib/grape/extensions/deep_hash_with_indifferent_access.rb +18 -0
  31. data/lib/grape/extensions/deep_mergeable_hash.rb +19 -0
  32. data/lib/grape/extensions/deep_symbolize_hash.rb +30 -0
  33. data/lib/grape/extensions/hash.rb +23 -0
  34. data/lib/grape/extensions/hashie/mash.rb +24 -0
  35. data/lib/grape/formatter/json.rb +1 -1
  36. data/lib/grape/formatter/serializable_hash.rb +2 -2
  37. data/lib/grape/locale/en.yml +1 -1
  38. data/lib/grape/middleware/globals.rb +1 -1
  39. data/lib/grape/parser/json.rb +2 -2
  40. data/lib/grape/parser/xml.rb +2 -2
  41. data/lib/grape/request.rb +11 -10
  42. data/lib/grape/util/json.rb +8 -0
  43. data/lib/grape/util/xml.rb +8 -0
  44. data/lib/grape/validations.rb +4 -0
  45. data/lib/grape/validations/params_scope.rb +77 -39
  46. data/lib/grape/validations/types/build_coercer.rb +27 -0
  47. data/lib/grape/validations/types/custom_type_coercer.rb +18 -4
  48. data/lib/grape/validations/types/file.rb +2 -3
  49. data/lib/grape/validations/validator_factory.rb +18 -0
  50. data/lib/grape/validations/validators/base.rb +4 -5
  51. data/lib/grape/validations/validators/coerce.rb +4 -0
  52. data/lib/grape/validations/validators/except_values.rb +20 -0
  53. data/lib/grape/validations/validators/values.rb +25 -5
  54. data/lib/grape/version.rb +1 -1
  55. data/spec/grape/api/invalid_format_spec.rb +3 -3
  56. data/spec/grape/api_spec.rb +28 -16
  57. data/spec/grape/dsl/helpers_spec.rb +25 -6
  58. data/spec/grape/endpoint_spec.rb +117 -13
  59. data/spec/grape/extensions/param_builders/hash_spec.rb +83 -0
  60. data/spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb +105 -0
  61. data/spec/grape/extensions/param_builders/hashie/mash_spec.rb +79 -0
  62. data/spec/grape/middleware/formatter_spec.rb +6 -2
  63. data/spec/grape/request_spec.rb +13 -3
  64. data/spec/grape/validations/instance_behaivour_spec.rb +44 -0
  65. data/spec/grape/validations/params_scope_spec.rb +23 -0
  66. data/spec/grape/validations/types_spec.rb +19 -0
  67. data/spec/grape/validations/validators/coerce_spec.rb +117 -8
  68. data/spec/grape/validations/validators/except_values_spec.rb +191 -0
  69. data/spec/grape/validations/validators/values_spec.rb +78 -0
  70. data/spec/integration/multi_json/json_spec.rb +7 -0
  71. data/spec/integration/multi_xml/xml_spec.rb +7 -0
  72. metadata +30 -46
  73. data/pkg/grape-0.18.0.gem +0 -0
Binary file