trailblazer-endpoint 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +16 -0
  3. data/Appraisals +5 -0
  4. data/CHANGES.md +6 -0
  5. data/Rakefile +7 -1
  6. data/gemfiles/rails_app.gemfile +12 -0
  7. data/lib/trailblazer/endpoint.rb +20 -5
  8. data/lib/trailblazer/endpoint/adapter.rb +30 -121
  9. data/lib/trailblazer/endpoint/builder.rb +1 -1
  10. data/lib/trailblazer/endpoint/controller.rb +203 -1
  11. data/lib/trailblazer/endpoint/dsl.rb +6 -3
  12. data/lib/trailblazer/endpoint/options.rb +13 -44
  13. data/lib/trailblazer/endpoint/protocol.rb +5 -8
  14. data/lib/trailblazer/endpoint/version.rb +1 -1
  15. data/test/adapter/api_test.rb +6 -11
  16. data/test/adapter/web_test.rb +2 -5
  17. data/test/config_test.rb +25 -0
  18. data/test/docs/controller_test.rb +160 -73
  19. data/test/endpoint_test.rb +1 -1
  20. data/test/rails-app/.gitignore +8 -2
  21. data/test/rails-app/.ruby-version +1 -0
  22. data/test/rails-app/Gemfile +11 -9
  23. data/test/rails-app/Gemfile.lock +137 -121
  24. data/test/rails-app/app/concepts/app/api/v1/representer/errors.rb +16 -0
  25. data/test/rails-app/app/concepts/auth/jwt.rb +35 -0
  26. data/test/rails-app/app/concepts/auth/operation/authenticate.rb +32 -0
  27. data/test/rails-app/app/concepts/auth/operation/policy.rb +9 -0
  28. data/test/rails-app/app/concepts/song/operation/create.rb +13 -0
  29. data/test/rails-app/app/concepts/song/operation/show.rb +10 -0
  30. data/test/rails-app/app/concepts/song/representer.rb +5 -0
  31. data/test/rails-app/app/controllers/api/v1/songs_controller.rb +35 -0
  32. data/test/rails-app/app/controllers/application_controller.rb +6 -1
  33. data/test/rails-app/app/controllers/application_controller/api.rb +105 -0
  34. data/test/rails-app/app/controllers/application_controller/web.rb +30 -0
  35. data/test/rails-app/app/controllers/songs_controller.rb +15 -17
  36. data/test/rails-app/app/models/song.rb +3 -0
  37. data/test/rails-app/app/models/user.rb +5 -0
  38. data/test/rails-app/bin/bundle +114 -0
  39. data/test/rails-app/bin/rails +4 -0
  40. data/test/rails-app/bin/rake +4 -0
  41. data/test/rails-app/bin/setup +33 -0
  42. data/test/rails-app/config/application.rb +26 -3
  43. data/test/rails-app/config/credentials.yml.enc +1 -0
  44. data/test/rails-app/config/database.yml +2 -2
  45. data/test/rails-app/config/environments/development.rb +7 -17
  46. data/test/rails-app/config/environments/production.rb +28 -23
  47. data/test/rails-app/config/environments/test.rb +8 -12
  48. data/test/rails-app/config/initializers/application_controller_renderer.rb +6 -4
  49. data/test/rails-app/config/initializers/cors.rb +16 -0
  50. data/test/rails-app/config/initializers/trailblazer.rb +2 -0
  51. data/test/rails-app/config/locales/en.yml +11 -1
  52. data/test/rails-app/config/master.key +1 -0
  53. data/test/rails-app/config/routes.rb +8 -3
  54. data/test/rails-app/db/schema.rb +15 -0
  55. data/test/rails-app/test/controllers/api_songs_controller_test.rb +83 -0
  56. data/test/rails-app/test/controllers/songs_controller_test.rb +36 -144
  57. data/test/rails-app/test/test_helper.rb +7 -1
  58. data/test/test_helper.rb +0 -2
  59. data/trailblazer-endpoint.gemspec +1 -0
  60. metadata +52 -21
  61. data/test/rails-app/config/initializers/cookies_serializer.rb +0 -5
  62. data/test/rails-app/config/initializers/new_framework_defaults.rb +0 -24
  63. data/test/rails-app/config/initializers/session_store.rb +0 -3
  64. data/test/rails-app/config/secrets.yml +0 -22
  65. data/test/rails-app/test/helpers/.keep +0 -0
  66. data/test/rails-app/test/integration/.keep +0 -0
  67. data/test/rails-app/test/mailers/.keep +0 -0
  68. data/test/rails-app/vendor/assets/javascripts/.keep +0 -0
  69. data/test/rails-app/vendor/assets/stylesheets/.keep +0 -0
@@ -1,10 +1,16 @@
1
1
  ENV['RAILS_ENV'] ||= 'test'
2
- require File.expand_path('../../config/environment', __FILE__)
2
+ require_relative '../config/environment'
3
3
  require 'rails/test_help'
4
4
 
5
5
  class ActiveSupport::TestCase
6
+ # Run tests in parallel with specified workers
7
+ parallelize(workers: :number_of_processors)
8
+
6
9
  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
7
10
  fixtures :all
8
11
 
9
12
  # Add more helper methods to be used by all tests here...
10
13
  end
14
+
15
+ class Show < Trailblazer::Activity::Railway
16
+ end
@@ -7,8 +7,6 @@ require "trailblazer/endpoint"
7
7
  require "trailblazer/endpoint/protocol"
8
8
  require "trailblazer/endpoint/adapter"
9
9
 
10
- require "test_helper"
11
-
12
10
  Minitest::Spec.class_eval do
13
11
  T = Trailblazer::Activity::Testing
14
12
 
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "rake"
24
24
  spec.add_development_dependency "minitest"
25
25
  spec.add_development_dependency "trailblazer-developer"
26
+ # spec.add_development_dependency "appraisal"
26
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-endpoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-03 00:00:00.000000000 Z
11
+ date: 2020-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trailblazer-activity-dsl-linear
@@ -94,10 +94,13 @@ executables: []
94
94
  extensions: []
95
95
  extra_rdoc_files: []
96
96
  files:
97
+ - ".gitignore"
98
+ - Appraisals
97
99
  - CHANGES.md
98
100
  - Gemfile
99
101
  - README.md
100
102
  - Rakefile
103
+ - gemfiles/rails_app.gemfile
101
104
  - lib/trailblazer-endpoint.rb
102
105
  - lib/trailblazer/endpoint.rb
103
106
  - lib/trailblazer/endpoint/adapter.rb
@@ -117,17 +120,35 @@ files:
117
120
  - test/docs/endpoint_test.rb
118
121
  - test/endpoint_test.rb
119
122
  - test/rails-app/.gitignore
123
+ - test/rails-app/.ruby-version
120
124
  - test/rails-app/Gemfile
121
125
  - test/rails-app/Gemfile.lock
122
126
  - test/rails-app/README.md
123
127
  - test/rails-app/Rakefile
128
+ - test/rails-app/app/concepts/app/api/v1/representer/errors.rb
129
+ - test/rails-app/app/concepts/auth/jwt.rb
130
+ - test/rails-app/app/concepts/auth/operation/authenticate.rb
131
+ - test/rails-app/app/concepts/auth/operation/policy.rb
132
+ - test/rails-app/app/concepts/song/operation/create.rb
133
+ - test/rails-app/app/concepts/song/operation/show.rb
134
+ - test/rails-app/app/concepts/song/representer.rb
135
+ - test/rails-app/app/controllers/api/v1/songs_controller.rb
124
136
  - test/rails-app/app/controllers/application_controller.rb
137
+ - test/rails-app/app/controllers/application_controller/api.rb
138
+ - test/rails-app/app/controllers/application_controller/web.rb
125
139
  - test/rails-app/app/controllers/songs_controller.rb
126
140
  - test/rails-app/app/models/application_record.rb
127
141
  - test/rails-app/app/models/concerns/.keep
142
+ - test/rails-app/app/models/song.rb
143
+ - test/rails-app/app/models/user.rb
144
+ - test/rails-app/bin/bundle
145
+ - test/rails-app/bin/rails
146
+ - test/rails-app/bin/rake
147
+ - test/rails-app/bin/setup
128
148
  - test/rails-app/config.ru
129
149
  - test/rails-app/config/application.rb
130
150
  - test/rails-app/config/boot.rb
151
+ - test/rails-app/config/credentials.yml.enc
131
152
  - test/rails-app/config/database.yml
132
153
  - test/rails-app/config/environment.rb
133
154
  - test/rails-app/config/environments/development.rb
@@ -135,30 +156,26 @@ files:
135
156
  - test/rails-app/config/environments/test.rb
136
157
  - test/rails-app/config/initializers/application_controller_renderer.rb
137
158
  - test/rails-app/config/initializers/backtrace_silencers.rb
138
- - test/rails-app/config/initializers/cookies_serializer.rb
159
+ - test/rails-app/config/initializers/cors.rb
139
160
  - test/rails-app/config/initializers/filter_parameter_logging.rb
140
161
  - test/rails-app/config/initializers/inflections.rb
141
162
  - test/rails-app/config/initializers/mime_types.rb
142
- - test/rails-app/config/initializers/new_framework_defaults.rb
143
- - test/rails-app/config/initializers/session_store.rb
163
+ - test/rails-app/config/initializers/trailblazer.rb
144
164
  - test/rails-app/config/initializers/wrap_parameters.rb
145
165
  - test/rails-app/config/locales/en.yml
166
+ - test/rails-app/config/master.key
146
167
  - test/rails-app/config/routes.rb
147
- - test/rails-app/config/secrets.yml
168
+ - test/rails-app/db/schema.rb
148
169
  - test/rails-app/db/seeds.rb
149
170
  - test/rails-app/log/.keep
150
171
  - test/rails-app/test/controllers/.keep
172
+ - test/rails-app/test/controllers/api_songs_controller_test.rb
151
173
  - test/rails-app/test/controllers/songs_controller_test.rb
152
174
  - test/rails-app/test/fixtures/.keep
153
175
  - test/rails-app/test/fixtures/files/.keep
154
- - test/rails-app/test/helpers/.keep
155
- - test/rails-app/test/integration/.keep
156
- - test/rails-app/test/mailers/.keep
157
176
  - test/rails-app/test/models/.keep
158
177
  - test/rails-app/test/test_helper.rb
159
178
  - test/rails-app/tmp/.keep
160
- - test/rails-app/vendor/assets/javascripts/.keep
161
- - test/rails-app/vendor/assets/stylesheets/.keep
162
179
  - test/test_helper.rb
163
180
  - trailblazer-endpoint.gemspec
164
181
  homepage: http://trailblazer.to/gems/operation/endpoint.html
@@ -181,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
198
  version: '0'
182
199
  requirements: []
183
200
  rubyforge_project:
184
- rubygems_version: 2.7.6
201
+ rubygems_version: 2.7.3
185
202
  signing_key:
186
203
  specification_version: 4
187
204
  summary: Endpoints handle authentication, policies, run your domain operation and
@@ -196,17 +213,35 @@ test_files:
196
213
  - test/docs/endpoint_test.rb
197
214
  - test/endpoint_test.rb
198
215
  - test/rails-app/.gitignore
216
+ - test/rails-app/.ruby-version
199
217
  - test/rails-app/Gemfile
200
218
  - test/rails-app/Gemfile.lock
201
219
  - test/rails-app/README.md
202
220
  - test/rails-app/Rakefile
221
+ - test/rails-app/app/concepts/app/api/v1/representer/errors.rb
222
+ - test/rails-app/app/concepts/auth/jwt.rb
223
+ - test/rails-app/app/concepts/auth/operation/authenticate.rb
224
+ - test/rails-app/app/concepts/auth/operation/policy.rb
225
+ - test/rails-app/app/concepts/song/operation/create.rb
226
+ - test/rails-app/app/concepts/song/operation/show.rb
227
+ - test/rails-app/app/concepts/song/representer.rb
228
+ - test/rails-app/app/controllers/api/v1/songs_controller.rb
203
229
  - test/rails-app/app/controllers/application_controller.rb
230
+ - test/rails-app/app/controllers/application_controller/api.rb
231
+ - test/rails-app/app/controllers/application_controller/web.rb
204
232
  - test/rails-app/app/controllers/songs_controller.rb
205
233
  - test/rails-app/app/models/application_record.rb
206
234
  - test/rails-app/app/models/concerns/.keep
235
+ - test/rails-app/app/models/song.rb
236
+ - test/rails-app/app/models/user.rb
237
+ - test/rails-app/bin/bundle
238
+ - test/rails-app/bin/rails
239
+ - test/rails-app/bin/rake
240
+ - test/rails-app/bin/setup
207
241
  - test/rails-app/config.ru
208
242
  - test/rails-app/config/application.rb
209
243
  - test/rails-app/config/boot.rb
244
+ - test/rails-app/config/credentials.yml.enc
210
245
  - test/rails-app/config/database.yml
211
246
  - test/rails-app/config/environment.rb
212
247
  - test/rails-app/config/environments/development.rb
@@ -214,28 +249,24 @@ test_files:
214
249
  - test/rails-app/config/environments/test.rb
215
250
  - test/rails-app/config/initializers/application_controller_renderer.rb
216
251
  - test/rails-app/config/initializers/backtrace_silencers.rb
217
- - test/rails-app/config/initializers/cookies_serializer.rb
252
+ - test/rails-app/config/initializers/cors.rb
218
253
  - test/rails-app/config/initializers/filter_parameter_logging.rb
219
254
  - test/rails-app/config/initializers/inflections.rb
220
255
  - test/rails-app/config/initializers/mime_types.rb
221
- - test/rails-app/config/initializers/new_framework_defaults.rb
222
- - test/rails-app/config/initializers/session_store.rb
256
+ - test/rails-app/config/initializers/trailblazer.rb
223
257
  - test/rails-app/config/initializers/wrap_parameters.rb
224
258
  - test/rails-app/config/locales/en.yml
259
+ - test/rails-app/config/master.key
225
260
  - test/rails-app/config/routes.rb
226
- - test/rails-app/config/secrets.yml
261
+ - test/rails-app/db/schema.rb
227
262
  - test/rails-app/db/seeds.rb
228
263
  - test/rails-app/log/.keep
229
264
  - test/rails-app/test/controllers/.keep
265
+ - test/rails-app/test/controllers/api_songs_controller_test.rb
230
266
  - test/rails-app/test/controllers/songs_controller_test.rb
231
267
  - test/rails-app/test/fixtures/.keep
232
268
  - test/rails-app/test/fixtures/files/.keep
233
- - test/rails-app/test/helpers/.keep
234
- - test/rails-app/test/integration/.keep
235
- - test/rails-app/test/mailers/.keep
236
269
  - test/rails-app/test/models/.keep
237
270
  - test/rails-app/test/test_helper.rb
238
271
  - test/rails-app/tmp/.keep
239
- - test/rails-app/vendor/assets/javascripts/.keep
240
- - test/rails-app/vendor/assets/stylesheets/.keep
241
272
  - test/test_helper.rb
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Specify a serializer for the signed and encrypted cookie jars.
4
- # Valid options are :json, :marshal, and :hybrid.
5
- Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,24 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
- #
3
- # This file contains migration options to ease your Rails 5.0 upgrade.
4
- #
5
- # Read the Rails 5.0 release notes for more info on each option.
6
-
7
- # Enable per-form CSRF tokens. Previous versions had false.
8
- Rails.application.config.action_controller.per_form_csrf_tokens = true
9
-
10
- # Enable origin-checking CSRF mitigation. Previous versions had false.
11
- Rails.application.config.action_controller.forgery_protection_origin_check = true
12
-
13
- # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
14
- # Previous versions had false.
15
- ActiveSupport.to_time_preserves_timezone = true
16
-
17
- # Require `belongs_to` associations by default. Previous versions had false.
18
- Rails.application.config.active_record.belongs_to_required_by_default = true
19
-
20
- # Do not halt callback chains when a callback returns false. Previous versions had true.
21
- ActiveSupport.halt_callback_chains_on_return_false = false
22
-
23
- # Configure SSL options to enable HSTS with subdomains. Previous versions had false.
24
- Rails.application.config.ssl_options = { hsts: { subdomains: true } }
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails.application.config.session_store :cookie_store, key: '_rails-app_session'
@@ -1,22 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rails secret` to generate a secure secret key.
9
-
10
- # Make sure the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- development:
14
- secret_key_base: 1b32956d5c4b81c91b20acbc5f1b3e13874e0c6617eaab7fc582aac62c7aa64680eade373d83118e2fdc248ab2b226d3bfc549286c709c4f34f31d0c4ca6fea0
15
-
16
- test:
17
- secret_key_base: 0482c39f2747ee5844978ec66786934a2486c8fbc10ef3e6c7f7a148baf255918fb07ff5752d0d189eeb644b9c76164d25b17df33fea38f24a4eae529a5f16a0
18
-
19
- # Do not keep production secrets in the repository,
20
- # instead read values from the environment.
21
- production:
22
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
File without changes
File without changes
File without changes