trailblazer-endpoint 0.0.2 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +16 -0
  3. data/Appraisals +5 -0
  4. data/CHANGES.md +28 -0
  5. data/README.md +40 -5
  6. data/Rakefile +7 -1
  7. data/gemfiles/rails_app.gemfile +12 -0
  8. data/lib/trailblazer/endpoint.rb +55 -16
  9. data/lib/trailblazer/endpoint/adapter.rb +30 -121
  10. data/lib/trailblazer/endpoint/builder.rb +1 -1
  11. data/lib/trailblazer/endpoint/controller.rb +223 -0
  12. data/lib/trailblazer/endpoint/dsl.rb +31 -0
  13. data/lib/trailblazer/endpoint/options.rb +92 -0
  14. data/lib/trailblazer/endpoint/protocol.rb +7 -11
  15. data/lib/trailblazer/endpoint/protocol/cipher.rb +27 -0
  16. data/lib/trailblazer/endpoint/protocol/controller.rb +93 -0
  17. data/lib/trailblazer/endpoint/protocol/find_process_model.rb +15 -0
  18. data/lib/trailblazer/endpoint/version.rb +1 -1
  19. data/test/adapter/api_test.rb +6 -11
  20. data/test/adapter/web_test.rb +2 -5
  21. data/test/config_test.rb +128 -0
  22. data/test/docs/controller_test.rb +340 -58
  23. data/test/endpoint_test.rb +1 -1
  24. data/test/rails-app/.gitignore +8 -2
  25. data/test/rails-app/.ruby-version +1 -0
  26. data/test/rails-app/Gemfile +21 -9
  27. data/test/rails-app/Gemfile.lock +173 -118
  28. data/test/rails-app/app/concepts/app/api/v1/representer/errors.rb +16 -0
  29. data/test/rails-app/app/concepts/auth/jwt.rb +35 -0
  30. data/test/rails-app/app/concepts/auth/operation/authenticate.rb +32 -0
  31. data/test/rails-app/app/concepts/auth/operation/policy.rb +9 -0
  32. data/test/rails-app/app/concepts/song/cell/create.rb +4 -0
  33. data/test/rails-app/app/concepts/song/cell/new.rb +4 -0
  34. data/test/rails-app/app/concepts/song/operation/create.rb +17 -0
  35. data/test/rails-app/app/concepts/song/operation/show.rb +10 -0
  36. data/test/rails-app/app/concepts/song/representer.rb +5 -0
  37. data/test/rails-app/app/concepts/song/view/create.erb +1 -0
  38. data/test/rails-app/app/concepts/song/view/new.erb +1 -0
  39. data/test/rails-app/app/controllers/api/v1/songs_controller.rb +41 -0
  40. data/test/rails-app/app/controllers/application_controller.rb +8 -1
  41. data/test/rails-app/app/controllers/application_controller/api.rb +107 -0
  42. data/test/rails-app/app/controllers/application_controller/web.rb +45 -0
  43. data/test/rails-app/app/controllers/auth_controller.rb +44 -0
  44. data/test/rails-app/app/controllers/home_controller.rb +5 -0
  45. data/test/rails-app/app/controllers/songs_controller.rb +245 -13
  46. data/test/rails-app/app/models/song.rb +6 -0
  47. data/test/rails-app/app/models/user.rb +7 -0
  48. data/test/rails-app/bin/bundle +114 -0
  49. data/test/rails-app/bin/rails +4 -0
  50. data/test/rails-app/bin/rake +4 -0
  51. data/test/rails-app/bin/setup +33 -0
  52. data/test/rails-app/config/application.rb +26 -3
  53. data/test/rails-app/config/credentials.yml.enc +1 -0
  54. data/test/rails-app/config/database.yml +2 -2
  55. data/test/rails-app/config/environments/development.rb +7 -17
  56. data/test/rails-app/config/environments/production.rb +28 -23
  57. data/test/rails-app/config/environments/test.rb +10 -12
  58. data/test/rails-app/config/initializers/application_controller_renderer.rb +6 -4
  59. data/test/rails-app/config/initializers/cors.rb +16 -0
  60. data/test/rails-app/config/initializers/trailblazer.rb +2 -0
  61. data/test/rails-app/config/locales/en.yml +11 -1
  62. data/test/rails-app/config/master.key +1 -0
  63. data/test/rails-app/config/routes.rb +26 -4
  64. data/test/rails-app/db/schema.rb +15 -0
  65. data/test/rails-app/test/controllers/api_songs_controller_test.rb +87 -0
  66. data/test/rails-app/test/controllers/songs_controller_test.rb +146 -144
  67. data/test/rails-app/test/test_helper.rb +7 -1
  68. data/test/test_helper.rb +0 -2
  69. data/trailblazer-endpoint.gemspec +2 -1
  70. metadata +73 -22
  71. data/test/rails-app/config/initializers/cookies_serializer.rb +0 -5
  72. data/test/rails-app/config/initializers/new_framework_defaults.rb +0 -24
  73. data/test/rails-app/config/initializers/session_store.rb +0 -3
  74. data/test/rails-app/config/secrets.yml +0 -22
  75. data/test/rails-app/test/helpers/.keep +0 -0
  76. data/test/rails-app/test/integration/.keep +0 -0
  77. data/test/rails-app/test/mailers/.keep +0 -0
  78. data/test/rails-app/vendor/assets/javascripts/.keep +0 -0
  79. 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
 
@@ -17,10 +17,11 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "trailblazer-activity-dsl-linear", ">= 0.2.9", "< 0.4.0"
20
+ spec.add_dependency "trailblazer-activity-dsl-linear", ">= 0.3.4", "< 0.4.0"
21
21
 
22
22
  spec.add_development_dependency "bundler"
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.2
4
+ version: 0.0.7
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-07-10 00:00:00.000000000 Z
11
+ date: 2020-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trailblazer-activity-dsl-linear
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.9
19
+ version: 0.3.4
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 0.4.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.2.9
29
+ version: 0.3.4
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 0.4.0
@@ -94,36 +94,70 @@ 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
104
107
  - lib/trailblazer/endpoint/builder.rb
108
+ - lib/trailblazer/endpoint/controller.rb
109
+ - lib/trailblazer/endpoint/dsl.rb
110
+ - lib/trailblazer/endpoint/options.rb
105
111
  - lib/trailblazer/endpoint/protocol.rb
112
+ - lib/trailblazer/endpoint/protocol/cipher.rb
113
+ - lib/trailblazer/endpoint/protocol/controller.rb
114
+ - lib/trailblazer/endpoint/protocol/find_process_model.rb
106
115
  - lib/trailblazer/endpoint/rails.rb
107
116
  - lib/trailblazer/endpoint/version.rb
108
117
  - test/adapter/api_test.rb
109
118
  - test/adapter/representable_test.rb
110
119
  - test/adapter/web_test.rb
111
120
  - test/benchmark/skill_resolver_benchmark.rb
121
+ - test/config_test.rb
112
122
  - test/docs/controller_test.rb
113
123
  - test/docs/endpoint_test.rb
114
124
  - test/endpoint_test.rb
115
125
  - test/rails-app/.gitignore
126
+ - test/rails-app/.ruby-version
116
127
  - test/rails-app/Gemfile
117
128
  - test/rails-app/Gemfile.lock
118
129
  - test/rails-app/README.md
119
130
  - test/rails-app/Rakefile
131
+ - test/rails-app/app/concepts/app/api/v1/representer/errors.rb
132
+ - test/rails-app/app/concepts/auth/jwt.rb
133
+ - test/rails-app/app/concepts/auth/operation/authenticate.rb
134
+ - test/rails-app/app/concepts/auth/operation/policy.rb
135
+ - test/rails-app/app/concepts/song/cell/create.rb
136
+ - test/rails-app/app/concepts/song/cell/new.rb
137
+ - test/rails-app/app/concepts/song/operation/create.rb
138
+ - test/rails-app/app/concepts/song/operation/show.rb
139
+ - test/rails-app/app/concepts/song/representer.rb
140
+ - test/rails-app/app/concepts/song/view/create.erb
141
+ - test/rails-app/app/concepts/song/view/new.erb
142
+ - test/rails-app/app/controllers/api/v1/songs_controller.rb
120
143
  - test/rails-app/app/controllers/application_controller.rb
144
+ - test/rails-app/app/controllers/application_controller/api.rb
145
+ - test/rails-app/app/controllers/application_controller/web.rb
146
+ - test/rails-app/app/controllers/auth_controller.rb
147
+ - test/rails-app/app/controllers/home_controller.rb
121
148
  - test/rails-app/app/controllers/songs_controller.rb
122
149
  - test/rails-app/app/models/application_record.rb
123
150
  - test/rails-app/app/models/concerns/.keep
151
+ - test/rails-app/app/models/song.rb
152
+ - test/rails-app/app/models/user.rb
153
+ - test/rails-app/bin/bundle
154
+ - test/rails-app/bin/rails
155
+ - test/rails-app/bin/rake
156
+ - test/rails-app/bin/setup
124
157
  - test/rails-app/config.ru
125
158
  - test/rails-app/config/application.rb
126
159
  - test/rails-app/config/boot.rb
160
+ - test/rails-app/config/credentials.yml.enc
127
161
  - test/rails-app/config/database.yml
128
162
  - test/rails-app/config/environment.rb
129
163
  - test/rails-app/config/environments/development.rb
@@ -131,30 +165,26 @@ files:
131
165
  - test/rails-app/config/environments/test.rb
132
166
  - test/rails-app/config/initializers/application_controller_renderer.rb
133
167
  - test/rails-app/config/initializers/backtrace_silencers.rb
134
- - test/rails-app/config/initializers/cookies_serializer.rb
168
+ - test/rails-app/config/initializers/cors.rb
135
169
  - test/rails-app/config/initializers/filter_parameter_logging.rb
136
170
  - test/rails-app/config/initializers/inflections.rb
137
171
  - test/rails-app/config/initializers/mime_types.rb
138
- - test/rails-app/config/initializers/new_framework_defaults.rb
139
- - test/rails-app/config/initializers/session_store.rb
172
+ - test/rails-app/config/initializers/trailblazer.rb
140
173
  - test/rails-app/config/initializers/wrap_parameters.rb
141
174
  - test/rails-app/config/locales/en.yml
175
+ - test/rails-app/config/master.key
142
176
  - test/rails-app/config/routes.rb
143
- - test/rails-app/config/secrets.yml
177
+ - test/rails-app/db/schema.rb
144
178
  - test/rails-app/db/seeds.rb
145
179
  - test/rails-app/log/.keep
146
180
  - test/rails-app/test/controllers/.keep
181
+ - test/rails-app/test/controllers/api_songs_controller_test.rb
147
182
  - test/rails-app/test/controllers/songs_controller_test.rb
148
183
  - test/rails-app/test/fixtures/.keep
149
184
  - test/rails-app/test/fixtures/files/.keep
150
- - test/rails-app/test/helpers/.keep
151
- - test/rails-app/test/integration/.keep
152
- - test/rails-app/test/mailers/.keep
153
185
  - test/rails-app/test/models/.keep
154
186
  - test/rails-app/test/test_helper.rb
155
187
  - test/rails-app/tmp/.keep
156
- - test/rails-app/vendor/assets/javascripts/.keep
157
- - test/rails-app/vendor/assets/stylesheets/.keep
158
188
  - test/test_helper.rb
159
189
  - trailblazer-endpoint.gemspec
160
190
  homepage: http://trailblazer.to/gems/operation/endpoint.html
@@ -187,21 +217,46 @@ test_files:
187
217
  - test/adapter/representable_test.rb
188
218
  - test/adapter/web_test.rb
189
219
  - test/benchmark/skill_resolver_benchmark.rb
220
+ - test/config_test.rb
190
221
  - test/docs/controller_test.rb
191
222
  - test/docs/endpoint_test.rb
192
223
  - test/endpoint_test.rb
193
224
  - test/rails-app/.gitignore
225
+ - test/rails-app/.ruby-version
194
226
  - test/rails-app/Gemfile
195
227
  - test/rails-app/Gemfile.lock
196
228
  - test/rails-app/README.md
197
229
  - test/rails-app/Rakefile
230
+ - test/rails-app/app/concepts/app/api/v1/representer/errors.rb
231
+ - test/rails-app/app/concepts/auth/jwt.rb
232
+ - test/rails-app/app/concepts/auth/operation/authenticate.rb
233
+ - test/rails-app/app/concepts/auth/operation/policy.rb
234
+ - test/rails-app/app/concepts/song/cell/create.rb
235
+ - test/rails-app/app/concepts/song/cell/new.rb
236
+ - test/rails-app/app/concepts/song/operation/create.rb
237
+ - test/rails-app/app/concepts/song/operation/show.rb
238
+ - test/rails-app/app/concepts/song/representer.rb
239
+ - test/rails-app/app/concepts/song/view/create.erb
240
+ - test/rails-app/app/concepts/song/view/new.erb
241
+ - test/rails-app/app/controllers/api/v1/songs_controller.rb
198
242
  - test/rails-app/app/controllers/application_controller.rb
243
+ - test/rails-app/app/controllers/application_controller/api.rb
244
+ - test/rails-app/app/controllers/application_controller/web.rb
245
+ - test/rails-app/app/controllers/auth_controller.rb
246
+ - test/rails-app/app/controllers/home_controller.rb
199
247
  - test/rails-app/app/controllers/songs_controller.rb
200
248
  - test/rails-app/app/models/application_record.rb
201
249
  - test/rails-app/app/models/concerns/.keep
250
+ - test/rails-app/app/models/song.rb
251
+ - test/rails-app/app/models/user.rb
252
+ - test/rails-app/bin/bundle
253
+ - test/rails-app/bin/rails
254
+ - test/rails-app/bin/rake
255
+ - test/rails-app/bin/setup
202
256
  - test/rails-app/config.ru
203
257
  - test/rails-app/config/application.rb
204
258
  - test/rails-app/config/boot.rb
259
+ - test/rails-app/config/credentials.yml.enc
205
260
  - test/rails-app/config/database.yml
206
261
  - test/rails-app/config/environment.rb
207
262
  - test/rails-app/config/environments/development.rb
@@ -209,28 +264,24 @@ test_files:
209
264
  - test/rails-app/config/environments/test.rb
210
265
  - test/rails-app/config/initializers/application_controller_renderer.rb
211
266
  - test/rails-app/config/initializers/backtrace_silencers.rb
212
- - test/rails-app/config/initializers/cookies_serializer.rb
267
+ - test/rails-app/config/initializers/cors.rb
213
268
  - test/rails-app/config/initializers/filter_parameter_logging.rb
214
269
  - test/rails-app/config/initializers/inflections.rb
215
270
  - test/rails-app/config/initializers/mime_types.rb
216
- - test/rails-app/config/initializers/new_framework_defaults.rb
217
- - test/rails-app/config/initializers/session_store.rb
271
+ - test/rails-app/config/initializers/trailblazer.rb
218
272
  - test/rails-app/config/initializers/wrap_parameters.rb
219
273
  - test/rails-app/config/locales/en.yml
274
+ - test/rails-app/config/master.key
220
275
  - test/rails-app/config/routes.rb
221
- - test/rails-app/config/secrets.yml
276
+ - test/rails-app/db/schema.rb
222
277
  - test/rails-app/db/seeds.rb
223
278
  - test/rails-app/log/.keep
224
279
  - test/rails-app/test/controllers/.keep
280
+ - test/rails-app/test/controllers/api_songs_controller_test.rb
225
281
  - test/rails-app/test/controllers/songs_controller_test.rb
226
282
  - test/rails-app/test/fixtures/.keep
227
283
  - test/rails-app/test/fixtures/files/.keep
228
- - test/rails-app/test/helpers/.keep
229
- - test/rails-app/test/integration/.keep
230
- - test/rails-app/test/mailers/.keep
231
284
  - test/rails-app/test/models/.keep
232
285
  - test/rails-app/test/test_helper.rb
233
286
  - test/rails-app/tmp/.keep
234
- - test/rails-app/vendor/assets/javascripts/.keep
235
- - test/rails-app/vendor/assets/stylesheets/.keep
236
287
  - 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