policygen 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b9317aa21c81ad1112f11ab522f4b57ab003deaf2239f93b57ba2f72ba9f11ab
4
+ data.tar.gz: 9b105ec48b940c089ebd28e49e07d1e93998186e30ebdba19c9269c0517a1d87
5
+ SHA512:
6
+ metadata.gz: 2d29384b4e39c2b371a17104aba6e7f9caa52fc60d7bc750a3697031491c460d04714543262556aa8f802cdd8573e01c5045f35e2967044df4b2e84d54b317e7
7
+ data.tar.gz: 0fb445c985aa2dd881d4357c035b750c65182bce66e4f76382e63005d2525642fbe01e30c7dcb1c5eefbb4795b1b3dfb6d12070b1c933158ecbd17e0bddb16c7
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.0
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-05-31
4
+
5
+ - Initial release
@@ -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 t@imothee.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/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Tim Marks
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,144 @@
1
+ # Policygen
2
+
3
+ Policygen helps you setup and publish Privacy Policies and Terms of Service policies to your site with ease.
4
+ Simply set your config in the initializer and we'll do the hard work for you.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'policygen'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ ```bash
17
+ $ bundle
18
+ ```
19
+
20
+ Or install it yourself as:
21
+
22
+ ```bash
23
+ $ gem install policygen
24
+ ```
25
+
26
+ #### Run the installer
27
+
28
+ To setup the policygen config file in your rails project run
29
+
30
+ ```bash
31
+ rails generate policygen:install
32
+ ```
33
+
34
+ #### If using Tailwind as your css framework
35
+
36
+ Add the following to `app/config/tailwind.config.js`
37
+
38
+ ```js
39
+ module.exports = {
40
+ content: [
41
+ './public/*.html',
42
+ ...,
43
+ getPolicygenViewPath()
44
+ ]
45
+ }
46
+
47
+ function getPolicygenViewPath() {
48
+ const { execSync } = require("child_process");
49
+ const path = execSync("bundle show policygen").toString().trim();
50
+ return `${path}/**/*.{erb,html,rb}`;
51
+ }
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ Policygen mounts two view helpers to render your policies into any view you want to setup. The contents are driven by the config defined in `policygen.rb`
57
+
58
+ Once you've answered all the config questions you're ready to render your privacy and terms page.
59
+
60
+ #### Privacy Policy
61
+
62
+ ```ruby
63
+ <div class="whatever-your-container-is">
64
+ <%= privacy_policy %>
65
+ </div>
66
+ ```
67
+
68
+ #### Terms Policy
69
+
70
+ ```ruby
71
+ <div class="whatever-your-container-is">
72
+ <%= terms_of_service %>
73
+ </div>
74
+ ```
75
+
76
+ ### Styling your policies
77
+
78
+ #### Custom CSS
79
+
80
+ ```css
81
+ /* The outmost container class */
82
+ .policygen-container {
83
+ }
84
+ /* The h1 header class */
85
+ .policygen-h1 {
86
+ }
87
+ /* The h2 header class */
88
+ .policygen-h2 {
89
+ }
90
+ /* The h3 header class */
91
+ .policygen-h3 {
92
+ }
93
+ /* The section class, break/margin between each section of the policy */
94
+ .policygen-section {
95
+ }
96
+ /* Body text, the paragraph text within each section */
97
+ .policygen-body-text {
98
+ }
99
+ /* Unordered lists */
100
+ .policygen-ul {
101
+ }
102
+ /* Ordered list */
103
+ .policygen-ol {
104
+ }
105
+ /* Bold paragraph class */
106
+ .policygen-bold {
107
+ }
108
+ /* Link class, remember to have a hover on this class */
109
+ .policygen-link {
110
+ }
111
+ ```
112
+
113
+ #### Tailwindcss
114
+
115
+ You can change the colors used
116
+
117
+ ```ruby
118
+ config.tailwind_config = {
119
+ heading_color: "text-gray-900",
120
+ body_color: "text-gray-800",
121
+ link_color: "text-blue-500 hover:text-blue-700"
122
+ }
123
+ ```
124
+
125
+ ## Development
126
+
127
+ #### Building the gem
128
+
129
+ ```bash
130
+ gem build
131
+ gem push twinkle-x.x.x.gem
132
+ ```
133
+
134
+ ## Contributing
135
+
136
+ Bug reports and pull requests are welcome on GitHub at https://github.com/imothee/policygen. 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/imothee/policygen/blob/main/CODE_OF_CONDUCT.md).
137
+
138
+ ## License
139
+
140
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
141
+
142
+ ## Code of Conduct
143
+
144
+ Everyone interacting in the Policygen project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/imothee/policygen/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ require "minitest/test_task"
7
+
8
+ Minitest::TestTask.create
9
+
10
+ require "rubocop/rake_task"
11
+
12
+ RuboCop::RakeTask.new
13
+
14
+ task default: %i[test]
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Policygen
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc "Copy Policygen default files"
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ def copy_config
10
+ template "config/initializers/policygen.rb"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,204 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Use this setup block to configure all options available in Policygen.
4
+ Policygen.configure do |config|
5
+ # ==> CSS and Styling
6
+ # Which css framework to use? Default :tailwind
7
+ # [:tailwind, :custom]
8
+ # config.css_framework = :tailwind
9
+
10
+ # Tailwind CSS configuration
11
+ # config.tailwind_config = { heading_color: 'text-gray-800', body_color: 'text-gray-700' }
12
+
13
+ # ==> Entity Information
14
+ # What is the entity name we should use in the policies?
15
+ # config.entity_name = 'Your Entity Name'
16
+
17
+ # What is the entity website we should use in the policies?
18
+ # config.entity_website = 'https://www.your-entity-website.com'
19
+
20
+ # Do you have a contact address for privacy questions?
21
+ # config.entity_address = '1234 Main Street, Anytown, USA'
22
+
23
+ # Who should users reach out to for policy questions?
24
+ # config.support_email = 'support@policygen.xyz'
25
+ # config.privacy_email = 'privacy@policygen.xyz'
26
+
27
+ # ==> Policy updates
28
+ # When was your privacy policy last updated?
29
+ # config.privacy_last_updated = 'May 31, 2024'
30
+
31
+ # When was your terms of service last updated?
32
+ # config.tos_last_updated = 'May 31, 2024'
33
+
34
+ # ==> Policy wide settings
35
+ # What platforms does your policy apply to? Default [:web]
36
+ # config.platforms = [:web, :mobile]
37
+
38
+ # What locations does the privacy policy apply to? Default [:us, :ue, :uk]
39
+ # config.locations = [:us, :eu, :uk]
40
+
41
+ # What is the location of the entity? Default :us
42
+ # config.entity_location = :us
43
+
44
+ # Do you allow users under 18? Default false
45
+ # config.under_eighteen = true
46
+
47
+ # Do you allow users under 13? Default false
48
+ # config.under_thirteen = true
49
+
50
+ # Do you use social sign-in? Default false
51
+ # config.social_sign_in = true
52
+
53
+ # ==> TOS specific settings
54
+ # Do you sell purchasable goods? Default false
55
+ # config.purchasable_goods = true
56
+
57
+ # Do you have a subscription? Default false
58
+ # config.subscription = true
59
+
60
+ # Does your subscription have a free trial? Default false
61
+ # config.free_trial = true
62
+
63
+ # Does your subscription renew automatically? Default false
64
+ # config.auto_renew = true
65
+
66
+ # What is the refund policy? Default :none
67
+ # config.refund_policy = :none, :full, :pro_rata
68
+
69
+ # Do you allow users to upload content? Default false
70
+ # config.user_content = true
71
+
72
+ # Do you assign a license of user uploaded content? Default false
73
+ # config.user_content_license = true
74
+
75
+ # Do you allow users to create accounts? Default false
76
+ # config.user_accounts = true
77
+
78
+ # Governing law clause, default :california
79
+ # config.governing_law = :california, :delaware, :new_york
80
+
81
+ # Dispute resolution clause, default :litigation
82
+ # config.dispute_resolution = :arbitration, :litigation
83
+
84
+ # Mediation clause, default false
85
+ # Do you want to do informal mediation before arbitration or litigation?
86
+ # config.mediation = true
87
+
88
+ # Prohibited uses clause, default []
89
+ # Add any custom prohibited uses as a symbol to this array
90
+ # config.prohibited_uses = [:crawling, :illegal, :harmful, :infringing, :abusive, :spam, :advertising, :impersonation, :account_transfer]
91
+
92
+ # Service SLA, default false
93
+ # config.service_sla = true
94
+
95
+ # Service SLA Amount, default 0
96
+ # config.service_sla_amount = 100
97
+
98
+ # Service SLA timeframe, default nil
99
+ # config.service_sla_timeframe = '1 month'
100
+
101
+ # Service SLA refund, default false
102
+ # config.service_sla_refund = true
103
+
104
+ # Service SLA refund type, default :full
105
+ # config.service_sla_refund_type = :full, :pro_rata
106
+
107
+ # Service SLA custom clause, default nil
108
+ # If this exists we will use this instead of the amount and timeframe above
109
+ # config.service_sla_custom = 'We guarantee 99.9% uptime'
110
+
111
+ # Liability limitation, default false
112
+ # config.liability_limitation = true
113
+
114
+ # Liability limitation type, default :amount_paid
115
+ # config.liability_limitation_type = :amount_paid, :amount, :min_amount_paid_or_amount
116
+
117
+ # Liability timeframe, set if you have a subscription model, default nil
118
+ # config.liability_limitation_timeframe = '6 months'
119
+
120
+ # Liability limitation amount, default 0
121
+ # config.liability_limitation_amount = 1000
122
+
123
+ # ==> Privacy specific settings
124
+ # What personal information do you collect? Default []
125
+ # Personal information is any data that can be used to identify an individual.
126
+ # Add any custom data you collect as a symbol to this array
127
+ # config.personal_information = [:name, :email, :phone, :address, :password, :ip_address, :device_id, :credit_card, :location_data, :anonymized_usage_data]
128
+
129
+ # What sensitive information do you collect? Default []
130
+ # Sensitive information is any data that a user would have a reasonable expectation to remain private.
131
+ # Add any custom data you collect as a symbol to this array
132
+ # config.sensitive_information = [:ssn, :financial_data, :health_data, :biometric_data, :genetic_data, :political_affiliation, :sexual_orientation, :criminal_history, :religion]
133
+
134
+ # What third-party data do you collect? Default []
135
+ # Third-party data is any data that you collect from third-party services.
136
+ # Add any custom data you collect as a symbol to this array
137
+ # config.third_party_data = [:advertising_data, :analytics_data, :social_media_data, :purchase_data, :email_data, :support_data, :crm_data, :job_data, :address_data, :behavior_data]
138
+
139
+ # Do you collect payment data? Default false
140
+ # config.payment_data = true
141
+
142
+ # What payment processors do you use? Default []
143
+ # Please add the website of any payment processors you use.
144
+ # config.payment_processors = ['https://stripe.com', 'https://paypal.com']
145
+
146
+ # Do you store logs or app usage data? Default false
147
+ # config.app_usage_data = true
148
+
149
+ # Do you disclose personal information to third parties? Default false
150
+ # If you use third-party services that collect data, set this to true.
151
+ # config.third_party_disclosure = true
152
+
153
+ # Third party entities you disclose personal information to. Default []
154
+ # config.third_party_disclosure_entities = ['Google Analytics', 'Facebook Pixel']
155
+
156
+ # Do you sell/share personal information with third parties? Default false
157
+ # If you sell or share any data with business partners, set this to true.
158
+ # config.third_party_sharing = true
159
+
160
+ # Third party entities you share personal information with. Default []
161
+ # config.third_party_sharing_entities = ['Google Ads', 'Facebook Ads']
162
+
163
+ # Do you have robust security measures in place? Default false
164
+ # If you have security measures in place to protect user data, set this to true.
165
+ # config.security_measures = true
166
+
167
+ # Do you use tracking cookies/web beacons? Default false
168
+ # config.web_tracking = true
169
+
170
+ # Do you use third party analytics? Default false
171
+ # config.third_party_analytics = true
172
+
173
+ # What do you need to perform to deliver your service? Default []
174
+ # Accounts = Creating and managing user accounts
175
+ # Communications = Sending transactional or marketing communications to or between users
176
+ # Orders = Processing orders and payments
177
+ # config.service_requirements = [:accounts, :communications, :orders]
178
+
179
+ # Under what legal basis do you collect and process data? Default []
180
+ # config.legal_basis = [:advertising, :marketing, :analytics, :security, :fraud_prevention]
181
+
182
+ # Data retention period
183
+ # How long do you store user data after account termination? Default nil
184
+ # config.data_retention_period = ' 3 months'
185
+
186
+ # Do you support all US state privacy laws? Default false
187
+ # config.us_state_privacy_laws = true
188
+
189
+ # Do you have a privacy management page to link to? Default nil
190
+ # If you don't have a privacy page, users will be told to email you at your privacy_email with deletion and data requests
191
+ # config.privacy_page = 'https://www.your-entity-website.com/privacy'
192
+
193
+ # Do you have a Data Protection Officer (DPO)? Default false
194
+ # config.dpo = true
195
+
196
+ # What is the DPO's name?
197
+ # config.dpo_name = 'DPO Name'
198
+
199
+ # What is the DPO's email?
200
+ # config.dpo_email = ''
201
+
202
+ # What is the DPO's phone number?
203
+ # config.dpo_phone = ''
204
+ end