trailblazer-rails 2.1.4 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +15 -15
- data/.rubocop.yml +9 -9
- data/.rubocop_todo.yml +294 -294
- data/.ruby-version +1 -1
- data/.travis.yml +18 -16
- data/CHANGES.md +146 -141
- data/Gemfile +25 -4
- data/LICENSE.txt +21 -21
- data/README.md +39 -39
- data/lib/trailblazer/rails/cell.rb +21 -21
- data/lib/trailblazer/rails/controller.rb +57 -55
- data/lib/trailblazer/rails/railtie.rb +30 -30
- data/lib/trailblazer/rails/railtie/extend_application_controller.rb +28 -28
- data/lib/trailblazer/rails/railtie/loader.rb +51 -56
- data/lib/trailblazer/rails/test/integration.rb +6 -6
- data/lib/trailblazer/rails/version.rb +5 -5
- data/trailblazer-rails.gemspec +28 -27
- metadata +16 -2
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.4.4
|
1
|
+
2.4.4
|
data/.travis.yml
CHANGED
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
sudo: false
|
2
|
+
language: ruby
|
3
|
+
cache: bundler
|
4
|
+
matrix:
|
5
|
+
include:
|
6
|
+
- rvm: 2.4.1
|
7
|
+
env: TEST_SUITE=rails5.0
|
8
|
+
gemfile: test/rails5.0/Gemfile
|
9
|
+
|
10
|
+
- rvm: 2.4.1
|
11
|
+
env: TEST_SUITE=rails5.1
|
12
|
+
gemfile: test/rails5.1/Gemfile
|
13
|
+
|
14
|
+
- rvm: 2.5.1
|
15
|
+
env: TEST_SUITE=rails5.2
|
16
|
+
gemfile: test/rails5.2/Gemfile
|
17
|
+
|
18
|
+
script: cd test/$TEST_SUITE && bundle install && bundle exec rake test
|
data/CHANGES.md
CHANGED
@@ -1,141 +1,146 @@
|
|
1
|
-
# 2.1.
|
2
|
-
|
3
|
-
*
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
*
|
18
|
-
*
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
*
|
24
|
-
* Allow
|
25
|
-
|
26
|
-
# 2.
|
27
|
-
|
28
|
-
*
|
29
|
-
*
|
30
|
-
|
31
|
-
#
|
32
|
-
|
33
|
-
*
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
*
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
*
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
*
|
80
|
-
*
|
81
|
-
|
82
|
-
# 0.
|
83
|
-
|
84
|
-
*
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
*
|
94
|
-
|
95
|
-
# 0.
|
96
|
-
|
97
|
-
* Require `
|
98
|
-
*
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
*
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
*
|
109
|
-
|
110
|
-
# 0.2.
|
111
|
-
|
112
|
-
*
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
*
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
*
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
*
|
128
|
-
|
129
|
-
# 0.1.
|
130
|
-
|
131
|
-
* Treat
|
132
|
-
* `Controller#form
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
* `
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
1
|
+
# 2.1.5
|
2
|
+
|
3
|
+
* Add dependency `activesupport` 5+
|
4
|
+
* rename `run` to `run_v21` and alias it to `run` only if it not already defined
|
5
|
+
|
6
|
+
# 2.1.4
|
7
|
+
|
8
|
+
* Remove Gemfile.lock in the test folders to make travis CI to work (this time will work!)
|
9
|
+
|
10
|
+
# 2.1.3
|
11
|
+
|
12
|
+
* Update Gemfile.lock in the test folders to make travis CI to work again
|
13
|
+
|
14
|
+
# 2.1.2
|
15
|
+
|
16
|
+
* `Trailblazer::Rails::Railtie` divided in 2 modules:
|
17
|
+
* `Loader` -> require_dependecy `concepts`
|
18
|
+
* `ExtendApplicationController` -> include `run` and `render` in controllers
|
19
|
+
|
20
|
+
# 2.1.1
|
21
|
+
|
22
|
+
* Fixed issue for rails 5.2rc2 when loading model's files
|
23
|
+
* Rubocop introduced
|
24
|
+
* Allow enabling tracing when using `run` via `config.trailblazer.enable_tracing = true`
|
25
|
+
|
26
|
+
# 2.1.0
|
27
|
+
|
28
|
+
* Drop deprecated syntax for controller `run`
|
29
|
+
* Allow disabling of the Trailblazer loader via `config.trailblazer.use_loader = false`
|
30
|
+
|
31
|
+
# 2.0.0
|
32
|
+
|
33
|
+
* Support Trailblazer 2.1.0+
|
34
|
+
* Drop support for older version of Trailblazer
|
35
|
+
|
36
|
+
# 1.0.9
|
37
|
+
|
38
|
+
* `Trailblazer::Rails::Railtie` divided in 2 modules:
|
39
|
+
* `Loader` -> require_dependecy `concepts`
|
40
|
+
* `ExtendApplicationController` -> include `run` and `render` in controllers
|
41
|
+
* Remove Gemfile.lock in the test folders to make travis CI to work
|
42
|
+
|
43
|
+
# 1.0.8
|
44
|
+
|
45
|
+
* Fixed Circular dependency detected in rails 5.2
|
46
|
+
|
47
|
+
# 1.0.7
|
48
|
+
|
49
|
+
* Fixed typo error in use_loader config flag
|
50
|
+
|
51
|
+
# 1.0.6 (revoked)
|
52
|
+
|
53
|
+
* Introduce use_loader config flag
|
54
|
+
|
55
|
+
# 1.0.5
|
56
|
+
|
57
|
+
* Hook trailblazer application_controller initializer to finisher_hook
|
58
|
+
|
59
|
+
# 1.0.4
|
60
|
+
|
61
|
+
* Make `Railtie::extend_application_controller!` overwriteable via a module.
|
62
|
+
|
63
|
+
# 1.0.3
|
64
|
+
|
65
|
+
* Return the computed application controller constant from `Railtie::extend_application_controller!` to make `compat` code simpler.
|
66
|
+
|
67
|
+
# 1.0.2
|
68
|
+
|
69
|
+
* Allow configuring `ApplicationController` constant via `config.trailblazer.application_controller`.
|
70
|
+
|
71
|
+
# 1.0.1
|
72
|
+
|
73
|
+
* Allow using this gem without `cells,` by loading cells support only when the `cells` gem got detected. Thanks to @promisedlandt.
|
74
|
+
|
75
|
+
# 1.0.0
|
76
|
+
|
77
|
+
* Runs only with >= Trailblazer 2.0.0.
|
78
|
+
* Removed `Controller#form`, `#present` and `#respond`. The latter is now [replaced with `Endpoint`](https://github.com/trailblazer/trailblazer-endpoint/). The only operation trigger is `Controller#run`.
|
79
|
+
* Added support for explicit `render cell(Artist::Cell::Index, model)`.
|
80
|
+
* Autoloading got replaced with explicit requires.
|
81
|
+
|
82
|
+
# 0.4.0
|
83
|
+
|
84
|
+
* Better engines support.
|
85
|
+
* Fix `Responder#errors` by simply removing it and letting `Operation#errors` return the contract errors.
|
86
|
+
|
87
|
+
# 0.3.2
|
88
|
+
|
89
|
+
* Make it work with Rails 3.x, again.
|
90
|
+
|
91
|
+
# 0.3.1
|
92
|
+
|
93
|
+
* Fix loading of `reform-rails`.
|
94
|
+
|
95
|
+
# 0.3.0
|
96
|
+
|
97
|
+
* Require `reform-rails` as a static dependency. This simplifies the user's setup significantly.
|
98
|
+
* Run the `Railtie` after `reform.form_extensions` and allow reform-rails to do its setup work, then load concepts.
|
99
|
+
|
100
|
+
# 0.2.4
|
101
|
+
|
102
|
+
* Require `trailblazer-loader-0.0.7`.
|
103
|
+
* Fix sorting, model files are now always required first.
|
104
|
+
* Manually include `Operation::Controller` in `ApplicationController` for every reload.
|
105
|
+
|
106
|
+
# 0.2.3
|
107
|
+
|
108
|
+
* Bump to `trailblazer-loader` 0.0.4.
|
109
|
+
|
110
|
+
# 0.2.2
|
111
|
+
|
112
|
+
* Remove cells loading code, this happens via trailblazer-loader now.
|
113
|
+
* We now load the concept's model file if it exists.
|
114
|
+
|
115
|
+
# 0.2.1
|
116
|
+
|
117
|
+
* Require `trailblazer-loader`.
|
118
|
+
|
119
|
+
# 0.2.0
|
120
|
+
|
121
|
+
* Use `trailblazer-loader` for loading operations and associated files, now. Note that `operations.rb` now is `operation.rb` (hence the minor bump).
|
122
|
+
* The `Operation::Controller` module is not included into `ApplicationController` automatically.
|
123
|
+
* Added `Trailblazer::Test::Integration`.
|
124
|
+
|
125
|
+
# 0.1.6
|
126
|
+
|
127
|
+
* Fix `Controller#run`, which now returns the operation instance instead of the `Else` object.
|
128
|
+
|
129
|
+
# 0.1.5
|
130
|
+
|
131
|
+
* Treat all requests as `params` requests unless the operation has a representer mixed in. If you don't want that, you can override using `is_document: false`. This appears to be the smoothest solution for all. Thanks to @Scharrels for discussion.
|
132
|
+
* In `Controller#form`, the options argument is now passed into `form.prepopulate!(options)`. This allows to use arbitrary options and the `options[:params]` for prepopulation. Thanks @sauy7 for discussion.
|
133
|
+
|
134
|
+
# 0.1.4
|
135
|
+
|
136
|
+
* Treat `:js` requests as non-document, too.
|
137
|
+
* `Controller#form` now returns the form object and not the operation.
|
138
|
+
* In `Controller`, `#form`, `#present`, `#run` and `#respond` now all have the same API: `run(constant, options)`. If you want to pass a custom params hash, use `run Comment::Create, params: {..}`.
|
139
|
+
|
140
|
+
# 0.1.3
|
141
|
+
|
142
|
+
* `Operation::contract` works properly with `Operation::ActiveModel` mixed in.
|
143
|
+
|
144
|
+
# 0.1.2
|
145
|
+
|
146
|
+
* First version running with Trailblazer 1.0.0.
|
data/Gemfile
CHANGED
@@ -3,7 +3,28 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in trailblazer-rails.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
case ENV['GEMS_SOURCE']
|
7
|
+
when 'local'
|
8
|
+
gem "reform-rails", path: "../reform-rails"
|
9
|
+
gem "trailblazer", path: "../trailblazer"
|
10
|
+
gem "trailblazer-loader", path: "../trailblazer-loader"
|
11
|
+
gem "trailblazer-cells", path: "../trailblazer-cells"
|
12
|
+
gem "cells-rails", path: "../cells-rails"
|
13
|
+
gem "cells-erb", path: "../cells-erb"
|
14
|
+
when 'github'
|
15
|
+
gem "reform-rails", github: "trailblazer/reform-rails"
|
16
|
+
gem "trailblazer", github: "trailblazer/trailblazer"
|
17
|
+
gem "trailblazer-loader", github: "trailblazer/trailblazer-loader"
|
18
|
+
gem "trailblazer-cells", github: "trailblazer/trailblazer-cells"
|
19
|
+
gem "cells-rails", github: "trailblazer/cells-rails"
|
20
|
+
gem "cells-erb", github: "trailblazer/cells-erb"
|
21
|
+
when 'custom'
|
22
|
+
eval_gemfile('GemfileCustom')
|
23
|
+
else # use rubygems releases
|
24
|
+
gem "reform-rails"
|
25
|
+
gem "trailblazer"
|
26
|
+
gem "trailblazer-loader"
|
27
|
+
gem "trailblazer-cells"
|
28
|
+
gem "cells-rails"
|
29
|
+
gem "cells-erb"
|
30
|
+
end
|
data/LICENSE.txt
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2015-2018 Nick Sutterer
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015-2018 Nick Sutterer
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
# Trailblazer::Rails
|
2
|
-
|
3
|
-
*Trailblazer in your Rails controllers.*
|
4
|
-
|
5
|
-
[](https://gitter.im/trailblazer/chat)
|
6
|
-
[](http://trailblazer.to/newsletter/)
|
7
|
-
[](https://travis-ci.org/trailblazer/trailblazer-rails)
|
9
|
-
[](http://badge.fury.io/rb/trailblazer-rails)
|
10
|
-
|
11
|
-
## Overview
|
12
|
-
|
13
|
-
`trailblazer-rails` helps you with the following.
|
14
|
-
|
15
|
-
* Running operations in your controller actions.
|
16
|
-
* Minimalistic integration tests ("smoke tests") to test controller/operation wiring.
|
17
|
-
* Rendering cells instead of an ActionView in a controller action.
|
18
|
-
|
19
|
-
Please refer to the [full documentation for more](http://trailblazer.to/gems/trailblazer/2.0/rails.html).
|
20
|
-
|
21
|
-
## Installation
|
22
|
-
|
23
|
-
Add this line to your application's Gemfile:
|
24
|
-
|
25
|
-
```ruby
|
26
|
-
gem 'trailblazer-rails'
|
27
|
-
```
|
28
|
-
|
29
|
-
Note that the 2.x version only runs with TRB >= 2.1.0.
|
30
|
-
|
31
|
-
## Setting flags
|
32
|
-
|
33
|
-
* `config.trailblazer.use_loader = false` to disable Trailblazer loader (default TRUE)
|
34
|
-
* `config.trailblazer.enable_tracing = true` to enable tracing when using `run` (default FALSE)
|
35
|
-
|
36
|
-
## License
|
37
|
-
|
38
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
39
|
-
|
1
|
+
# Trailblazer::Rails
|
2
|
+
|
3
|
+
*Trailblazer in your Rails controllers.*
|
4
|
+
|
5
|
+
[](https://gitter.im/trailblazer/chat)
|
6
|
+
[](http://trailblazer.to/newsletter/)
|
7
|
+
[](https://travis-ci.org/trailblazer/trailblazer-rails)
|
9
|
+
[](http://badge.fury.io/rb/trailblazer-rails)
|
10
|
+
|
11
|
+
## Overview
|
12
|
+
|
13
|
+
`trailblazer-rails` helps you with the following.
|
14
|
+
|
15
|
+
* Running operations in your controller actions.
|
16
|
+
* Minimalistic integration tests ("smoke tests") to test controller/operation wiring.
|
17
|
+
* Rendering cells instead of an ActionView in a controller action.
|
18
|
+
|
19
|
+
Please refer to the [full documentation for more](http://trailblazer.to/gems/trailblazer/2.0/rails.html).
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
Add this line to your application's Gemfile:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
gem 'trailblazer-rails'
|
27
|
+
```
|
28
|
+
|
29
|
+
Note that the 2.x version only runs with TRB >= 2.1.0.
|
30
|
+
|
31
|
+
## Setting flags
|
32
|
+
|
33
|
+
* `config.trailblazer.use_loader = false` to disable Trailblazer loader (default TRUE)
|
34
|
+
* `config.trailblazer.enable_tracing = true` to enable tracing when using `run` (default FALSE)
|
35
|
+
|
36
|
+
## License
|
37
|
+
|
38
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
39
|
+
|