convenient_service 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/.github/contributing.md +15 -0
  3. data/.github/workflows/cd.yml +5 -4
  4. data/.github/workflows/ci.yml +5 -5
  5. data/.gitignore +10 -1
  6. data/.ruby-version +1 -1
  7. data/.tool-versions +1 -1
  8. data/.yardopts +1 -1
  9. data/CHANGELOG.md +7 -0
  10. data/COMM-LICENSE.txt +99 -0
  11. data/LICENSE.txt +7 -19
  12. data/ROADMAP.md +14 -7
  13. data/docs/.gitkeep +0 -0
  14. data/docs/api/.gitkeep +0 -0
  15. data/lib/convenient_service/examples/dry/gemfile.rb +3 -1
  16. data/lib/convenient_service/examples/dry/v1/gemfile.rb +3 -1
  17. data/lib/convenient_service/examples/rails/gemfile.rb +3 -1
  18. data/lib/convenient_service/examples/rails/v1/gemfile.rb +3 -1
  19. data/lib/convenient_service/examples/standard/cowsay.rb +3 -1
  20. data/lib/convenient_service/examples/standard/date_time.rb +3 -1
  21. data/lib/convenient_service/examples/standard/factorial.rb +3 -1
  22. data/lib/convenient_service/examples/standard/gemfile.rb +3 -1
  23. data/lib/convenient_service/examples/standard/request_params.rb +3 -1
  24. data/lib/convenient_service/feature/plugins/can_have_entries/commands/define_entry.rb +13 -1
  25. data/lib/convenient_service/feature/plugins/can_have_entries/concern.rb +1 -1
  26. data/lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb +35 -0
  27. data/lib/convenient_service/feature/plugins/can_have_entries.rb +1 -0
  28. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb +24 -0
  29. data/lib/convenient_service/version.rb +1 -1
  30. metadata +8 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86314358470fd8502e3b00853f6f0aed31fe7837fe879b8a6fe9b02b23a37055
4
- data.tar.gz: 8c7ddbfa504ef02c2774bbc4c616297345b684320ed0e4b4b10134f2a8851c24
3
+ metadata.gz: 4f1f1683a178b667d76adabe5735fa7361e7946f3a9aa7d3bcfffca62ed4d7b4
4
+ data.tar.gz: 0d64f2e78e0ef56707d8efcdcb66dafd9386a118c44d96139c699a4517cb7bcb
5
5
  SHA512:
6
- metadata.gz: 59dc4c6936c9764718dd105ef24255e89a21397b56770460850fa38365c37d0a4ba7d97bba924c72906f2ba27fc6b66b3981e9f1682a43c22f245e6daa811627
7
- data.tar.gz: bc6942d0091fe8805164bfb01b00ed09c2be71ae0ea2838d2958331844053984309600f15151cb33fe261bc76913eed1f5299898b2e95df696020ab5a92e4d9d
6
+ metadata.gz: e16ab9be69fb6721ec9fdc290c857d8da8db77bc46702aad4179f6ce04df3d73a0119befec63c13d04d0c24d15ad5d46310fd243f4d3bb214b7153dfdc1d688e
7
+ data.tar.gz: cef563d9e931f10f766e6ae5f7eb0136a96ab0c892f28a13ddf9db3860a19fcb984a7e514f6b6430750df8287ec9da4df0f4d75ea7a7e620321a72569b08c29e
@@ -0,0 +1,15 @@
1
+ # Contributing
2
+
3
+ ## Legal
4
+
5
+ By submitting a Pull Request, you disavow any rights or claims to any changes
6
+ submitted to the Convenient Service project and assign the copyright of
7
+ those changes to Convenient Service Organization.
8
+
9
+ If you cannot or do not want to reassign those rights (your employment
10
+ contract for your employer may not allow this), you should not submit a PR.
11
+ Open an issue and someone else can do the work.
12
+
13
+ This is a legal way of saying "If you submit a PR to us, that code becomes ours".
14
+ 99.9% of the time that's what you intend anyways; we hope it doesn't scare you
15
+ away from contributing.
@@ -30,7 +30,7 @@ jobs:
30
30
  - name: Set up Ruby
31
31
  uses: ruby/setup-ruby@v1
32
32
  with:
33
- ruby-version: 3.1
33
+ ruby-version: 3.2
34
34
  ##
35
35
  # NOTE: Installs the latest compatible Bundler version, runs `bundle install` and caches installed gems.
36
36
  # - https://github.com/ruby/setup-ruby#usage
@@ -39,8 +39,8 @@ jobs:
39
39
  bundler-cache: true
40
40
  ##
41
41
  # NOTE: Installs Task (task runner).
42
- # https://taskfile.dev/installation/#github-actions
43
- # https://github.com/go-task/task
42
+ # - https://taskfile.dev/installation/#github-actions
43
+ # - https://github.com/go-task/task
44
44
  #
45
45
  - name: Install Task (task runner)
46
46
  uses: arduino/setup-task@v1
@@ -51,7 +51,8 @@ jobs:
51
51
  uses: peaceiris/actions-gh-pages@v3
52
52
  with:
53
53
  github_token: ${{ secrets.GITHUB_TOKEN }}
54
- publish_dir: ./docs
54
+ publish_dir: ./docs/api
55
+ cname: apidocs.convenientservice.org
55
56
 
56
57
  create_github_release:
57
58
  runs-on: ubuntu-20.04
@@ -139,8 +139,8 @@ jobs:
139
139
  bundler-cache: true
140
140
  ##
141
141
  # NOTE: Installs Task (task runner).
142
- # https://taskfile.dev/installation/#github-actions
143
- # https://github.com/go-task/task
142
+ # - https://taskfile.dev/installation/#github-actions
143
+ # - https://github.com/go-task/task
144
144
  #
145
145
  - name: Install Task (task runner)
146
146
  uses: arduino/setup-task@v1
@@ -169,10 +169,10 @@ jobs:
169
169
  node-version: 16.x
170
170
  ##
171
171
  # NOTE: `lcov-result-merger` docs.
172
- # https://github.com/mweibel/lcov-result-merger
172
+ # - https://github.com/mweibel/lcov-result-merger
173
173
  #
174
174
  # NOTE: `npx --yes` option.
175
- # https://stackoverflow.com/questions/70742968/automatically-accept-installing-npx-package
175
+ # - https://stackoverflow.com/questions/70742968/automatically-accept-installing-npx-package
176
176
  #
177
177
  # NOTE: `lcov-result-merger` uses `vinyl-fs` for globs which in turn uses `node-glob`.
178
178
  # - https://github.com/mweibel/lcov-result-merger/blob/v3.3.0/bin/lcov-result-merger.js#L38
@@ -200,7 +200,7 @@ jobs:
200
200
  # NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
201
201
  # In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
202
202
  # That is why the well-known Ubuntu is used.
203
- # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
203
+ # - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
204
204
  #
205
205
  runs-on: ubuntu-20.04
206
206
  name: Gather coverage
data/.gitignore CHANGED
@@ -42,8 +42,17 @@
42
42
  #
43
43
  .DS_Store
44
44
 
45
- # Ignore docs
45
+ ##
46
+ # NOTE: Ignores `docs` content, but NOT the folder.
47
+ #
46
48
  /docs/*
49
+ !/docs/.gitkeep
50
+
51
+ ##
52
+ # NOTE: Ignores `docs/api` content, but NOT the folder.
53
+ #
54
+ /docs/api/*
55
+ !/docs/api/.gitkeep
47
56
 
48
57
  ##
49
58
  # NOTE: Ignores `flowchart.html`, that can be generated by `Service.mermaid_flowchart.save`.
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.2.0
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.1.0
1
+ ruby 3.2.0
data/.yardopts CHANGED
@@ -9,7 +9,7 @@
9
9
  #
10
10
  --markup markdown
11
11
  --markup-provider commonmarker
12
- --output-dir docs
12
+ --output-dir docs/api
13
13
  --tag internal --hide-tag internal
14
14
  --plugin convenient_service_concern
15
15
  'lib/**/*.rb' -
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.16.0](https://github.com/marian13/convenient_service/compare/v0.15.0...v0.16.0) (2023-12-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * **entry:** allow to use instance method, just like field in graphql-ruby ([ad445fa](https://github.com/marian13/convenient_service/commit/ad445fae5ace9671745b2cacd2f6fae7b5a0e26e))
9
+
3
10
  ## [0.15.0](https://github.com/marian13/convenient_service/compare/v0.14.0...v0.15.0) (2023-11-10)
4
11
 
5
12
 
data/COMM-LICENSE.txt ADDED
@@ -0,0 +1,99 @@
1
+ END-USER LICENSE AGREEMENT
2
+
3
+ ------------------------------------------------------------------------------
4
+
5
+ IMPORTANT: THIS SOFTWARE END-USER LICENSE AGREEMENT ("EULA") IS A LEGAL AGREEMENT (“Agreement”) BETWEEN YOU (THE CUSTOMER, EITHER AS AN INDIVIDUAL OR, IF PURCHASED OR OTHERWISE ACQUIRED BY OR FOR AN ENTITY, AS AN ENTITY) AND CONVENIENT SERVICE ORGANIZATION. READ IT CAREFULLY BEFORE COMPLETING THE INSTALLATION PROCESS AND USING CONVENIENT SERVICE PRO AND RELATED SOFTWARE COMPONENTS (“SOFTWARE”). IT PROVIDES A LICENSE TO USE THE SOFTWARE AND CONTAINS WARRANTY INFORMATION AND LIABILITY DISCLAIMERS. BY INSTALLING AND USING THE SOFTWARE, YOU ARE CONFIRMING YOUR ACCEPTANCE OF THE SOFTWARE AND AGREEING TO BECOME BOUND BY THE TERMS OF THIS AGREEMENT.
6
+
7
+ ------------------------------------------------------------------------------
8
+
9
+ In order to use the Software under this Agreement, you 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
+
11
+
12
+ 1. License Grant.
13
+
14
+ 1.1 General Use. This Agreement grants you a non-exclusive, non-transferable, limited license to the use rights for the Software, without the right to grant sublicenses, subject to the terms and conditions in this Agreement. The Software is licensed, not sold.
15
+
16
+ 1.2 Unlimited Organization License. If you purchased an Organization License (included with the Convenient Service Pro Software), you may install the Software on an unlimited number of Hosts. “Host” means any physical or virtual machine which is controlled by you. You may concurrently run the software on an unlimited number of Hosts.
17
+
18
+ 1.3 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.
19
+
20
+ 1.4 Electronic Delivery. All Software and license documentation shall be delivered by electronic means unless otherwise specified on the applicable invoice or at the time of purchase. Software shall be deemed delivered when it is made available for download by you (“Delivery”).
21
+
22
+
23
+ 2. Modifications. Convenient Service Organization shall provide you with source code so that you can create Modifications of the original 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.
24
+
25
+
26
+ 3. Restricted Uses.
27
+
28
+ 3.1 You 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 your 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 a product, "appliance" or "virtual server"; (e) redistribute the Software on any server which is not directly under your 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 4), or incorporate the Software, except to the extent expressly authorized in writing by Convenient Service Organization; (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 Convenient Service Organization 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 Convenient Service Organization; (j) use the Software to develop a product which is competitive with any Convenient Service Organization product offerings; 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 Convenient Service Organization in writing. If your unique Source URL is ever published, Convenient Service Organization reserves the right to terminate your access without notice.
29
+
30
+ 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.
31
+
32
+ The Open Source version of the Software (“LGPL Version”) is licensed
33
+ under the terms of the GNU Lesser General Public License version 3.0
34
+ (“LGPL”) and not under this EULA.
35
+
36
+
37
+ 4. Ownership. Notwithstanding anything to the contrary contained herein, except for the limited license rights expressly provided herein, Convenient Service Organization 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.
38
+
39
+
40
+ 5. Fees and Payment. The Software license fees will be due and payable in full as set forth in the applicable invoice or at the time of purchase. If the Software does not function properly within two weeks of purchase, please contact us within those two weeks for a refund. You shall be responsible for all taxes, withholdings, duties and levies arising from the order (excluding taxes based on the net income of Convenient Service Organization).
41
+
42
+
43
+ 6. Support, Maintenance and Services. Subject to the terms and conditions of this Agreement, as set forth in your invoice, and as set forth on the Convenient Service Pro support page, support and maintenance services may be included with the purchase of your license subscription.
44
+
45
+
46
+ 7. Term of Agreement.
47
+
48
+ 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 your license under this Agreement may be perpetual, limited for Evaluation Version, or designated as a fixed-term license in the Invoice, and shall be specified at your 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 Convenient Service Organization may terminate this Agreement immediately upon any breach of Section 3 or if you exceed 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.
49
+
50
+ 7.2 Termination. Upon any termination of this Agreement, you shall cease any and all use of any Software and destroy all copies thereof.
51
+
52
+ 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 Convenient Service Organization.
53
+
54
+
55
+ 8. Disclaimer of Warranties. The Software is provided "as is," with all faults, defects and errors, and without warranty of any kind. Convenient Service Organization does not warrant that the Software will be free of bugs, errors, viruses or other defects, and Convenient Service Organization 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 Convenient Service Organization to do so.
56
+ To the maximum extent permitted by applicable law, Convenient Service Organization 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.
57
+
58
+
59
+ 9. Limitation of Liability.
60
+
61
+ In no event will Convenient Service Organization 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 Convenient Service Organization has been advised of the possibility of such damages.
62
+
63
+ In no event will Convenient Service Organization' 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.
64
+
65
+
66
+ 10. Remedies. Your exclusive remedy and Convenient Service Organization' entire liability for breach of this Agreement shall be limited, at Convenient Service Organization' sole and exclusive discretion, to (a) replacement of any defective software or documentation; or (b) refund of the license fee paid to Convenient Service Organization, payable in accordance with Convenient Service Organization' refund policy.
67
+
68
+
69
+ 11. Acknowledgements.
70
+
71
+ 11.1 Consent to the Use of Data. You agree that Convenient Service Organization and its affiliates may collect and use technical information gathered as part of the product support services. Convenient Service Organization may use this information solely to improve products and services and will not disclose this information in a form that personally identifies you.
72
+
73
+ 11.2 Verification. We or a certified auditor acting on our behalf, may, upon its reasonable request and at its expense, audit you with respect to the use of the Software. Such audit may be conducted by mail, electronic means or through an in-person visit to your place of business. Any such in-person audit shall be conducted during regular business hours at your facilities and shall not unreasonably interfere with your business activities. We shall not remove, copy, or redistribute any electronic material during the course of an audit. If an audit reveals that you are using the Software in a way that is in material violation of the terms of the EULA, then you shall pay our reasonable costs of conducting the audit. In the case of a material violation, you agree to pay Us any amounts owing that are attributable to the unauthorized use. In the alternative, We reserve the right, at our sole option, to terminate the licenses for the Software.
74
+
75
+
76
+ 12. Third Party Software. Examples included in Software may provide links to third party libraries or code (collectively “Third Party Software”) to implement various functions. Third Party Software does not comprise part of the Software. In some cases, access to Third Party Software may be included along with the Software delivery as a convenience for demonstration purposes. Such source code and libraries may be included in the “…/examples” source tree delivered with the Software and do not comprise the Software. Licensee acknowledges (1) that some part of Third Party Software may require additional licensing of copyright and patents from the owners of such, and (2) that distribution of any of the Software referencing or including any portion of a Third Party Software may require appropriate licensing from such third parties.
77
+
78
+
79
+ 13. Miscellaneous
80
+
81
+ 13.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.
82
+
83
+ 13.2 Amendment. Convenient Service Organization reserves the right, in its sole discretion, to amend this Agreement from time. Amendments to this Agreement can be located at: https://github.com/marian13/convenient_service/blob/main/COMM-LICENSE.txt.
84
+
85
+ 13.3 Assignment. You may not assign this Agreement or any of its rights under this Agreement without the prior written consent of Convenient Service Organization and any attempted assignment without such consent shall be void.
86
+
87
+ 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.
88
+
89
+ 13.5 Indemnification. You agree to defend, indemnify, and hold harmless Convenient Service Organization 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.
90
+
91
+ 13.6 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.
92
+
93
+ 13.7 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.
94
+
95
+ 13.8 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.
96
+
97
+ 13.9 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.
98
+
99
+ 14. Contact Information. If you have any questions about this EULA, or if you want to contact Convenient Service Organization for any reason, please direct correspondence to info@convenientservice.org.
data/LICENSE.txt CHANGED
@@ -1,21 +1,9 @@
1
- The MIT License (MIT)
1
+ Copyright (c) Convenient Service Organization
2
2
 
3
- Copyright (c) 2022-2023 Marian Kostyk
3
+ Convenient Service 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.
4
6
 
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.
7
+ Convenient Service Pro has a commercial-friendly license.
8
+ You can find the commercial license in COMM-LICENSE.txt.
9
+ Please see https://convenientservice.org for purchasing options.
data/ROADMAP.md CHANGED
@@ -10,13 +10,13 @@
10
10
  | Medium | 🚧 | [Rails Current Attributes integration](https://api.rubyonrails.org/classes/ActiveSupport/CurrentAttributes.html) to cache repeated results | |
11
11
  | Low | 🚧 | [Capybara](https://github.com/teamcapybara/capybara) examples | |
12
12
  | Medium | 🚧 | Inline step sequence | |
13
- | High | 🚧 | Move callbacks to internals | |
13
+ | High | 🚧 | Move callbacks to internals | In order to NOT pollute the public interface of users services |
14
14
  | Low | 🚧 | Create an example of `id_or_record` [attribute](https://api.rubyonrails.org/classes/ActiveRecord/Attributes/ClassMethods.html) |
15
15
  | Low | 🚧 | GitHub Wiki/Gists for Support | |
16
16
  | Low | 🚧 | Contribute to Shoulda Matchers | |
17
17
  | High | ✅ | `respond_to_missing?` | [ConvenientService::Core::ClassMethods#respond_to_missing?](https://github.com/marian13/convenient_service/blob/main/lib/convenient_service/core/class_methods.rb#L105), [ConvenientService::Core::InstanceMethods#respond_to_missing?](https://github.com/marian13/convenient_service/blob/main/lib/convenient_service/core/instance_methods.rb#L30) |
18
18
  | High | ⏳ | Custom matcher to track `ConvenientService::Logger` messages | |
19
- | Medium | 🚧 | Remove `respond_to?` from `Copyable` | Investigate before making any decision |
19
+ | Medium | | Remove `respond_to?` from `Copyable` | [7d2a676c171d201301f1c35d498c3b1caf8579b1](https://github.com/marian13/convenient_service/commit/7d2a676c171d201301f1c35d498c3b1caf8579b1) |
20
20
  | High | 🚧 | Unified `inspect` | Remove `internals` from inspect, ivars wrapperd by double underscore |
21
21
  | High | ✅ | Remove race condition for `method_missing` | https://github.com/marian13/convenient_service/pull/5 |
22
22
  | High | ✅ | Remove incompatiility of [Module#include](https://gist.github.com/marian13/9c25041f835564e945d978839097d419) | https://github.com/marian13/convenient_service/pull/3 |
@@ -27,12 +27,12 @@
27
27
  | Medium | ✅ | A way to check if block has one required positional argument | [#proc_has_one_positional_argument?](https://github.com/marian13/convenient_service/blob/main/lib/convenient_service/utils/proc/exec_config.rb#L96) |
28
28
  | Low | 🚧 | Define method middleware caller with visibility | |
29
29
  | Low | 🚧 | Dependency containers to remove high coupling | |
30
- | Low | 🚧 | Measure performance | |
31
- | Low | 🚧 | Rewrite middleware backend to count [convenient_service](https://github.com/marian13/convenient_service) specifics | |
30
+ | Low | 🚧 | Measure performance | See [benchmark](https://github.com/marian13/convenient_service/tree/main/benchmark) |
31
+ | Low | 🚧 | Write [Convenient Service](https://github.com/marian13/convenient_service) specific middleware backend | |
32
32
  | High | 🚧 | Optimize `stack.dup` in `MethodMiddlewares#call` | Core v3 |
33
33
  | Medium | 🚧 | Make a decision of what to do with `printable_block` in custom RSpec matchers | |
34
34
  | Medium | 🚧 | User-friendly exception messages | |
35
- | High | 🚧 | Factory for POROs in specs ❗❗❗ | Start with `result_class`, `class self::Result`, `service_class`, `step_class`, `organizer_class` |
35
+ | High | | Factory for POROs in specs ❗❗❗ | Proxy config antipattern |
36
36
  | High | 🚧 | Resolve warning during specs | |
37
37
  | Medium | 🚧 | Consider to change/rewrite `delegate` backend to minify its interface | |
38
38
  | Medium | 🚧 | Same order of attr macros, delegators, initialize, class methods, attr methods, queries, actions, `to_*`, comparison, inspect | |
@@ -78,8 +78,15 @@
78
78
  | High | 🚧 | Add specs for `WrappedMethod#call` | |
79
79
  | High | 🚧 | Check whether ignoring the error was used properly | |
80
80
  | High | 🚧 | Steps are great for `and` logic, but what to do with `or` logic? | Create the third service | |
81
- | High | 🚧 | Steps are great for `and` logic, but what to do with `case when` logic? | Create the third service | |
81
+ | High | 🚧 | Steps are great for `and` logic, but what to do with `case when` logic? | Create the third service | |
82
82
  | High | 🚧 | Cacing of services | It is relatively simple to add caching for steps, but not for all services, since steps are managed by framework | |
83
83
  | High | 🚧 | Fallback should return result with already checked status | |
84
+ | Medium | 🚧 | Licence: Commercial Support docs | See [Sidekiq Commercial Support](https://github.com/sidekiq/sidekiq/wiki/Commercial-Support) |
85
+ | Meduim | 🚧 | Licence: Acknowledgements - Government End Users | See [GraphQL Ruby Commercial Licence](https://graphql.pro/COMM-LICENSE.html) |
86
+ | Medium | 🚧 | Licence: Applicable Law and Jurisdiction (Miscellaneous - Governing Law) | See [Kiba Applicable Law and Jurisdiction](https://github.com/thbar/kiba/blob/master/COMM-LICENSE.md) |
87
+ | Medium | 🚧 | Licence: Contact email `info@convenientservice.org` | |
88
+ | Medium | 🚧 | Contributing Guide | See [Sidekiq Contributing](https://github.com/sidekiq/sidekiq/blob/main/.github/contributing.md) |
89
+ | High | 🚧 | `comparing_by` for `delegate_to` | |
90
+ | High | 🚧 | Remove extra files from bundled gem version | |
84
91
 
85
- Search for `TODO`s in the codebase for more tasks.
92
+ Search for `TODO`s in the codebase or check [discussions](https://github.com/marian13/convenient_service/discussions) for more tasks.
data/docs/.gitkeep ADDED
File without changes
data/docs/api/.gitkeep ADDED
File without changes
@@ -16,7 +16,9 @@ module ConvenientService
16
16
  class Gemfile
17
17
  include ConvenientService::Feature::Standard::Config
18
18
 
19
- entry :format do |path|
19
+ entry :format
20
+
21
+ def format(path)
20
22
  Services::Format[path: path]
21
23
  end
22
24
  end
@@ -17,7 +17,9 @@ module ConvenientService
17
17
  class Gemfile
18
18
  include ConvenientService::Feature::Standard::Config
19
19
 
20
- entry :format do |path|
20
+ entry :format
21
+
22
+ def format(path)
21
23
  Services::Format[path: path]
22
24
  end
23
25
  end
@@ -16,7 +16,9 @@ module ConvenientService
16
16
  class Gemfile
17
17
  include ConvenientService::Feature::Standard::Config
18
18
 
19
- entry :format do |path|
19
+ entry :format
20
+
21
+ def format(path)
20
22
  Services::Format[path: path]
21
23
  end
22
24
  end
@@ -17,7 +17,9 @@ module ConvenientService
17
17
  class Gemfile
18
18
  include ConvenientService::Feature::Standard::Config
19
19
 
20
- entry :format do |path|
20
+ entry :format
21
+
22
+ def format(path)
21
23
  Services::Format[path: path]
22
24
  end
23
25
  end
@@ -15,7 +15,9 @@ module ConvenientService
15
15
  class Cowsay
16
16
  include ConvenientService::Feature::Standard::Config
17
17
 
18
- entry :print do |text = "Hello World!", out: $stdout|
18
+ entry :print
19
+
20
+ def print(text = "Hello World!", out: $stdout)
19
21
  Services::Print[text: text, out: out]
20
22
  end
21
23
  end
@@ -14,7 +14,9 @@ module ConvenientService
14
14
  class DateTime
15
15
  include ConvenientService::Feature::Standard::Config
16
16
 
17
- entry :safe_parse do |string, format|
17
+ entry :safe_parse
18
+
19
+ def safe_parse(string, format)
18
20
  Services::SafeParse[string: string, format: format]
19
21
  end
20
22
  end
@@ -15,7 +15,9 @@ module ConvenientService
15
15
  class Factorial
16
16
  include ConvenientService::Feature::Standard::Config
17
17
 
18
- entry :calculate do |number|
18
+ entry :calculate
19
+
20
+ def calculate(number)
19
21
  Services::Calculate[number: number]
20
22
  end
21
23
  end
@@ -15,7 +15,9 @@ module ConvenientService
15
15
  class Gemfile
16
16
  include ConvenientService::Feature::Standard::Config
17
17
 
18
- entry :format do |path|
18
+ entry :format
19
+
20
+ def format(path)
19
21
  Services::Format[path: path]
20
22
  end
21
23
  end
@@ -39,7 +39,9 @@ module ConvenientService
39
39
  class RequestParams
40
40
  include ConvenientService::Feature::Standard::Config
41
41
 
42
- entry :prepare do |request|
42
+ entry :prepare
43
+
44
+ def prepare(request)
43
45
  Services::Prepare[request: request]
44
46
  end
45
47
  end
@@ -39,7 +39,19 @@ module ConvenientService
39
39
  # @return [String, Symbol]
40
40
  #
41
41
  def call
42
- feature_class.define_singleton_method(name, &body)
42
+ ##
43
+ # NOTE: Just `feature_class.define_singleton_method` does NOT create a closure for `name`.
44
+ # That is why `feature_class.class_exec` wrapper is required.
45
+ #
46
+ feature_class.class_exec(name) do |name|
47
+ define_singleton_method(name) { |*args, **kwargs, &block| new.public_send(name, *args, **kwargs, &block) }
48
+ end
49
+
50
+ if body
51
+ feature_class.define_method(name, &body)
52
+ else
53
+ feature_class.define_method(name) { raise ::ConvenientService::Feature::Plugins::CanHaveEntries::Exceptions::NotDefinedEntryMethod.new(name: __method__, feature: self) }
54
+ end
43
55
 
44
56
  name
45
57
  end
@@ -10,7 +10,7 @@ module ConvenientService
10
10
  class_methods do
11
11
  ##
12
12
  # @param name [String, Symbol]
13
- # @param body [Proc]
13
+ # @param body [Proc, nil]
14
14
  # @return [String, Symbol]
15
15
  #
16
16
  def entry(name, &body)
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Feature
5
+ module Plugins
6
+ module CanHaveEntries
7
+ module Exceptions
8
+ class NotDefinedEntryMethod < ::ConvenientService::Exception
9
+ def initialize(name:, feature:)
10
+ message = <<~TEXT
11
+ Entry for `#{name}` is registered inside `#{feature.class}` feature, but its corresponding method is NOT defined.
12
+
13
+ Did you forget to define it? For example:
14
+
15
+ class #{feature.class}
16
+ entry :#{name}
17
+
18
+ # ...
19
+
20
+ def #{name}
21
+ # ...
22
+ end
23
+
24
+ # ...
25
+ end
26
+ TEXT
27
+
28
+ super(message)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -2,3 +2,4 @@
2
2
 
3
3
  require_relative "can_have_entries/commands"
4
4
  require_relative "can_have_entries/concern"
5
+ require_relative "can_have_entries/exceptions"
@@ -69,6 +69,30 @@ module ConvenientService
69
69
  # @see https://rspec.info/documentation/3.12/rspec-mocks/RSpec/Mocks/ArgumentMatchers.html
70
70
  # @see https://github.com/rspec/rspec-mocks/blob/v3.12.3/lib/rspec/mocks/argument_matchers.rb#L282
71
71
  #
72
+ # @example Just code does NOT work in case/when.
73
+ #
74
+ # case result.code # `result.code` returns fancy object
75
+ # when :full_queue
76
+ # notify_devops
77
+ # when :duplicated_job
78
+ # notify_devs
79
+ # else
80
+ # # ...
81
+ # end
82
+ #
83
+ # @example Code converted to symbol works in case/when.
84
+ #
85
+ # case result.code.to_sym
86
+ # when :full_queue
87
+ # notify_devops
88
+ # when :duplicated_job
89
+ # notify_devs
90
+ # else
91
+ # # ...
92
+ # end
93
+ #
94
+ # @see https://userdocs.convenientservice.org/faq#why-casewhen-does-not-work-with-just-result-codes
95
+ #
72
96
  # @internal
73
97
  # IMPORTANT: Must be kept in sync with `#==`.
74
98
  # NOTE: Ruby does NOT have `!==` operator.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConvenientService
4
- VERSION = "0.15.0"
4
+ VERSION = "0.16.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convenient_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marian Kostyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-20 00:00:00.000000000 Z
11
+ date: 2023-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -570,6 +570,7 @@ files:
570
570
  - ".dev/.tmuxinator.yml"
571
571
  - ".dockerignore"
572
572
  - ".gem_release.yml"
573
+ - ".github/contributing.md"
573
574
  - ".github/issue_template.md"
574
575
  - ".github/pull_request_template.md"
575
576
  - ".github/workflows/cd.yml"
@@ -589,6 +590,7 @@ files:
589
590
  - ".yardopts"
590
591
  - Appraisals
591
592
  - CHANGELOG.md
593
+ - COMM-LICENSE.txt
592
594
  - Gemfile
593
595
  - LICENSE.txt
594
596
  - README.md
@@ -608,6 +610,8 @@ files:
608
610
  - docker/3.2/Dockerfile
609
611
  - docker/jruby-9.4/Dockerfile
610
612
  - docker/truffleruby-22.3/Dockerfile
613
+ - docs/.gitkeep
614
+ - docs/api/.gitkeep
611
615
  - env.rb
612
616
  - gemfiles/.gitkeep
613
617
  - lib/convenient_service.rb
@@ -982,6 +986,7 @@ files:
982
986
  - lib/convenient_service/feature/plugins/can_have_entries/commands.rb
983
987
  - lib/convenient_service/feature/plugins/can_have_entries/commands/define_entry.rb
984
988
  - lib/convenient_service/feature/plugins/can_have_entries/concern.rb
989
+ - lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb
985
990
  - lib/convenient_service/logger.rb
986
991
  - lib/convenient_service/rspec.rb
987
992
  - lib/convenient_service/rspec/helpers.rb
@@ -1540,7 +1545,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1540
1545
  - !ruby/object:Gem::Version
1541
1546
  version: '0'
1542
1547
  requirements: []
1543
- rubygems_version: 3.3.3
1548
+ rubygems_version: 3.4.1
1544
1549
  signing_key:
1545
1550
  specification_version: 4
1546
1551
  summary: Service object pattern implementation in Ruby.