polidef 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3b3dbfbbb15b1f7359e911f4a4474a7078e0d16dca163ba16c561f0714c8b74e
4
+ data.tar.gz: 826f24903a0d1195e57e2b790c1f80155be59153c8e64691f0d76098bac156af
5
+ SHA512:
6
+ metadata.gz: 77f6df7b46eb951844778e8ab8caca4124002fa4af83add1d2671aeeff269c2420636d1ab28d8ecdc871f497d7399fcad61e084ed182f23bee4aae3994688ba5
7
+ data.tar.gz: b1dfeae924d565447d9118067ad906a44330653926c1187364261a5763f1cc8830c5a1ba8d1fe9aab05c4269137fd2d6376dd5506801a758a65f3d529f4f024d
data/.standard.yml ADDED
@@ -0,0 +1 @@
1
+ format: progress
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # [0.1.0] - Update on initial release
2
+
3
+ ## Added
4
+
5
+ ## Fixed
6
+
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at jd_gonzales@icloud.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in polidef.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
11
+
12
+ gem "standard", "~> 1.3"
data/Gemfile.lock ADDED
@@ -0,0 +1,64 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ polidef (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ json (2.7.1)
11
+ language_server-protocol (3.17.0.3)
12
+ lint_roller (1.1.0)
13
+ minitest (5.22.2)
14
+ parallel (1.24.0)
15
+ parser (3.3.0.5)
16
+ ast (~> 2.4.1)
17
+ racc
18
+ racc (1.7.3)
19
+ rainbow (3.1.1)
20
+ rake (13.1.0)
21
+ regexp_parser (2.9.0)
22
+ rexml (3.2.6)
23
+ rubocop (1.60.2)
24
+ json (~> 2.3)
25
+ language_server-protocol (>= 3.17.0)
26
+ parallel (~> 1.10)
27
+ parser (>= 3.3.0.2)
28
+ rainbow (>= 2.2.2, < 4.0)
29
+ regexp_parser (>= 1.8, < 3.0)
30
+ rexml (>= 3.2.5, < 4.0)
31
+ rubocop-ast (>= 1.30.0, < 2.0)
32
+ ruby-progressbar (~> 1.7)
33
+ unicode-display_width (>= 2.4.0, < 3.0)
34
+ rubocop-ast (1.30.0)
35
+ parser (>= 3.2.1.0)
36
+ rubocop-performance (1.20.2)
37
+ rubocop (>= 1.48.1, < 2.0)
38
+ rubocop-ast (>= 1.30.0, < 2.0)
39
+ ruby-progressbar (1.13.0)
40
+ standard (1.34.0)
41
+ language_server-protocol (~> 3.17.0.2)
42
+ lint_roller (~> 1.0)
43
+ rubocop (~> 1.60)
44
+ standard-custom (~> 1.0.0)
45
+ standard-performance (~> 1.3)
46
+ standard-custom (1.0.2)
47
+ lint_roller (~> 1.0)
48
+ rubocop (~> 1.50)
49
+ standard-performance (1.3.1)
50
+ lint_roller (~> 1.1)
51
+ rubocop-performance (~> 1.20.2)
52
+ unicode-display_width (2.5.0)
53
+
54
+ PLATFORMS
55
+ arm64-darwin-22
56
+
57
+ DEPENDENCIES
58
+ minitest (~> 5.0)
59
+ polidef!
60
+ rake (~> 13.0)
61
+ standard (~> 1.3)
62
+
63
+ BUNDLED WITH
64
+ 2.3.5
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Jonathan Gonzales
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # Polidef
2
+
3
+ **Still a WIP v1.0.0 is planned for early March 2024**
4
+
5
+ Polidef allows you to create easily testable policy objects that can be very generic for use in multiple objects or be very very specific all while avoiding heavy scaffolding in code.
6
+
7
+ ## Who is this for?
8
+ This gem isn't recommended for newer applications that are still working through determining their domain as something like this can end up complicating features more so than it can help. The target audience is for those who have inherited a more mature codebase where the code design is not always ideal. The abstraction here can help provide you with ways of naming important "conditional based" concepts in your domain, especially those that tend to grow with more and more `&&`s or `||`s.
9
+
10
+ The techniques here are certainly implementable with POROs (Plain Old Ruby Objects) but the convinence of these abstractions, especially for testing maybe useful.
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'polidef'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ $ bundle install
23
+
24
+ Or install it yourself as:
25
+
26
+ $ gem install polidef
27
+
28
+ ## Usage
29
+ **As of Feb 2024, this project is still a WIP. I've tried to notate available API's as they are on the `main` branch but it may not always be accurate.**
30
+
31
+ ### Simple Policies
32
+ The simpilest way to implement a `Polidef::Policy` is to create a class which implements a `#policy` method that evaluates to the _truthy_ version of your logic. Think along the lines of:
33
+
34
+ > "ThisObject can_do_this if Policy is fulfilled"
35
+
36
+ **Policy Object**
37
+
38
+ ``` ruby
39
+ class NotificationPolicy < Polidef::Policy
40
+ dependencies :user, :subject, :channel
41
+
42
+ def policy
43
+ policy_chain([:user_can_recieve?, :channel_usable?])
44
+ .or_policy(:subject_overrides_preferences?)
45
+ end
46
+
47
+ private
48
+
49
+ def user_can_recieve?
50
+ user.prefences.notifications_enabled? && !user.notifications_muted?
51
+ end
52
+
53
+ def channel_usable?
54
+ channel.state == 'active'
55
+ end
56
+
57
+ def subject_overrides_preferences?
58
+ subject.overrides_notification_policy?
59
+ end
60
+ end
61
+ ```
62
+
63
+ We can then use `NotificationPolicy` where ever we need to in a few different ways:
64
+
65
+ ``` ruby
66
+ # ...
67
+ include Polidef::Policies
68
+ ## a block
69
+ def send_notification_to(recipient, notifier: NotificationService)
70
+ with_fulfilled_policy(:notification_policy, dependencies: {user: recipient, subject: self, channel: channel}) do
71
+ notifier.send_notification_to(recipient, subject: subject)
72
+ end
73
+ end
74
+
75
+ ## a method
76
+ def send_notification_to(recipient, notifier: NotificationService)
77
+ if policy_fulfilled?(:notification_policy, user: recipient, subject: self, channel: channel)
78
+ notifier.send_notification_to(recipient, subject: subject)
79
+ else # policy implicitely rejected
80
+ notifier.perform_later(current_user.time_till_unmute, user_id: current_user.id subject_id: subject.id, channel_id: channel.id)
81
+ end
82
+ end
83
+ ```
84
+
85
+ Testing the `NotificationPolicy` is simple with the provided assertions. Since we want to know if the `#send_notification` works and don't care about the specifics of the `NotificationPolicy` and/or we don't want to have to mock/stub (or worse, persist) each dependency for the test we can instead, use `asserts_with_policy`.
86
+
87
+ ``` ruby
88
+ # ...
89
+ include Polidef::PolicyAssertions
90
+
91
+ # ...
92
+
93
+ def test_send_notification_for
94
+ message = build(:message_in_default_channel, content: "Test")
95
+
96
+ mock_notification_service = Minitest::Mock.new
97
+ mock_notification_service.expects(:send_notification_to, nil, [User], subject: message)
98
+
99
+ # Forces Policy fulfilled
100
+ assert_with_fulfilled_policy :notification_policy do
101
+ message.send_notification_to(@user, notifier: mock_notification_service)
102
+ end
103
+
104
+ assert_mock mock_notification_service
105
+ end
106
+
107
+ def test_send_notification_for
108
+ message = build(:message_in_default_channel, content: "Test")
109
+
110
+ mock_notification_service = Minitest::Mock.new
111
+ mock_notification_service.expects(:perform_later, 'job-id-123', [Time], Hash)
112
+
113
+ # Forces Policy rejected
114
+ assert_with_rejected_policy :notification_policy do
115
+ message.send_notification_to(@user, notifier: mock_notification_service)
116
+ end
117
+
118
+ assert_mock mock_notification_service
119
+ end
120
+ ```
121
+
122
+ ## Plans & Todos
123
+ ### Planned features
124
+ - Support for inline Policy declarations (50% complete)
125
+ - Support for `policy_rejected` inverse of fulfilled methods
126
+ - Support for decorators using `SimpleDelegator` for very generic policies
127
+ - Useful testing API to test individual Policies
128
+ - Support for `rails generate policy --deps dep_1, dep_2 ...`
129
+ - "Conditional chaining" API for readability
130
+
131
+ ### Planned Housekeeping
132
+ - More thorough examples
133
+ - Integrate a documentation framework (RDoc and Yard maybe?)
134
+ - A small static site
135
+ - Issue & PR templates
136
+
137
+ ## Development
138
+
139
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
140
+
141
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
142
+
143
+ ## Contributing
144
+
145
+ Bug reports and pull requests are welcome on GitHub at https://github.com/juliusdelta/polidef. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/juliusdelta/polidef/blob/master/CODE_OF_CONDUCT.md).
146
+
147
+ ## License
148
+
149
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
150
+
151
+ ## Code of Conduct
152
+
153
+ Everyone interacting in the Polidef project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/juliusdelta/polidef/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
+ end
11
+
12
+ require "standard/rake"
13
+
14
+ task default: %i[test standard]
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Polidef
4
+ module Policies
5
+ def with_fulfilled_policy(policy, dependencies:)
6
+ policy_class = Policy.inline_policies.find { |p| p[:name] == policy }
7
+ policy_class ||= Object.const_get(policy.to_sym.to_s.split("_").map(&:capitalize).join("")).new
8
+ policy_class._assign_attrs(dependencies)
9
+
10
+ result = policy_class._policy_try
11
+
12
+ yield if result
13
+ end
14
+
15
+ def policy_fulfilled?(policy, dependencies:)
16
+ policy_class = Object.const_get(policy.to_sym.to_s.split("_").map(&:capitalize).join("")).new
17
+ policy_class._assign_attrs(dependencies)
18
+
19
+ policy_class._policy_try
20
+ end
21
+
22
+ def policy_rejected?(policy, dependencies:)
23
+ policy_class = Object.const_get(policy.to_sym.to_s.split("_").map(&:capitalize).join("")).new
24
+ policy_class._assign_attrs(dependencies)
25
+
26
+ result = policy_class._policy_try
27
+
28
+ !result
29
+ end
30
+
31
+ module ClassMethods
32
+ # extract to InlinePolicy class
33
+ def defpolicy(policy_name, dependencies, &block)
34
+ klass = Class.new(Policy) do
35
+ def initialize(deps)
36
+ deps[:dependencies].each do |dep|
37
+ instance_variable_set(:"@#{dep}", nil)
38
+ self.class.send(:attr_accessor, dep)
39
+ end
40
+ end
41
+
42
+ def policy
43
+ yield
44
+ end
45
+ end
46
+
47
+ klass.include(Policies)
48
+ klass.add_inline_policy({name: policy_name, policy: klass.new(dependencies)})
49
+ end
50
+ end
51
+
52
+ def self.included(base)
53
+ base.extend(ClassMethods)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Polidef
4
+ class Policy
5
+ def self.policy_dependencies(*args)
6
+ @policy_dependencies ||= args
7
+ end
8
+
9
+ def self.inline_policies
10
+ @inline_policies ||= []
11
+ end
12
+
13
+ def self.add_inline_policy(policy_hash)
14
+ inline_policies << policy_hash
15
+ end
16
+
17
+ def initialize
18
+ _generate_attrs
19
+ end
20
+
21
+ def policy
22
+ raise NotImplementedError
23
+ end
24
+
25
+ def policy_chain(policies_collection)
26
+ _policy_chain(policies_collection)
27
+ end
28
+
29
+ def or_policy(single_policy)
30
+ _or_policy(single_policy)
31
+ end
32
+
33
+ def _policy_chain(policies_collection)
34
+ @_policy_state = nil
35
+
36
+ policies_collection.each do |chain_link|
37
+ break unless @_policy_state
38
+ @_policy_state = send(:chain_link)
39
+ end
40
+
41
+ itself
42
+ end
43
+
44
+ def _or_policy(single_policy)
45
+ return if @_policy_state
46
+ @_policy_state = send(:single_policy)
47
+
48
+ itself
49
+ end
50
+
51
+ def _policy_try
52
+ send(:policy)
53
+ end
54
+
55
+ def _generate_attrs
56
+ self.class.policy_dependencies.each do |dep|
57
+ instance_variable_set(:"@#{dep}", nil)
58
+ self.class.send(:attr_accessor, dep)
59
+ end
60
+ end
61
+
62
+ def _assign_attrs(dependencies)
63
+ dependencies.each do |key, value|
64
+ send(:"#{key}=", value)
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Polidef
4
+ VERSION = "0.0.1"
5
+ end
data/lib/polidef.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Polidef
4
+ class Error < StandardError; end
5
+ end
6
+
7
+ require_relative "polidef/version"
8
+ require_relative "polidef/policy"
9
+ require_relative "polidef/policies"
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: polidef
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - JD Gonzales
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-02-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: standard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.31.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.31.0
27
+ description: |
28
+ Polidef is a convience API for managing complex and potentially stateful conditionals through policy objects.
29
+ Complex conditionals are fragile and can require a lot of state to exist in order to execute as expected. Polidef
30
+ seeks to simplify implementation and testing so you spend less time wrangling conditional state and more time
31
+ doing other things.
32
+ email:
33
+ - jd_gonzales@icloud.com
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - ".standard.yml"
39
+ - CHANGELOG.md
40
+ - CODE_OF_CONDUCT.md
41
+ - Gemfile
42
+ - Gemfile.lock
43
+ - LICENSE.txt
44
+ - README.md
45
+ - Rakefile
46
+ - lib/polidef.rb
47
+ - lib/polidef/policies.rb
48
+ - lib/polidef/policy.rb
49
+ - lib/polidef/version.rb
50
+ homepage: https://github.com/juliusdelta/polidef
51
+ licenses:
52
+ - MIT
53
+ metadata:
54
+ homepage_uri: https://github.com/juliusdelta/polidef
55
+ source_code_uri: https://github.com/juliusdelta/polidef
56
+ changelog_uri: https://github.com/juliusdelta/polidef/blob/main/CHANGELOG.md
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 2.6.0
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.2.32
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Useful abstractions to manage complex conditionals.
76
+ test_files: []