endpoint-flux 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +36 -0
  3. data/CONTRIBUTING.md +18 -0
  4. data/Gemfile +6 -0
  5. data/Gemfile.lock +37 -0
  6. data/README.md +607 -0
  7. data/circle.yml +14 -0
  8. data/endpoint_flux.gemspec +17 -0
  9. data/lib/endpoint_flux.rb +20 -0
  10. data/lib/endpoint_flux/class_loader.rb +58 -0
  11. data/lib/endpoint_flux/config.rb +85 -0
  12. data/lib/endpoint_flux/config/interceptor.rb +23 -0
  13. data/lib/endpoint_flux/config/middleware.rb +38 -0
  14. data/lib/endpoint_flux/config/rescue_from.rb +28 -0
  15. data/lib/endpoint_flux/endpoint.rb +81 -0
  16. data/lib/endpoint_flux/exceptions.rb +10 -0
  17. data/lib/endpoint_flux/exceptions/base.rb +21 -0
  18. data/lib/endpoint_flux/exceptions/forbidden.rb +12 -0
  19. data/lib/endpoint_flux/exceptions/not_found.rb +12 -0
  20. data/lib/endpoint_flux/exceptions/service_unavailable.rb +12 -0
  21. data/lib/endpoint_flux/exceptions/unauthorized.rb +12 -0
  22. data/lib/endpoint_flux/exceptions/validation.rb +13 -0
  23. data/lib/endpoint_flux/middlewares.rb +8 -0
  24. data/lib/endpoint_flux/middlewares/authenticator/skip.rb +11 -0
  25. data/lib/endpoint_flux/middlewares/authorizator/skip.rb +11 -0
  26. data/lib/endpoint_flux/middlewares/decorator/add_status.rb +12 -0
  27. data/lib/endpoint_flux/middlewares/decorator/skip.rb +11 -0
  28. data/lib/endpoint_flux/middlewares/policy/skip.rb +11 -0
  29. data/lib/endpoint_flux/middlewares/validator/empty.rb +12 -0
  30. data/lib/endpoint_flux/rails/concerns/endpoint_controller.rb +32 -0
  31. data/lib/endpoint_flux/request.rb +15 -0
  32. data/lib/endpoint_flux/response.rb +30 -0
  33. data/lib/endpoint_flux/version.rb +3 -0
  34. data/spec/lib/class_loader_spec.rb +31 -0
  35. data/spec/lib/config/default_middlewares_spec.rb +21 -0
  36. data/spec/lib/config/endpoints_namespace_spec.rb +13 -0
  37. data/spec/lib/config/flow_spec.rb +8 -0
  38. data/spec/lib/config/interceptor_spec.rb +34 -0
  39. data/spec/lib/config/middleware_spec.rb +62 -0
  40. data/spec/lib/config/rescue_from_spec.rb +45 -0
  41. data/spec/lib/endpoint/flow_spec.rb +43 -0
  42. data/spec/lib/endpoint/middlewares_spec.rb +110 -0
  43. data/spec/lib/endpoint/perform_spec.rb +61 -0
  44. data/spec/lib/endpoint/rescue_from_spec.rb +61 -0
  45. data/spec/lib/exceptions/forbidden_spec.rb +12 -0
  46. data/spec/lib/exceptions/not_found_spec.rb +12 -0
  47. data/spec/lib/exceptions/service_unavailable_spec.rb +12 -0
  48. data/spec/lib/exceptions/unauthorized_spec.rb +12 -0
  49. data/spec/lib/exceptions/validation_spec.rb +14 -0
  50. data/spec/lib/middlewares/authenticator/skip_spec.rb +5 -0
  51. data/spec/lib/middlewares/authorizator/skip_spec.rb +5 -0
  52. data/spec/lib/middlewares/decorator/add_status_spec.rb +17 -0
  53. data/spec/lib/middlewares/decorator/skip_spec.rb +5 -0
  54. data/spec/lib/middlewares/policy/skip_spec.rb +5 -0
  55. data/spec/lib/middlewares/shared_examples.rb +19 -0
  56. data/spec/lib/middlewares/validator/empty_spec.rb +15 -0
  57. data/spec/lib/response_spec.rb +131 -0
  58. data/spec/spec_helper.rb +52 -0
  59. metadata +153 -0
@@ -0,0 +1,52 @@
1
+ require 'byebug'
2
+ require 'endpoint_flux'
3
+
4
+ # This file was generated by the `rspec --init` command. Conventionally, all
5
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
6
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
7
+ # this file to always be loaded, without a need to explicitly require it in any
8
+ # files.
9
+ #
10
+ # Given that it is always loaded, you are encouraged to keep this file as
11
+ # light-weight as possible. Requiring heavyweight dependencies from this file
12
+ # will add to the boot time of your test suite on EVERY test run, even for an
13
+ # individual file that may not need all of that loaded. Instead, consider making
14
+ # a separate helper file that requires the additional dependencies and performs
15
+ # the additional setup, and require it from the spec files that actually need
16
+ # it.
17
+ #
18
+ # The `.rspec` file also contains a few flags that are not defaults but that
19
+ # users commonly want.
20
+ #
21
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
22
+ RSpec.configure do |config|
23
+ # rspec-expectations config goes here. You can use an alternate
24
+ # assertion/expectation library such as wrong or the stdlib/minitest
25
+ # assertions if you prefer.
26
+ config.expect_with :rspec do |expectations|
27
+ # This option will default to `true` in RSpec 4. It makes the `description`
28
+ # and `failure_message` of custom matchers include text for helper methods
29
+ # defined using `chain`, e.g.:
30
+ # be_bigger_than(2).and_smaller_than(4).description
31
+ # # => "be bigger than 2 and smaller than 4"
32
+ # ...rather than:
33
+ # # => "be bigger than 2"
34
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
35
+ end
36
+
37
+ # rspec-mocks config goes here. You can use an alternate test double
38
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
39
+ config.mock_with :rspec do |mocks|
40
+ # Prevents you from mocking or stubbing a method that does not exist on
41
+ # a real object. This is generally recommended, and will default to
42
+ # `true` in RSpec 4.
43
+ mocks.verify_partial_doubles = true
44
+ end
45
+
46
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
47
+ # have no way to turn it off -- the option exists only for backwards
48
+ # compatibility in RSpec 3). It causes shared context metadata to be
49
+ # inherited by the metadata hash of host groups and examples, rather than
50
+ # triggering implicit auto-inclusion in groups with matching metadata.
51
+ config.shared_context_metadata_behavior = :apply_to_host_groups
52
+ end
metadata ADDED
@@ -0,0 +1,153 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: endpoint-flux
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Arturs Kreipans
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-01-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: byebug
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A simple way to organise API endpoints
42
+ email:
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - ".gitignore"
48
+ - CONTRIBUTING.md
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - README.md
52
+ - circle.yml
53
+ - endpoint_flux.gemspec
54
+ - lib/endpoint_flux.rb
55
+ - lib/endpoint_flux/class_loader.rb
56
+ - lib/endpoint_flux/config.rb
57
+ - lib/endpoint_flux/config/interceptor.rb
58
+ - lib/endpoint_flux/config/middleware.rb
59
+ - lib/endpoint_flux/config/rescue_from.rb
60
+ - lib/endpoint_flux/endpoint.rb
61
+ - lib/endpoint_flux/exceptions.rb
62
+ - lib/endpoint_flux/exceptions/base.rb
63
+ - lib/endpoint_flux/exceptions/forbidden.rb
64
+ - lib/endpoint_flux/exceptions/not_found.rb
65
+ - lib/endpoint_flux/exceptions/service_unavailable.rb
66
+ - lib/endpoint_flux/exceptions/unauthorized.rb
67
+ - lib/endpoint_flux/exceptions/validation.rb
68
+ - lib/endpoint_flux/middlewares.rb
69
+ - lib/endpoint_flux/middlewares/authenticator/skip.rb
70
+ - lib/endpoint_flux/middlewares/authorizator/skip.rb
71
+ - lib/endpoint_flux/middlewares/decorator/add_status.rb
72
+ - lib/endpoint_flux/middlewares/decorator/skip.rb
73
+ - lib/endpoint_flux/middlewares/policy/skip.rb
74
+ - lib/endpoint_flux/middlewares/validator/empty.rb
75
+ - lib/endpoint_flux/rails/concerns/endpoint_controller.rb
76
+ - lib/endpoint_flux/request.rb
77
+ - lib/endpoint_flux/response.rb
78
+ - lib/endpoint_flux/version.rb
79
+ - spec/lib/class_loader_spec.rb
80
+ - spec/lib/config/default_middlewares_spec.rb
81
+ - spec/lib/config/endpoints_namespace_spec.rb
82
+ - spec/lib/config/flow_spec.rb
83
+ - spec/lib/config/interceptor_spec.rb
84
+ - spec/lib/config/middleware_spec.rb
85
+ - spec/lib/config/rescue_from_spec.rb
86
+ - spec/lib/endpoint/flow_spec.rb
87
+ - spec/lib/endpoint/middlewares_spec.rb
88
+ - spec/lib/endpoint/perform_spec.rb
89
+ - spec/lib/endpoint/rescue_from_spec.rb
90
+ - spec/lib/exceptions/forbidden_spec.rb
91
+ - spec/lib/exceptions/not_found_spec.rb
92
+ - spec/lib/exceptions/service_unavailable_spec.rb
93
+ - spec/lib/exceptions/unauthorized_spec.rb
94
+ - spec/lib/exceptions/validation_spec.rb
95
+ - spec/lib/middlewares/authenticator/skip_spec.rb
96
+ - spec/lib/middlewares/authorizator/skip_spec.rb
97
+ - spec/lib/middlewares/decorator/add_status_spec.rb
98
+ - spec/lib/middlewares/decorator/skip_spec.rb
99
+ - spec/lib/middlewares/policy/skip_spec.rb
100
+ - spec/lib/middlewares/shared_examples.rb
101
+ - spec/lib/middlewares/validator/empty_spec.rb
102
+ - spec/lib/response_spec.rb
103
+ - spec/spec_helper.rb
104
+ homepage: http://rubygems.org/gems/endpoint-flux
105
+ licenses:
106
+ - MIT
107
+ metadata: {}
108
+ post_install_message:
109
+ rdoc_options: []
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ requirements: []
123
+ rubyforge_project:
124
+ rubygems_version: 2.7.6
125
+ signing_key:
126
+ specification_version: 4
127
+ summary: EndpointFlux!
128
+ test_files:
129
+ - spec/lib/class_loader_spec.rb
130
+ - spec/lib/config/default_middlewares_spec.rb
131
+ - spec/lib/config/endpoints_namespace_spec.rb
132
+ - spec/lib/config/flow_spec.rb
133
+ - spec/lib/config/interceptor_spec.rb
134
+ - spec/lib/config/middleware_spec.rb
135
+ - spec/lib/config/rescue_from_spec.rb
136
+ - spec/lib/endpoint/flow_spec.rb
137
+ - spec/lib/endpoint/middlewares_spec.rb
138
+ - spec/lib/endpoint/perform_spec.rb
139
+ - spec/lib/endpoint/rescue_from_spec.rb
140
+ - spec/lib/exceptions/forbidden_spec.rb
141
+ - spec/lib/exceptions/not_found_spec.rb
142
+ - spec/lib/exceptions/service_unavailable_spec.rb
143
+ - spec/lib/exceptions/unauthorized_spec.rb
144
+ - spec/lib/exceptions/validation_spec.rb
145
+ - spec/lib/middlewares/authenticator/skip_spec.rb
146
+ - spec/lib/middlewares/authorizator/skip_spec.rb
147
+ - spec/lib/middlewares/decorator/add_status_spec.rb
148
+ - spec/lib/middlewares/decorator/skip_spec.rb
149
+ - spec/lib/middlewares/policy/skip_spec.rb
150
+ - spec/lib/middlewares/shared_examples.rb
151
+ - spec/lib/middlewares/validator/empty_spec.rb
152
+ - spec/lib/response_spec.rb
153
+ - spec/spec_helper.rb