lib/grape.rb in grape-0.19.2 vs lib/grape.rb in grape-1.0.0

- old
+ new

@@ -2,11 +2,10 @@ require 'rack' require 'rack/builder' require 'rack/accept' require 'rack/auth/basic' require 'rack/auth/digest/md5' -require 'hashie' require 'set' require 'active_support/version' require 'active_support/core_ext/hash/indifferent_access' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/array/extract_options' @@ -15,21 +14,19 @@ require 'active_support/core_ext/hash/reverse_merge' require 'active_support/core_ext/hash/except' require 'active_support/core_ext/hash/conversions' require 'active_support/dependencies/autoload' require 'active_support/notifications' -require 'multi_json' -require 'multi_xml' require 'i18n' require 'thread' require 'virtus' I18n.load_path << File.expand_path('../grape/locale/en.yml', __FILE__) module Grape - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload eager_autoload do autoload :API autoload :Endpoint autoload :Router @@ -43,21 +40,23 @@ autoload :ErrorFormatter autoload :Formatter autoload :Parser autoload :Request autoload :Env, 'grape/util/env' + autoload :Json, 'grape/util/json' + autoload :Xml, 'grape/util/xml' end module Http - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload eager_autoload do autoload :Headers end end module Exceptions - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :Base autoload :Validation autoload :ValidationArrayErrors autoload :ValidationErrors autoload :MissingVendorOption @@ -76,69 +75,91 @@ autoload :InvalidAcceptHeader autoload :InvalidVersionHeader autoload :MethodNotAllowed end + module Extensions + extend ::ActiveSupport::Autoload + + autoload :DeepMergeableHash + autoload :DeepSymbolizeHash + autoload :DeepHashWithIndifferentAccess + autoload :Hash + + module ActiveSupport + extend ::ActiveSupport::Autoload + + autoload :HashWithIndifferentAccess + end + + module Hashie + extend ::ActiveSupport::Autoload + + autoload :Mash + end + end + module Middleware - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :Base autoload :Versioner autoload :Formatter autoload :Error autoload :Globals + autoload :Stack module Auth - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :Base autoload :DSL autoload :StrategyInfo autoload :Strategies end module Versioner - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :Path autoload :Header autoload :Param autoload :AcceptVersionHeader end end module Util - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :InheritableValues autoload :StackableValues autoload :ReverseStackableValues autoload :InheritableSetting autoload :StrictHashConfiguration autoload :Registrable end module ErrorFormatter - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :Base autoload :Json autoload :Txt autoload :Xml end module Formatter - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :Json autoload :SerializableHash autoload :Txt autoload :Xml end module Parser - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :Json autoload :Xml end module DSL - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload eager_autoload do autoload :API autoload :Callbacks autoload :Settings autoload :Configuration @@ -153,21 +174,21 @@ autoload :Desc end end class API - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :Helpers end module Presenters - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :Presenter end module ServeFile - extend ActiveSupport::Autoload + extend ::ActiveSupport::Autoload autoload :FileResponse autoload :FileBody autoload :SendfileResponse end end @@ -183,10 +204,12 @@ require 'grape/validations/validators/exactly_one_of' require 'grape/validations/validators/mutual_exclusion' require 'grape/validations/validators/presence' require 'grape/validations/validators/regexp' require 'grape/validations/validators/values' +require 'grape/validations/validators/except_values' require 'grape/validations/params_scope' require 'grape/validations/validators/all_or_none' require 'grape/validations/types' +require 'grape/validations/validator_factory' require 'grape/version'