trailblazer 1.1.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.rubocop-https---raw-githubusercontent-com-trailblazer-meta-master-rubocop-yml +101 -0
  4. data/.rubocop.yml +20 -0
  5. data/.rubocop_todo.yml +556 -0
  6. data/.travis.yml +6 -7
  7. data/CHANGES.md +224 -0
  8. data/COMM-LICENSE +62 -0
  9. data/CONTRIBUTING.md +179 -0
  10. data/Gemfile +0 -10
  11. data/LICENSE +9 -0
  12. data/README.md +68 -189
  13. data/Rakefile +3 -3
  14. data/lib/trailblazer/version.rb +3 -1
  15. data/lib/trailblazer.rb +3 -6
  16. data/test/test_helper.rb +32 -3
  17. data/trailblazer.gemspec +11 -15
  18. metadata +28 -132
  19. data/LICENSE.txt +0 -22
  20. data/TODO.md +0 -11
  21. data/doc/Trb-The-Stack.png +0 -0
  22. data/doc/trb.jpg +0 -0
  23. data/gemfiles/Gemfile.rails.lock +0 -130
  24. data/gemfiles/Gemfile.reform-2.0 +0 -6
  25. data/gemfiles/Gemfile.reform-2.1 +0 -7
  26. data/lib/trailblazer/autoloading.rb +0 -15
  27. data/lib/trailblazer/endpoint.rb +0 -31
  28. data/lib/trailblazer/operation/builder.rb +0 -26
  29. data/lib/trailblazer/operation/callback.rb +0 -53
  30. data/lib/trailblazer/operation/collection.rb +0 -6
  31. data/lib/trailblazer/operation/controller.rb +0 -72
  32. data/lib/trailblazer/operation/dispatch.rb +0 -3
  33. data/lib/trailblazer/operation/model/dsl.rb +0 -29
  34. data/lib/trailblazer/operation/model/external.rb +0 -34
  35. data/lib/trailblazer/operation/model.rb +0 -50
  36. data/lib/trailblazer/operation/module.rb +0 -29
  37. data/lib/trailblazer/operation/policy/guard.rb +0 -35
  38. data/lib/trailblazer/operation/policy.rb +0 -85
  39. data/lib/trailblazer/operation/representer.rb +0 -98
  40. data/lib/trailblazer/operation/resolver.rb +0 -30
  41. data/lib/trailblazer/operation/uploaded_file.rb +0 -77
  42. data/lib/trailblazer/operation.rb +0 -175
  43. data/test/callback_test.rb +0 -104
  44. data/test/collection_test.rb +0 -57
  45. data/test/model_test.rb +0 -148
  46. data/test/module_test.rb +0 -93
  47. data/test/operation/builder_test.rb +0 -41
  48. data/test/operation/contract_test.rb +0 -30
  49. data/test/operation/controller_test.rb +0 -111
  50. data/test/operation/dsl/callback_test.rb +0 -118
  51. data/test/operation/dsl/contract_test.rb +0 -104
  52. data/test/operation/dsl/representer_test.rb +0 -142
  53. data/test/operation/external_model_test.rb +0 -71
  54. data/test/operation/guard_test.rb +0 -152
  55. data/test/operation/policy_test.rb +0 -97
  56. data/test/operation/reject_test.rb +0 -34
  57. data/test/operation/resolver_test.rb +0 -83
  58. data/test/operation_test.rb +0 -275
  59. data/test/representer_test.rb +0 -238
  60. data/test/rollback_test.rb +0 -47
data/CHANGES.md CHANGED
@@ -1,3 +1,227 @@
1
+ # 2.1
2
+
3
+ * Macros now always have to provide an `:id`. This was a bit fuzzy in 2.0.
4
+
5
+ * Nested
6
+ if Nested( Edit ), outputs will automatically be connected, see editor.
7
+ * Wrap
8
+ dropped the `pipe` option. This is now `options, flow_options, *`
9
+ `false` is now automatically connected to End.failure.
10
+ * remove `Uber::Callable`.
11
+
12
+ * `operation.new` step removed.
13
+ * Undocumented step behavior removed. You can't write to `self` anymore.
14
+
15
+ ```ruby
16
+ step :process
17
+ def process(*)
18
+ self["x"] = true
19
+ end
20
+ ```
21
+
22
+ Always write to `options`.
23
+
24
+ * self[] removed
25
+ * Fixed `Guard` where procs could receive one argument, only. Guards follow the step interface: `Policy::Guard( ->(options, **) { .. } )
26
+ * Removed `Operation::Callback` which was a poor idea and luckily no one was using it.
27
+
28
+ TODO:
29
+ document Task API and define step API
30
+ deprecate step->(options) ?
31
+ injectable, per-operation step arguments strategy?
32
+
33
+
34
+ # 2.1.0
35
+
36
+ * Remove `declarative` dependency.
37
+
38
+ # 2.1.0.rc13
39
+
40
+ * Use newest `macro` and `macro-context`. They use symbols keys now everywhere.
41
+
42
+ # 2.1.0.rc12
43
+
44
+ * Update dependencies.
45
+
46
+ # 2.1.0.rc11
47
+
48
+ * Remove all macros. They're not located in `trailblazer-macro` and `trailblazer-macro-contract`.
49
+ * Remove DSL
50
+
51
+ # 2.1.0.rc1
52
+
53
+ * Remove `task` and `input_output`, those are implemented in `activity`.
54
+
55
+ # 2.1.0.beta7
56
+
57
+ * Use new `activity-0.3.2` where `VariableMapping` is included now.
58
+
59
+ # 2.1.0.beta6
60
+
61
+ * Use new `activity-0.3.0`.
62
+
63
+ # 2.1.0.beta5
64
+
65
+ * All macros are now cleanly extracted to `trailblazer-macro` and `trailblazer-macro-contract`.
66
+
67
+ # 2.1.0.beta4
68
+
69
+ * Simple maintenance release to establish `activity-0.5.0`.
70
+
71
+ # 2.1.0.beta3
72
+
73
+ * More simplifications because of `activity`.
74
+
75
+ # 2.1.0.beta2
76
+
77
+ * Simplify `Nested` and several other internals by using the new `Activity` API.
78
+
79
+ # 2.1.0.beta1
80
+
81
+ * Add `deprecation/call` and `deprecation/context` that help with the new `call` API and symbols for `options` keys.
82
+
83
+ # 2.0.7
84
+
85
+ * Allow to use any method with the Model macro, e.g.
86
+
87
+ ```ruby
88
+ step Model( Comment, :[] )
89
+ ```
90
+
91
+ will now invoke `Comment[ params[:id] ]`, which makes using Sequel a breeze.
92
+ code: `contract do .. end` etc needs to be moved to a new gem if we want to keep it alive.
93
+
94
+ # 2.0.6
95
+
96
+ * Fix what we broke in 2.0.5, where `Wrap` would always use the current operation subclass and not the empty `Trailblazer::Operation`. Thanks to @mensfeld.
97
+
98
+ # 2.0.5
99
+
100
+ * In Wrap, use `self` instead of a hard class reference. This allows using Wrap in the compat gem.
101
+
102
+ # 2.0.4
103
+
104
+ * When using `Nested(X)`, the automatic `:name` option is now `"Nested(X)"` instead of the cryptic proc string.
105
+
106
+ # 2.0.3
107
+
108
+ * `Guard` now allows kw args for its option.
109
+ * Fix a bug where `Nested( ->{} )` wouldn't `_call` the nested operation and did too much work on re-nested the already nested params. Thanks to @eliranf for spotting this.
110
+ * Add `Nested(..., input: )` to dynamically decide the input to the nested operation. http://trailblazer.to/gems/operation/2.0/api.html#nested-input
111
+ * Add `Nested(..., output: )`: http://trailblazer.to/gems/operation/2.0/api.html#nested-output
112
+
113
+ # 2.0.2
114
+
115
+ * Remove `uber` dependency as we use our own `Option::KW` now.
116
+ * In `Contract::Build( builder: )` you now also have access to the `name:` keyword. Note that you need to double-splat in builders.
117
+
118
+ ```ruby
119
+ Contract::Build( builder: ->(options, constant:, **) )
120
+ ```
121
+ Same for `:method` and `Callable`.
122
+ * `Policy::Guard( :method )` now works.
123
+
124
+ # 2.0.1
125
+
126
+ * Add `fail_fast: true` for `step` and `failure` to short-circuit the pipe. Note that more "eloquent" semantics are coming in `trailblazer-bpmn`.
127
+ * Add `fail!`, `fail_fast!`, `pass!`, and `pass_fast!`. Note that they are all experimental API and not documented, yet.
128
+ * Remove Builder and allow [dynamic `Nested`](http://trailblazer.to/gems/operation/2.0/api.html#nested-callable).
129
+
130
+ ```ruby
131
+ step Nested( ->(options, params:) { params[:type] == "moderated" ? Moderated : Comment } )
132
+ ```
133
+ * Remove `override` in favor of `step .., override: true`. Note that this method wasn't documented.
134
+ * Numerous internal simplifications [documented here](https://github.com/trailblazer/trailblazer-operation/blob/master/CHANGES.md#0010).
135
+
136
+
137
+ # 2.0.0
138
+
139
+ All old semantics will be available via [trailblazer-compat](https://github.com/trailblazer/trailblazer-compat).
140
+
141
+ * Removed `Operation::run` as it was a bad decision. Raising an exception on invalid is a very test-specific scenario and shouldn't have been handled in the core doce.
142
+ * Removed `Operation::present`, since you can simply call `Operation::new` (without builders) or `Operation::build_operation` (with builders).
143
+ * Removed `Operation::valid?`. This is in the result object via `result.success?`.
144
+ * Removed `Operation#errors`. This is in the result object via `result[:errors]` if the operation was invalid.
145
+ * Removed the private option `:raise_on_invalid`. Use `Contract::Raise` instead, if you need it in tests.
146
+
147
+ * Removed `Operation::contract` (without args). Please use `Operation::["contract.default.class"]`.
148
+ * Removed `Operation::callbacks` (without args). Please use `Operation::["callback.<name>.class"]`.
149
+ * Removed `Operation::contract_class`. Please use `Operation::["contract.default.class"]`.
150
+ * Removed `Operation::contract_class=`. Please use `Operation::["contract.default.class"]=`. Doesn't inherit.
151
+
152
+ ## Model
153
+
154
+ * The `model` method doesn't exist anymore, use `self["model"]` or write your own.
155
+ * `:find_by` diverts to left track.
156
+ * `:create` is `:new` now.
157
+
158
+ ## Builder
159
+
160
+ * It's `include Builder` now, not `extend Builder`.
161
+ * `builds` now receives one options hash.
162
+
163
+ ## Policy
164
+
165
+ * No exception anymore, but `Operation#["policy.result"]`.
166
+ * Access the current user via `self["current_user"]` now.
167
+ * `Policy` is `Policy::Pundit` now as `Policy` is Trailblazer's (upcoming) authorization style.
168
+
169
+ ## Representer
170
+
171
+ * Removed `Operation::representer_class`. Please use `Operation::["representer.class"]`.
172
+ * Removed `Operation::representer_class=`. Please use `Operation::["representer.class"]=`.
173
+ * You can now have any number of named representers: `Operation.representer :parser, ParsingRepresenter`.
174
+ * Automatic infering of the representer from a `contract` is not so automatic anymore. This feature was barely used and is now available via `include Representer::InferFromContract`.
175
+ * Reform 2.0 is not supported in `Representer` anymore, meaning you can't automatically infer representers from 2.0 contracts. Reform 2.0 works with all remaining components.
176
+ * Removed `Operation::contract_class`. Please use `Operation::["contract.default.class"]`.
177
+ * Removed `Operation::contract_class=`. Please use `Operation::["contract.default.class"]=`. Doesn't inherit.
178
+
179
+ ## Callback
180
+
181
+ * Removed `Operation::Dispatch`, it's called `Operation::Callback`.
182
+
183
+
184
+ ## Collection
185
+
186
+ * Removed `Operation::Collection`. Please use `Operation::present`.
187
+
188
+ ## Controller
189
+
190
+ * Removed `Controller`, this is now in [trailblazer-rails](https://github.com/trailblazer/trailblazer-rails/).
191
+
192
+ ## Contract
193
+
194
+ * You can't call `Create.().contract` anymore. The contract instance(s) are available through the `Result` object via `["contract.default"]`.
195
+ * Removed the deprecation for `validate`, signature is `(params[, model, options, contract_class])`.
196
+ * Removed the deprecation for `contract`, signature is `([model, options, contract_class])`.
197
+
198
+ # 2.0.0.rc1
199
+
200
+ * `consider` got removed since `step` now evaluates the step's result and deviates (or not).
201
+
202
+ # 2.0.0.rc2
203
+
204
+ * It's now Contract::Persist( name: "params" ) instead of ( name: "contract.params" ).
205
+
206
+ # 2.0.0.beta3
207
+
208
+ * New, very slick keyword arguments for steps.
209
+
210
+ # 2.0.0.beta2
211
+
212
+ * Removed `Operation::Controller`.
213
+ * Renamed `Persist` to `Contract::Persist`.
214
+ * Simplify inheritance by introducing `Operation::override`.
215
+ * `Contract` paths are now consistent.
216
+
217
+ # 2.0.0.beta1
218
+
219
+ * Still undefined `self.~`.
220
+
221
+ # 1.1.2
222
+
223
+ * Stricter `uber` dependency.
224
+
1
225
  # 1.1.1
2
226
 
3
227
  * Rename `Operation::Representer::ClassMethods` to `Operation::Representer::DSL` and allow to use `DSL` and `Rendering` without `Deserialization` so you can use two different representers.
data/COMM-LICENSE ADDED
@@ -0,0 +1,62 @@
1
+ TRAILBLAZER LICENSE AGREEMENT
2
+ VERSION 1.1
3
+
4
+
5
+ IMPORTANT: THIS SOFTWARE LICENSE AGREEMENT IS A LEGAL AGREEMENT (“AGREEMENT”) BETWEEN LICENSEE (“LICENSEE”) AND TRAILBLAZER GMBH. READ IT CAREFULLY BEFORE COMPLETING THE INSTALLATION PROCESS AND USING TRAILBLAZER GEMS (AT GITHUB.COM/TRAILBLAZER), TRAILBLAZER PRO AND RELATED TRAILBLAZER PRO COMPONENTS (SOURCE URL WILL BE PROVIDED AFTER PURCHASE) (“SOFTWARE”). IT PROVIDES A LICENSE TO USE THE SOFTWARE AND CONTAINS WARRANTY INFORMATION AND LIABILITY DISCLAIMERS. IN CONSIDERATION OF LICENSEE’S INSTALLATION AND USE OF THE SOFTWARE, LICENSEE HEREBY CONFIRMS THE ACCEPTANCE OF THE SOFTWARE AND AGREES TO BECOME BOUND BY THE TERMS OF THIS AGREEMENT.
6
+
7
+
8
+ In order to use the Software under this Agreement (“Commercial Version”), Licensee must receive a source URL at the time of purchase, in accordance with the scope of use and other terms specified for each type of Software and as set forth in this Section 1 of this Agreement.
9
+
10
+ 1. License Grant.
11
+ 1.1 General Use. This Agreement grants Licensee a worldwide, non-exclusive, non-transferable license, valid for the license term, to use the Software, without the right to grant sublicenses, subject to the terms and conditions in this Agreement. The Software is licensed, not sold.
12
+ 1.2 Installations. Licensee may install the Software on an unlimited number of Hosts per project. “Host” means any physical or virtual machine which is controlled by Licensee. A project may involve multiple repositories.
13
+ 1.3 Applications. Licensee may distribute the Software in any applications, frameworks, or elements (collectively referred to as an “Application” or “Applications”) that Licensee develops using the Software in accordance with this Agreement, provided that such distribution does not violate the restrictions set forth in section 3 of this Agreement. Licensee must not remove, obscure or interfere with any copyright, acknowledgment, attribution, trademark, warning or disclaimer statement affixed to, incorporated in or otherwise applied in connection with the Software. Licensee is required to ensure that the Software is not reused by or with any applications other than those with which Licensee distribute it as permitted herein. For example, if Licensee installs the Software on a customer’s server, that customer is not permitted to use the Software independently of Licensee’s Application. Licensee must inform Trailblazer GmbH of any infringing use of the Software by any of Licensee’s customers. Licensee is liable for compliance by those third parties with the terms and conditions of this Agreement. Licensee shall not owe Trailblazer GmbH any royalties for Licensee’s distribution of the Software in accordance with this Agreement.
14
+ 1.4 Archive Copies. Licensee is entitled to make a reasonable amount of copies of the Software for archival purposes. Each copy must reproduce all copyright and other proprietary rights notices on or in the Software.
15
+ 1.5 Electronic Delivery. All Software and license documentation shall be delivered by electronic means unless otherwise specified on the applicable invoice (“Invoice”) or at the time of purchase. Software shall be deemed delivered when it is made available for download by Licensee (“Delivery”).
16
+
17
+ 2. Modifications.
18
+ Trailblazer GmbH shall provide Licensee with source code so that Licensee can create Modifications of the Software. “Modification” means: (a) any addition to or deletion from the contents of a file included in the original Software or previous Modifications created by Licensee, or (b) any new file that contains any part of the original Software or previous Modifications. While Licensee retains all rights to any original work authored by Licensee as part of the Modifications, Trailblazer GmbH continues to own all copyright and other intellectual property rights in the Software.
19
+
20
+ 3. Restricted Uses.
21
+ 3.1 Licensee shall not (and shall not allow any third party to): (a) decompile, disassemble, or otherwise reverse engineer the Software or attempt to reconstruct or discover any source code, underlying ideas, algorithms, file formats or programming interfaces of the Software by any means whatsoever (except and only to the extent that applicable law prohibits or restricts reverse engineering restrictions); (b) distribute, sell, sublicense, rent, lease or use the Software for time sharing, hosting, service provider or like purposes, except as expressly permitted under this Agreement; (c) redistribute the Software or Modifications other than by including the Software or a portion thereof within Licensee’s own product, which must have substantially different functionality than the Software or Modifications and must not allow any third party to use the Software or Modifications, or any portions thereof, for software development or application development purposes; (d) redistribute the Software as part of an "appliance" or "virtual server"; (e) redistribute the Software on any server which is not directly under Licensee’s control; (f) remove any product identification, proprietary, copyright or other notices contained in the Software; (g) modify any part of the Software, create a derivative work of any part of the Software (except as permitted in Section 2), or incorporate the Software, except to the extent expressly authorized in writing by Trailblazer GmbH; (h) publicly disseminate performance information or analysis (including, without limitation, benchmarks) from any source relating to the Software; (i) utilize any equipment, device, software, or other means designed to circumvent or remove any form of Source URL or copy protection used by Trailblazer GmbH in connection with the Software, or use the Software together with any authorization code, Source URL, serial number, or other copy protection device not supplied by Trailblazer GmbH; (j) use the Software to develop a product which is competitive with any Trailblazer GmbH product offerings (unless such development is allowed by applicable law); or (k) use unauthorized Source URLS or keycode(s) or distribute or publish Source URLs or keycode(s), except as may be expressly permitted by Trailblazer GmbH in writing. If Licensee’s unique Source URL is ever published, Trailblazer GmbH reserves the right to terminate Licensee’s access without notice.
22
+ 3.2 UNDER NO CIRCUMSTANCES MAY LICENSEE USE THE SOFTWARE AS PART OF A PRODUCT OR SERVICE THAT PROVIDES SIMILAR FUNCTIONALITY AS THE SOFTWARE ITSELF.
23
+
24
+ 4. Ownership.
25
+ Notwithstanding anything to the contrary contained herein, except for the limited license rights expressly provided herein, Trailblazer GmbH and its suppliers have and will retain all rights, title and interest (including, without limitation, all patent, copyright, trademark, trade secret and other intellectual property rights) in and to the Software and all copies, modifications and derivative works thereof (including any changes which incorporate any of Licensee’s ideas, feedback or suggestions). Licensee acknowledges that Licensee is obtaining only a limited license right to the Software, and that irrespective of any use of the words “purchase”, “sale” or like terms hereunder no ownership rights are being conveyed to Licensee under this Agreement or otherwise.
26
+
27
+ 5. Fees and Payment.
28
+ The Software license fees will be due and payable in full as set forth in the Invoice or at the time of purchase. Licensee shall be responsible for all taxes, withholdings, duties and levies arising from the order (excluding taxes based on the net income of Trailblazer GmbH).
29
+
30
+ 6. Support, Maintenance and Services.
31
+ Subject to the terms and conditions of this Agreement, as set forth in the Invoice, and as set forth on the Trailblazer PRO support page (http://pro.trailblazer.to), support and maintenance services may be included with the purchase of Licensee’s license subscription.
32
+
33
+ 7. Term of Agreement.
34
+ 7.1 Term. This Agreement is effective as of the Delivery of the Software and expires at such time as all license and service subscriptions hereunder have expired in accordance with their own terms (the “Term”). For clarification, the term of the license under this Agreement may be perpetual or designated as a fixed-term license in the Invoice and shall be specified at Licensee’s time of purchase. Either party may terminate this Agreement (including all related Invoices) if the other party: (a) fails to cure any material breach of this Agreement within thirty (30) days after written notice of such breach, provided that Trailblazer GmbH may terminate this Agreement immediately upon any breach of Section 3 or if Licensee exceeds any other restrictions contained in Section 1, unless otherwise specified in this agreement; (b) ceases operation without a successor; or (c) seeks protection under any bankruptcy, receivership, trust deed, creditors arrangement, composition or comparable proceeding, or if any such proceeding is instituted against such party (and not dismissed within sixty (60) days)). Termination is not an exclusive remedy and the exercise by either party of any remedy under this Agreement will be without prejudice to any other remedies it may have under this Agreement, by law, or otherwise.
35
+ 7.2 Termination. Upon any termination of this Agreement, Licensee shall cease any and all use of any Software and destroy all copies thereof.
36
+ 7.3 Expiration of License. Upon the expiration of any term under this Agreement, (a) all Software updates and services pursuant to the license shall cease, (b) Licensee may only continue to run existing installations of the Software, (c) Licensee may not install the Software on any additional Hosts, and (d) any new installation of the Software shall require the purchase of a new license subscription from Trailblazer GmbH.
37
+
38
+ 8. Disclaimer of Warranties.
39
+ The Software is provided "as is", with all faults, defects and errors, and without warranty of any kind. Trailblazer GmbH does not warrant that the Software will be free of bugs, errors, viruses or other defects, and Trailblazer GmbH shall have no liability of any kind for the use of or inability to use the Software, the Software content or any associated service, and Licensee acknowledges that it is not technically practicable for Trailblazer GmbH to do so.
40
+ To the maximum extent permitted by applicable law, Trailblazer GmbH disclaims all warranties, express, implied, arising by law or otherwise, regarding the Software, the Software content and their respective performance or suitability for Licensee’s intended use, including without limitation any implied warranty of merchantability, fitness for a particular purpose.
41
+
42
+ 9. Limitation of Liability.
43
+ To the maximum extent permitted by applicable law, Trailblazer GmbH will not be liable for any direct, indirect, consequential, incidental, special, exemplary, or punitive damages or liabilities whatsoever arising from or relating to the Software, the Software content or this Agreement, whether based on contract, tort (including negligence), strict liability or other theory, even if Trailblazer GmbH has been advised of the possibility of such damages. In no event will Trailblazer GmbH's liability exceed the Software license price as indicated in the Invoice. The existence of more than one claim will not enlarge or extend this limit. Claims for damages under the Product Liability Act shall remain unaffected, as shall liability for damage to life, body or health.
44
+
45
+ 10. Remedies.
46
+ Licensee’s exclusive remedy and Trailblazer GmbH’s entire liability for breach of this Agreement shall be limited, at Trailblazer GmbH’s sole and exclusive discretion, to (a) replacement of any defective software or documentation; or (b) refund of the license fee paid to Trailblazer GmbH.
47
+
48
+ 11. Miscellaneous
49
+ 11.1 Entire Agreement. This Agreement sets forth our entire agreement with respect to the Software and the subject matter hereof and supersedes all prior and contemporaneous understandings and agreements whether written or oral.
50
+ 11.2 No Assignment. Licensee may not assign this Agreement or any of its rights under this Agreement without the prior written consent of Trailblazer GmbH and any attempted assignment without such consent shall be void.
51
+ 11.3 Export Compliance. Licensee agrees to comply with all applicable laws and regulations, including laws, regulations, orders or other restrictions on export, re-export or redistribution of software.
52
+ 11.4 Indemnification. Licensee agrees to defend, indemnify, and hold harmless Trailblazer GmbH from and against any lawsuits, claims, losses, damages, fines and expenses (including attorneys' fees and costs) arising out of Licensee’s use of the Software or breach of this Agreement.
53
+ 11.5 Governing Law. This Agreement is governed and construed in accordance with the law of The Federal Republic of Germany and shall be subject to the exclusive jurisdiction of the Courts of Berlin, Germany. The operation of the United Nations Convention on the International Sale of Goods is hereby expressly excluded.
54
+ 11.6 Dispute Resolution. In the event of any dispute arising from or in connection with this Agreement, the parties undertake to make all their best efforts to settle the dispute amicably through negotiations, failing which either party may submit the dispute for resolution by the Courts of Berlin, Germany.
55
+ 11.7 Attorneys’ Fees and Costs. The prevailing party in any action to enforce this Agreement shall be entitled to recover its attorneys’ fees and costs in connection with such action.
56
+ 11.8 Severability. If any provision of this Agreement is held by a court of competent jurisdiction to be invalid, illegal, or unenforceable, the remainder of this Agreement shall remain in full force and effect.
57
+ 11.9 Waiver. Failure or neglect by either party to enforce at any time any of the provisions of this Agreement shall not be construed or deemed to be a waiver of that party's rights under this Agreement.
58
+ 11.10 Modifications. No modification of this Agreement shall be effective unless contained in writing and executed by an authorized representative of each party. No term or condition in Licensee’s Purchase Order or Terms and Conditions shall apply unless expressly accepted by Trailblazer GmbH.
59
+ 11.11 Force Majeure. Trailblazer GmbH shall not be liable for any delay or non-performance of its obligations under this Agreement in the event and to the extent that such delay or non-performance is due to an unforeseeable catastrophic event that prevents Trailblazer GmbH to fulfill its obligations under this Agreement and which Trailblazer GmbH cannot avoid or circumvent (“Force Majeure Event”). If the Force Majeure Event results in a delay or non-performance of Trailblazer GmbH for a period of three (3) months or longer, then Licensee shall have the right to terminate this Agreement with immediate effect without any liability (except for the obligations of payment arising prior to the event of Force Majeure).
60
+
61
+
62
+ The Open Source version of the TRAILBLAZER GEMS (“LGPL Version”) is licensed under the terms of the GNU Lesser General Public License versions 3.0 (“LGPL”) and not under this Agreement.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,179 @@
1
+ # Contributing to Trailblazer
2
+ Trailblazer is an open source project and we would love you to help us make it better.
3
+
4
+ ## Questions/Help
5
+ If our [guides][guides] nor [docs][api-docs] can help you figure things out, and you're stuck, refrain from posting questions on github issues, and please just find us on the [trailblazer gitter chat][chat] and drop us a line.
6
+
7
+ Keep in mind when asking questions though, an example will get you help faster than anything else you do.
8
+
9
+ If you file an issue with a question, it will be closed. We're not trying to be mean, don't get us wrong, we're just trying to stay sane.
10
+
11
+ ## Reporting Issues
12
+ A well formatted issue is appreciated, and goes a long way in helping us help you.
13
+
14
+ * Make sure you have a [GitHub account](https://github.com/signup/free)
15
+ * Submit a [Github issue][issues-link] by:
16
+ * Clearly describing the issue
17
+ * Provide a descriptive summary
18
+ * Provide sample code where possible (preferably in the form of a test, in a [Gist][gist] for bonus points)
19
+ * Explain the expected behavior
20
+ * Explain the actual behavior
21
+ * Provide steps to reproduce the actual behavior
22
+ * Provide your application's complete `Gemfile.lock` as text (in a [Gist][gist] for bonus points)
23
+ * Any relevant stack traces
24
+
25
+ If you provide code, make sure it is formatted with the triple backticks (\`).
26
+
27
+ At this point, we'd love to tell you how long it will take for us to respond, but we just don't know.
28
+
29
+ ## Pull requests
30
+ We accept pull requests to Trailblazer for:
31
+
32
+ * Adding documentation
33
+ * Fixing bugs
34
+ * Adding new features
35
+
36
+ Not all features proposed will be added but we are open to having a conversation about a feature you are championing.
37
+
38
+ ###Here's a quick guide:
39
+ #### Fork the Project
40
+ Fork the [project repository][project-repo-link] on Github and check out your copy.
41
+
42
+ ```
43
+ git clone https://github.com/YOUR_HANDLE/trailblazer.git
44
+ cd trailblazer
45
+ git remote add upstream https://github.com/trailblazer/trailblazer.git
46
+ ```
47
+
48
+ #### Create a Topic Branch
49
+ Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
50
+ ```
51
+ git checkout master
52
+ git pull upstream master
53
+ git checkout -b my-feature-branch
54
+ ```
55
+
56
+ #### Bundle and Test
57
+ Run bundle install/update to gather any and all dependencies. Run the tests. This is to make sure your starting point works.
58
+
59
+ ```
60
+ bundle install
61
+ bundle exec rake
62
+ ```
63
+
64
+ #### Write Tests
65
+ Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to [test][test-link].
66
+
67
+ We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
68
+
69
+ #### Write Code
70
+ Implement your feature or bug fix.
71
+
72
+ Ruby style is enforced with [RuboCop](https://github.com/bbatsov/rubocop), run `bundle exec rubocop` and fix any style issues highlighted.
73
+
74
+ Make sure that `bundle exec rake` completes without errors.
75
+
76
+ #### Write Documentation
77
+ Document any external behavior in the [README](README.md).
78
+
79
+ #### Commit Changes
80
+ Make sure git knows your name and email address:
81
+
82
+ ```
83
+ git config --global user.name "Your Name"
84
+ git config --global user.email "contributor@example.com"
85
+ ```
86
+
87
+ Writing good commit logs is important. A commit log should describe what has changed and why, but be brief.
88
+
89
+ ```
90
+ git add your_filename.rb (File names to add content from, or fileglobs e.g. *.rb)
91
+ git commit
92
+ ```
93
+
94
+ #### Push
95
+ ```
96
+ git push origin my-feature-branch
97
+ ```
98
+
99
+ #### Make a Pull Request
100
+ Go to https://github.com/YOUR_GH_HANDLE/trailblazer and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days, but no need to rush us if it takes longer.
101
+
102
+ #### Rebase
103
+ If you've been working on a change for a while, rebase with upstream/master.
104
+
105
+ ```
106
+ git fetch upstream
107
+ git rebase upstream/master
108
+ git push origin my-feature-branch -f
109
+ ```
110
+
111
+ #### Update CHANGELOG Again
112
+ Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
113
+
114
+ ```
115
+ * [#123](https://github.com/trailblazer/trailblazer/pull/123): Your brief description - [@your_gh_handle](https://github.com/your_gh_handle).
116
+ ```
117
+
118
+ Amend your previous commit and force push the changes.
119
+
120
+ ```
121
+ git commit --amend
122
+ git push origin my-feature-branch -f
123
+ ```
124
+
125
+ #### Check on Your Pull Request
126
+ Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
127
+
128
+ ## Quality
129
+
130
+ Committing to OSS projects is always difficult, because all maintainers will adhere to their own quality standards that you don't know. Every projects wants "good code design", and so do we, so here are a few things that you should follow when contributing.
131
+
132
+ * Good design matters: sometimes a feature could be added with a simple `if <my new case>` to an existing block of code. Usually, an `if` implies that the original design didn't plan on handling multiple cases, or in other words, **a refactoring of the code structure might be necessary**. If you're unsure: [Talk to us!](https://gitter.im/trailblazer/chat)
133
+ * Make smaller pull requests. It is so much easier to discuss something graspable and not a "37 files changed" PR. The sooner we see your code, the earlier we can decide about which way to go. It is incredibly appreciated, though, to send us a link to a branch of yours where we can see the desired changes in total. We can then help splitting those into smaller steps.
134
+ * **Never ever use `if respond_to?`** to add a feature. This is a pattern as seen a lot in Rails core that causes incredibly hard to find ~bugs~ behavior. In Trailblazer, we use "Tell, don't ask!", which means, never try to find out the type of an object via `respond_to?`. If you really have to introspect the type, use `is_a?`. Treat it as a duck, ducks don't speak.
135
+
136
+
137
+ ## Releasing
138
+
139
+ When you have release rights, please follow these rules.
140
+
141
+ * When tagging a commit for a release, use the format `vX.X.X` for the tag, e.g. `git tag v2.1.0`.
142
+ * The tagged commit **must contain the line** "Releasing vX.X.X" so it can be quickly spotted later in the commit list.
143
+
144
+ #### What now?
145
+ At this point you're waiting on us. Expect a conversation regarding your pull request; Questions, clarifications, and so on.
146
+
147
+ Some things that will increase the chance that your pull request is accepted:
148
+ * Use Trailblazer idioms and follow the Trailblazer ideology
149
+ * Include tests that fail without your code, and pass with it
150
+ * Update the documentation, guides, etc.
151
+
152
+ ## What do we need help with?
153
+ ### Helping others!
154
+ There are a lot of questions from people as they get started using Trailblazer. If you could **please do the following things**, that would really help:
155
+
156
+ - Hang out on [the chat][chat]
157
+ - Watch the [trailblazer repositories][repositories] for issues or requests that you could help with
158
+
159
+ ### Contributing to community
160
+ - Create Macros!
161
+ - Write blog posts!
162
+ - Record screencasts
163
+ - Write examples.
164
+
165
+ ### Contributing to the core
166
+ - Tests are always helpful!
167
+ - Any of the issues in GitHub, let us know if you have some time to fix one.
168
+
169
+ ## Thank You
170
+ Please do know that we really appreciate and value your time and work.
171
+
172
+ [gist]: https://gist.github.com
173
+ [guides]: https://www.trailblazer.to
174
+ [api-docs]: https://www.trailblazer.to/api-docs
175
+ [chat]: https://gitter.im/trailblazer/chat
176
+ [repositories]: https://github.com/trailblazer
177
+ [test-link]: https://github.com/trailblazer/trailblazer/tree/master/test
178
+ [project-repo-link]: https://github.com/trailblazer/trailblazer
179
+ [issues-link]: https://www.github.com/trailblazer/trailblazer/issues
data/Gemfile CHANGED
@@ -2,13 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in trailblazer.gemspec
4
4
  gemspec
5
-
6
- # gem "representable", path: "../representable"
7
- # gem "disposable", path: "../disposable"
8
- gem "virtus"
9
- gem "reform", github: "apotonick/reform"
10
- gem "roar", github: "apotonick/roar"
11
- # gem "reform", "~> 2.0.0"
12
- # gem "reform", path: "../reform"
13
- # gem "roar", path: "../roar"
14
- gem "multi_json"
data/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ Copyright (c) 2018 Trailblazer GmbH
2
+
3
+ Trailblazer is an Open Source project licensed under the terms of
4
+ the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
5
+ for license text.
6
+
7
+ Trailblazer PRO has a commercial-friendly license allowing private forks
8
+ and modifications of Trailblazer. Please see http://trailblazer.to/pro for
9
+ more detail.