trailblazer 2.1.0.rc13 → 2.1.0
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/.travis.yml +0 -1
- data/COMM-LICENSE +46 -75
- data/LICENSE +9 -0
- data/README.md +24 -269
- data/lib/trailblazer/version.rb +1 -1
- data/trailblazer.gemspec +3 -3
- metadata +10 -10
- data/LICENSE.txt +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1880885128b035e5a00ad877be0d017d39577ce7d501bd6aeae8367c4fc590cb
|
4
|
+
data.tar.gz: 799e2dc57477bb87b9712f9d86e56656d0b81d2dba5d6f57b24412d645e00fb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22d9fe5656cc10be8ddbcf7943dfda73688b0c2f131c3075fbbc229ddb43f936d75b08b481c11c1dd7b290b94f2cb79e0a517e92bd5a4858595c224de3221c7c
|
7
|
+
data.tar.gz: 15bf42c25fba517d1071470bcfecb265c9fcfc6d4111d24258bbe155ebbed53cb8dd3e72f9b9f70e3860074137efde9883d2acc256f7dbbf63d24a7eba145261
|
data/.travis.yml
CHANGED
data/COMM-LICENSE
CHANGED
@@ -1,91 +1,62 @@
|
|
1
|
-
|
1
|
+
TRAILBLAZER LICENSE AGREEMENT
|
2
|
+
VERSION 1.1
|
2
3
|
|
3
|
-
------------------------------------------------------------------------------
|
4
4
|
|
5
|
-
IMPORTANT: THIS SOFTWARE
|
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
6
|
|
7
|
-
------------------------------------------------------------------------------
|
8
7
|
|
9
|
-
In order to use the Software under this Agreement,
|
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.
|
10
9
|
|
11
|
-
1. License Grant
|
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”).
|
12
16
|
|
13
|
-
|
14
|
-
|
15
|
-
1.2 Limited Organization License. If you purchased an Organization License (included with the Trailblazer Enterprise Software), you may install the Software on an unlimited number of Hosts. “Host” means any physical or virtual machine which is controlled by you.
|
16
|
-
|
17
|
-
1.3 Appliance License. If you purchased an Appliance License, you may distribute the Software in any applications, frameworks, or elements (collectively referred to as an “Application” or “Applications”) that you develop using the Software in accordance with this EULA, provided that such distribution does not violate the restrictions set forth in section 3 of this EULA. You 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. You are required to ensure that the Software is not reused by or with any applications other than those with which you distribute it as permitted herein. For example, if You install the Software on a customer’s server, that customer is not permitted to use the Software independently of your Application. You must inform Synergy Software Solutions of your knowledge of any infringing use of the Software by any of your customers. You are liable for compliance by those third parties with the terms and conditions of this EULA. You will not owe Synergy Software Solutions any royalties for your distribution of the Software in accordance with this EULA.
|
18
|
-
|
19
|
-
1.4 Archive Copies. You are 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 Product.
|
20
|
-
|
21
|
-
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 you (“Delivery”).
|
22
|
-
|
23
|
-
2. Modifications. Synergy Software Solutions shall provide you with source code so that you 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 You, or (b) any new file that contains any part of the original Software or previous Modifications. While you retain all rights to any original work authored by you as part of the Modifications, We continue to own all copyright and other intellectual property rights in the Software.
|
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.
|
24
19
|
|
25
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.
|
26
23
|
|
27
|
-
|
28
|
-
|
29
|
-
3.2 UNDER NO CIRCUMSTANCES MAY YOU USE THE SOFTWARE AS PART OF A PRODUCT OR SERVICE THAT PROVIDES SIMILAR FUNCTIONALITY TO THE SOFTWARE ITSELF.
|
30
|
-
|
31
|
-
The Open Source version of the Software (“LGPL Version”) is licensed
|
32
|
-
under the terms of the GNU Lesser General Public License versions 3.0
|
33
|
-
(“LGPL”) and not under this EULA.
|
34
|
-
|
35
|
-
4. Ownership. Notwithstanding anything to the contrary contained herein, except for the limited license rights expressly provided herein, Synergy Software Solutions 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 your ideas, feedback or suggestions). You acknowledge that you are 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 you under this Agreement or otherwise.
|
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.
|
36
26
|
|
37
|
-
5. Fees and Payment.
|
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).
|
38
29
|
|
39
|
-
6. Support, Maintenance and Services.
|
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.
|
40
32
|
|
41
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.
|
42
37
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
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) you may only continue to run existing installations of the Software, (c) you 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 Synergy Software Solutions.
|
48
|
-
|
49
|
-
8. Disclaimer of Warranties. The Software is provided "as is," with all faults, defects and errors, and without warranty of any kind. Synergy Software Solutions does not warrant that the Software will be free of bugs, errors, viruses or other defects, and Synergy Software Solutions 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 you acknowledge that it is not technically practicable for Synergy Software Solutions to do so.
|
50
|
-
To the maximum extent permitted by applicable law, Synergy Software Solutions disclaims all warranties, express, implied, arising by law or otherwise, regarding the Software, the Software content and their respective performance or suitability for your intended use, including without limitation any implied warranty of merchantability, fitness for a particular purpose.
|
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.
|
51
41
|
|
52
42
|
9. Limitation of Liability.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
11.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
13.3 Assignment. You may not assign this Agreement or any of its rights under this Agreement without the prior written consent of Synergy Software Solutions and any attempted assignment without such consent shall be void.
|
74
|
-
|
75
|
-
13.4 Export Compliance. You agree to comply with all applicable laws and regulations, including laws, regulations, orders or other restrictions on export, re-export or redistribution of software.
|
76
|
-
|
77
|
-
13.5 Indemnification. You agree to defend, indemnify, and hold harmless Synergy Software Solutions from and against any lawsuits, claims, losses, damages, fines and expenses (including attorneys' fees and costs) arising out of your use of the Software or breach of this Agreement.
|
78
|
-
|
79
|
-
13.6 Governing Law. This Agreement is governed and construed in accordance with the law of Singapore and shall be subject to the exclusive jurisdiction of the Singapore Courts. The operation of the United Nations Convention on the International Sale of Goods is hereby expressly excluded.
|
80
|
-
|
81
|
-
13.7 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 Singapore Courts.
|
82
|
-
|
83
|
-
13.8 Attorneys’ Fees and Costs. The prevailing party in any action to enforce this Agreement will be entitled to recover its attorneys’ fees and costs in connection with such action.
|
84
|
-
|
85
|
-
13.9 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 will remain in full force and effect.
|
86
|
-
|
87
|
-
13.10 Waiver. Failure or neglect by either party to enforce at any time any of the provisions of this licence Agreement shall not be construed or deemed to be a waiver of that party's rights under this Agreement.
|
88
|
-
|
89
|
-
13.11 Headings. The headings of sections and paragraphs of this Agreement are for convenience of reference only and are not intended to restrict, affect or be of any weight in the interpretation or construction of the provisions of such sections or paragraphs.
|
90
|
-
|
91
|
-
14. Contact Information. If you have any questions about this EULA, or if you want to contact Synergy Software Solutions for any reason, please direct correspondence to info@trailblazer.to.
|
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/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.
|
data/README.md
CHANGED
@@ -1,25 +1,30 @@
|
|
1
1
|
# Trailblazer
|
2
2
|
|
3
|
-
_Trailblazer provides new high-level abstractions for Ruby frameworks. It gently enforces encapsulation, an intuitive code structure and
|
3
|
+
_Trailblazer provides new high-level abstractions for Ruby frameworks. It gently enforces encapsulation, an intuitive code structure and approaches the modeling of complex business workflows with a functional mind-set._
|
4
4
|
|
5
5
|
[](https://gitter.im/trailblazer/chat)
|
6
6
|
[](http://trailblazer.to/newsletter/)
|
7
7
|
[](http://badge.fury.io/rb/trailblazer)
|
8
8
|
[](https://www.codetriage.com/trailblazer/trailblazer)
|
9
9
|
|
10
|
-
|
10
|
+
## Documentation
|
11
|
+
|
12
|
+
**This document discusses Trailblazer 2.1.** An overview about the additions are [on our website](http://2019.trailblazer.to/2.1/docs/trailblazer.html#trailblazer-2-1-migration).
|
13
|
+
|
14
|
+
We're working on several new example applications!
|
15
|
+
|
16
|
+
* *Refactoring to Trailblazer* discusses how the cfp-app is converted into a TRB app.
|
17
|
+
* *BPMN and workflows* shows in-detail how the new 2.1 features in Trailblazer are used.
|
11
18
|
|
12
19
|
The [1.x documentation is here](http://trailblazer.to/gems/operation/1.1/).
|
13
20
|
|
14
21
|
## Trailblazer In A Nutshell
|
15
22
|
|
16
23
|
1. All business logic is encapsulated in [operations](#operation) (service objects).
|
17
|
-
* Optional [validation objects](#validation) (Reform and/or Dry-validation) in the operation deserialize and validate input. The form object can also be used for rendering.
|
18
|
-
* An optional [policy](#policies) object blocks unauthorized users from running the operation.
|
19
|
-
* Optional [callback](#callbacks) objects allow declaring post-processing logic.
|
20
24
|
3. [Controllers](#controllers) instantly delegate to an operation. No business code in controllers, only HTTP-specific logic.
|
21
25
|
4. [Models](#models) are persistence-only and solely define associations and scopes. No business code is to be found here. No validations, no callbacks.
|
22
26
|
5. The presentation layer offers optional [view models](#views) (Cells) and [representers](#representers) for document APIs.
|
27
|
+
6. More complex business flows and life-cycles are modeled using workflows.
|
23
28
|
|
24
29
|
Trailblazer is designed to handle different contexts like user roles by applying [inheritance](#inheritance) between and [composing](#composing) of operations, form objects, policies, representers and callbacks.
|
25
30
|
|
@@ -62,10 +67,6 @@ Instead of grouping by technology, classes and views are structured by *concept*
|
|
62
67
|
|
63
68
|
Within a concept, you can have any level of nesting. For example, `invoicing/pdf/` could be one.
|
64
69
|
|
65
|
-
The file structure is implemented by the [`trailblazer-loader` gem](https://github.com/trailblazer/trailblazer-loader).
|
66
|
-
|
67
|
-
[Learn more.](http://trailblazer.to/gems/trailblazer/loader.html)
|
68
|
-
|
69
70
|
|
70
71
|
## Architecture
|
71
72
|
|
@@ -127,202 +128,32 @@ An operation is not just a monolithic replacement for your business code. It's a
|
|
127
128
|
|
128
129
|
```ruby
|
129
130
|
class Song::Create < Trailblazer::Operation
|
130
|
-
step :
|
131
|
+
step :model
|
132
|
+
step :validate
|
131
133
|
|
132
|
-
def
|
134
|
+
def model(ctx, **)
|
133
135
|
# do whatever you feel like.
|
136
|
+
ctx[:model] = Song.new
|
137
|
+
end
|
138
|
+
|
139
|
+
def validate(ctx, params:, **)
|
140
|
+
# ..
|
134
141
|
end
|
135
142
|
end
|
136
143
|
```
|
137
144
|
|
138
|
-
Operations
|
145
|
+
Operations define the flow of their logic using the DSL and implement the particular steps with pure Ruby.
|
139
146
|
|
140
147
|
You cannot instantiate them per design. The only way to invoke them is `call`.
|
141
148
|
|
142
149
|
```ruby
|
143
|
-
Song::Create.
|
144
|
-
# same as
|
145
|
-
Song::Create.(whatever: "goes", in: "here")
|
150
|
+
Song::Create.(params: {whatever: "goes", in: "here"})
|
146
151
|
```
|
147
152
|
|
148
153
|
Their high degree of encapsulation makes them a [replacement for test factories](#test), too.
|
149
154
|
|
150
155
|
[Learn more.](http://trailblazer.to/gems/operation)
|
151
156
|
|
152
|
-
### Contract
|
153
|
-
The Contract Macro, covers the contracts for Trailblazer, they are basically Reform objects that you can define and validate inside an operation. Reform is a fantastic tool for deserializing and validating deeply nested hashes, and then, when valid, writing those to the database using your persistence layer such as ActiveRecord.
|
154
|
-
|
155
|
-
```ruby
|
156
|
-
# app/concepts/song/contract/create.rb
|
157
|
-
module Song::Contract
|
158
|
-
class Create < Reform::Form
|
159
|
-
property :title
|
160
|
-
property :length
|
161
|
-
|
162
|
-
validates :title, length: 2..33
|
163
|
-
validates :length, numericality: true
|
164
|
-
end
|
165
|
-
end
|
166
|
-
```
|
167
|
-
|
168
|
-
The Contract then gets hooked into the operation. using this Macro.
|
169
|
-
```ruby
|
170
|
-
# app/concepts/song/operation/create.rb
|
171
|
-
class Song::Create < Trailblazer::Operation
|
172
|
-
step Model( Song, :new )
|
173
|
-
step Contract::Build( constant: Song::Contract::Create )
|
174
|
-
step Contract::Validate()
|
175
|
-
step Contract::Persist()
|
176
|
-
end
|
177
|
-
```
|
178
|
-
As you can see, using contracts consists of five steps.
|
179
|
-
|
180
|
-
Define the contract class (or multiple of them) for the operation.
|
181
|
-
Plug the contract creation into the operation’s pipe using Contract::Build.
|
182
|
-
Run the contract’s validation for the params using Contract::Validate.
|
183
|
-
If successful, write the sane data to the model(s). This will usually happen in the Contract::Persist macro.
|
184
|
-
After the operation has been run, interpret the result. For instance, a controller calling an operation will render a erroring form for invalid input.
|
185
|
-
|
186
|
-
Here’s what the result would look like after running the Create operation with invalid data.
|
187
|
-
```ruby
|
188
|
-
result = Song::Create.( title: "A" )
|
189
|
-
result.success? #=> false
|
190
|
-
result["contract.default"].errors.messages
|
191
|
-
#=> {:title=>["is too short (minimum is 2 characters)"], :length=>["is not a number"]}
|
192
|
-
```
|
193
|
-
|
194
|
-
#### Build
|
195
|
-
The Contract::Build macro helps you to instantiate the contract. It is both helpful for a complete workflow, or to create the contract, only, without validating it, e.g. when presenting the form.
|
196
|
-
```ruby
|
197
|
-
class Song::New < Trailblazer::Operation
|
198
|
-
step Model( Song, :new )
|
199
|
-
step Contract::Build( constant: Song::Contract::Create )
|
200
|
-
end
|
201
|
-
```
|
202
|
-
|
203
|
-
This macro will grab the model from options["model"] and pass it into the contract’s constructor. The contract is then saved in options["contract.default"].
|
204
|
-
```ruby
|
205
|
-
result = Song::New.()
|
206
|
-
result["model"] #=> #<struct Song title=nil, length=nil>
|
207
|
-
result["contract.default"]
|
208
|
-
#=> #<Song::Contract::Create model=#<struct Song title=nil, length=nil>>
|
209
|
-
```
|
210
|
-
The Build macro accepts the :name option to change the name from default.
|
211
|
-
|
212
|
-
#### Validation
|
213
|
-
The Contract::Validate macro is responsible for validating the incoming params against its contract. That means you have to use Contract::Build beforehand, or create the contract yourself. The macro will then grab the params and throw then into the contract’s validate (or call) method.
|
214
|
-
|
215
|
-
```ruby
|
216
|
-
class Song::ValidateOnly < Trailblazer::Operation
|
217
|
-
step Model( Song, :new )
|
218
|
-
step Contract::Build( constant: Song::Contract::Create )
|
219
|
-
step Contract::Validate()
|
220
|
-
end
|
221
|
-
```
|
222
|
-
Depending on the outcome of the validation, it either stays on the right track, or deviates to left, skipping the remaining steps.
|
223
|
-
```ruby
|
224
|
-
result = Song::ValidateOnly.({}) # empty params
|
225
|
-
result.success? #=> false
|
226
|
-
```
|
227
|
-
|
228
|
-
Note that Validate really only validates the contract, nothing is written to the model, yet. You need to push data to the model manually, e.g. with Contract::Persist.
|
229
|
-
```ruby
|
230
|
-
result = Song::ValidateOnly.({ title: "Rising Force", length: 13 })
|
231
|
-
|
232
|
-
result.success? #=> true
|
233
|
-
result["model"] #=> #<struct Song title=nil, length=nil>
|
234
|
-
result["contract.default"].title #=> "Rising Force"
|
235
|
-
```
|
236
|
-
|
237
|
-
Validate will use options["params"] as the input. You can change the nesting with the :key option.
|
238
|
-
|
239
|
-
Internally, this macro will simply call Form#validate on the Reform object.
|
240
|
-
|
241
|
-
Note: Reform comes with sophisticated deserialization semantics for nested forms, it might be worth reading a bit about Reform to fully understand what you can do in the Validate step.
|
242
|
-
|
243
|
-
##### Key
|
244
|
-
Per default, Contract::Validate will use options["params"] as the data to be validated. Use the key: option if you want to validate a nested hash from the original params structure.
|
245
|
-
```ruby
|
246
|
-
class Song::Create < Trailblazer::Operation
|
247
|
-
step Model( Song, :new )
|
248
|
-
step Contract::Build( constant: Song::Contract::Create )
|
249
|
-
step Contract::Validate( key: "song" )
|
250
|
-
step Contract::Persist( )
|
251
|
-
end
|
252
|
-
```
|
253
|
-
|
254
|
-
This automatically extracts the nested "song" hash.
|
255
|
-
```ruby
|
256
|
-
result = Song::Create.({ "song" => { title: "Rising Force", length: 13 } })
|
257
|
-
result.success? #=> true
|
258
|
-
```
|
259
|
-
|
260
|
-
If that key isn’t present in the params hash, the operation fails before the actual validation.
|
261
|
-
```ruby
|
262
|
-
result = Song::Create.({ title: "Rising Force", length: 13 })
|
263
|
-
result.success? #=> false
|
264
|
-
```
|
265
|
-
|
266
|
-
Note: String vs. symbol do matter here since the operation will simply do a hash lookup using the key you provided.
|
267
|
-
|
268
|
-
#### Persist
|
269
|
-
To push validated data from the contract to the model(s), use Persist. Like Validate, this requires a contract to be set up beforehand.
|
270
|
-
```ruby
|
271
|
-
class Song::Create < Trailblazer::Operation
|
272
|
-
step Model( Song, :new )
|
273
|
-
step Contract::Build( constant: Song::Contract::Create )
|
274
|
-
step Contract::Validate()
|
275
|
-
step Contract::Persist()
|
276
|
-
end
|
277
|
-
```
|
278
|
-
|
279
|
-
After the step, the contract’s attribute values are written to the model, and the contract will call save on the model.
|
280
|
-
```ruby
|
281
|
-
result = Song::Create.( title: "Rising Force", length: 13 )
|
282
|
-
result.success? #=> true
|
283
|
-
result["model"] #=> #<Song title="Rising Force", length=13>
|
284
|
-
```
|
285
|
-
|
286
|
-
You can also configure the Persist step to call sync instead of Reform’s save.
|
287
|
-
```ruby
|
288
|
-
step Persist( method: :sync )
|
289
|
-
```
|
290
|
-
This will only write the contract’s data to the model without calling save on it.
|
291
|
-
|
292
|
-
##### Name
|
293
|
-
Explicit naming for the contract is possible, too.
|
294
|
-
```ruby
|
295
|
-
|
296
|
-
class Song::Create < Trailblazer::Operation
|
297
|
-
step Model( Song, :new )
|
298
|
-
step Contract::Build( name: "form", constant: Song::Contract::Create )
|
299
|
-
step Contract::Validate( name: "form" )
|
300
|
-
step Contract::Persist( name: "form" )
|
301
|
-
end
|
302
|
-
```
|
303
|
-
|
304
|
-
You have to use the name: option to tell each step what contract to use. The contract and its result will now use your name instead of default.
|
305
|
-
```ruby
|
306
|
-
result = Song::Create.({ title: "A" })
|
307
|
-
result["contract.form"].errors.messages #=> {:title=>["is too short (minimum is 2 ch...
|
308
|
-
```
|
309
|
-
|
310
|
-
Use this if your operation has multiple contracts.
|
311
|
-
|
312
|
-
#### Result Object
|
313
|
-
The operation will store the validation result for every contract in its own result object.
|
314
|
-
|
315
|
-
The path is result.contract.#{name}.
|
316
|
-
```ruby
|
317
|
-
result = Create.({ length: "A" })
|
318
|
-
|
319
|
-
result["result.contract.default"].success? #=> false
|
320
|
-
result["result.contract.default"].errors #=> Errors object
|
321
|
-
result["result.contract.default"].errors.messages #=> {:length=>["is not a number"]}
|
322
|
-
```
|
323
|
-
|
324
|
-
Each result object responds to success?, failure?, and errors, which is an Errors object.
|
325
|
-
|
326
157
|
## Models
|
327
158
|
|
328
159
|
Models for persistence can be implemented using any ORM you fancy, for instance [ActiveRecord](https://github.com/rails/rails/tree/master/activerecord#active-record--object-relational-mapping-in-rails) or [Datamapper](http://datamapper.org/).
|
@@ -339,80 +170,6 @@ end
|
|
339
170
|
|
340
171
|
Only operations and views/cells can access models directly.
|
341
172
|
|
342
|
-
## Policies
|
343
|
-
|
344
|
-
You can abort running an operation using a policy. "[Pundit](https://github.com/elabs/pundit)-style" policy classes define the rules.
|
345
|
-
|
346
|
-
```ruby
|
347
|
-
class Song::Policy
|
348
|
-
def initialize(user, song)
|
349
|
-
@user, @song = user, song
|
350
|
-
end
|
351
|
-
|
352
|
-
def create?
|
353
|
-
@user.admin?
|
354
|
-
end
|
355
|
-
end
|
356
|
-
```
|
357
|
-
|
358
|
-
The rule is enabled via the `::policy` call.
|
359
|
-
|
360
|
-
```ruby
|
361
|
-
class Song::Create < Trailblazer::Operation
|
362
|
-
step Policy( Song::Policy, :create? )
|
363
|
-
end
|
364
|
-
```
|
365
|
-
|
366
|
-
The policy is evaluated in `#setup!`, raises an exception if `false` and suppresses running `#process`.
|
367
|
-
|
368
|
-
[Learn more.](http://trailblazer.to/gems/operation/policy.html)
|
369
|
-
|
370
|
-
|
371
|
-
## Views
|
372
|
-
|
373
|
-
View rendering can happen using the controller as known from Rails. This is absolutely fine for simple views.
|
374
|
-
|
375
|
-
More complex UI logic happens in _View Models_ as found in [Cells](https://github.com/apotonick/cells). View models also replace helpers.
|
376
|
-
|
377
|
-
The operation's form object can be rendered in views, too.
|
378
|
-
|
379
|
-
```ruby
|
380
|
-
class SongsController < ApplicationController
|
381
|
-
def new
|
382
|
-
form Song::Create # will assign the form object to @form.
|
383
|
-
end
|
384
|
-
end
|
385
|
-
```
|
386
|
-
|
387
|
-
Since Reform objects can be passed to form builders, you can use the operation to render and process the form!
|
388
|
-
|
389
|
-
```haml
|
390
|
-
= simple_form_for @form do |f|
|
391
|
-
= f.input :body
|
392
|
-
```
|
393
|
-
|
394
|
-
|
395
|
-
## Representers
|
396
|
-
|
397
|
-
Operations can use representers from [Roar](https://github.com/apotonick/roar) to serialize and parse JSON and XML documents for APIs.
|
398
|
-
|
399
|
-
Representers can be inferred automatically from your contract, then may be refined, e.g. with hypermedia or a format like `JSON-API`.
|
400
|
-
|
401
|
-
```ruby
|
402
|
-
class Song::Create < Trailblazer::Operation
|
403
|
-
representer do
|
404
|
-
# inherited :body
|
405
|
-
include Roar::JSON::HAL
|
406
|
-
|
407
|
-
link(:self) { song_path(represented.id) }
|
408
|
-
end
|
409
|
-
end
|
410
|
-
```
|
411
|
-
|
412
|
-
The operation can then parse incoming JSON documents in `validate` and render a document via `to_json`.
|
413
|
-
|
414
|
-
[Learn more.](http://trailblazer.to/gems/operation/2.0/representer.html)
|
415
|
-
|
416
173
|
## Tests
|
417
174
|
|
418
175
|
In Trailblazer, you only have operation unit tests and integration smoke tests to test the operation/controller wiring.
|
@@ -425,15 +182,13 @@ describe Song::Update do
|
|
425
182
|
end
|
426
183
|
```
|
427
184
|
|
428
|
-
##
|
185
|
+
## Workflows
|
429
186
|
|
430
|
-
Trailblazer
|
187
|
+
Operations are a great way to clean up controllers and models. However, Trailblazer goes further and provides an approach to model entire life-cycles of business objects, such as "a song" or "the root user".
|
431
188
|
|
432
|
-
|
433
|
-
* Inheritance and composition support
|
434
|
-
* Polymorphic views
|
189
|
+
Those workflows dramatically reduce the usage of control flow logic in your code and allow for visually designing and discussing flows.
|
435
190
|
|
436
|
-
|
191
|
+
Learn more about BPMN and workflows [on our website](https://2019.trailblazer.to/docs/workflow).
|
437
192
|
|
438
193
|
## Installation
|
439
194
|
|
data/lib/trailblazer/version.rb
CHANGED
data/trailblazer.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.description = %q{A high-level architecture introducing new abstractions such as operations and control flow, form objects and policies.}
|
11
11
|
spec.summary = %q{A high-level architecture for Ruby and Rails.}
|
12
12
|
spec.homepage = "http://trailblazer.to"
|
13
|
-
spec.license = "
|
13
|
+
spec.license = "LGPL-3.0"
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
16
16
|
f.match(%r{^(test|doc)/})
|
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = `git ls-files -z test`.split("\x0")
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "trailblazer-macro", ">= 2.1.0
|
22
|
-
spec.add_dependency "trailblazer-macro-contract", ">= 2.1.0
|
21
|
+
spec.add_dependency "trailblazer-macro", ">= 2.1.0", "< 2.2.0"
|
22
|
+
spec.add_dependency "trailblazer-macro-contract", ">= 2.1.0", "< 2.2.0"
|
23
23
|
spec.add_dependency "trailblazer-operation" # TODO: why do we need this here?
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trailblazer-macro
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.1.0
|
19
|
+
version: 2.1.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.2.0
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.1.0
|
29
|
+
version: 2.1.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.2.0
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 2.1.0
|
39
|
+
version: 2.1.0
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 2.2.0
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 2.1.0
|
49
|
+
version: 2.1.0
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 2.2.0
|
@@ -123,7 +123,7 @@ files:
|
|
123
123
|
- COMM-LICENSE
|
124
124
|
- CONTRIBUTING.md
|
125
125
|
- Gemfile
|
126
|
-
- LICENSE
|
126
|
+
- LICENSE
|
127
127
|
- README.md
|
128
128
|
- Rakefile
|
129
129
|
- THOUGHTS
|
@@ -133,7 +133,7 @@ files:
|
|
133
133
|
- trailblazer.gemspec
|
134
134
|
homepage: http://trailblazer.to
|
135
135
|
licenses:
|
136
|
-
-
|
136
|
+
- LGPL-3.0
|
137
137
|
metadata: {}
|
138
138
|
post_install_message:
|
139
139
|
rdoc_options: []
|
@@ -146,9 +146,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: 2.1.0
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
|
-
- - "
|
149
|
+
- - ">="
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
151
|
+
version: '0'
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
154
|
rubygems_version: 2.7.6
|
data/LICENSE.txt
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2018 Trailblazer GmbH
|
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.
|
22
|
-
|
23
|
-
---------
|
24
|
-
|
25
|
-
Trailblazer Enterprise has a commercial-friendly license allowing private forks
|
26
|
-
and modifications of Trailblazer. Please see http://trailblazer.to/enterprise/ for
|
27
|
-
more detail.
|