policygen 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,285 @@
1
+ <div id="policygen-tos" class="<%= @css.container_class %>">
2
+ <h1 class="<%= @css.h1_class %>"><%= I18n.t('tos.title') %></h1>
3
+ <h3 class="<%= @css.h3_class %>"><%= I18n.t('tos.last_updated', updated: @config.tos_last_updated) %></h3>
4
+
5
+ <!-- Introduction -->
6
+ <section class="<%= @css.section_class %>">
7
+ <p class="<%= @css.body_class %>">
8
+ <%= I18n.t('tos.terms_notice', entity_name: @config.entity_name, entity_website: @config.entity_website) %>
9
+ </p>
10
+ <p class="<%= @css.body_class %>">
11
+ <% I18n.t('tos.agreement') %>
12
+ </p>
13
+ <p class="<%= @css.body_class %>">
14
+ <% I18n.t('tos.changes') %>
15
+ </p>
16
+ <% if !@config.under_eighteen && !@config.under_thirteen %>
17
+ <p class="<%= @css.body_class %>">
18
+ <%= I18n.t('tos.age_limitation') %>
19
+ </p>
20
+ <% elsif !@config.under_thirteen %>
21
+ <p class="<%= @css.body_class %>">
22
+ <%= I18n.t('tos.thirteen_limitation') %>
23
+ </p>
24
+ <% else %>
25
+ <p class="<%= @css.body_class %>">
26
+ <%= I18n.t('tos.no_age_limitation') %>
27
+ </p>
28
+ <% end %>
29
+ </section>
30
+
31
+ <!-- Policy Sections -->
32
+ <section class="<%= @css.section_class %>">
33
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.title') %></h1>
34
+ <ol class="<%= @css.ol_class %>">
35
+ <% if @config.user_accounts %>
36
+ <li><a href="#section-user-accounts" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.user_accounts') %></a></li>
37
+ <% end %>
38
+ <% if @config.user_content %>
39
+ <li><a href="#section-user-content" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.user_content') %></a></li>
40
+ <% end %>
41
+ <% if @config.purchasable_goods %>
42
+ <li><a href="#section-purchasable-goods" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.purchasable_goods') %></a></li>
43
+ <% end %>
44
+ <% if @config.subscription %>
45
+ <li><a href="#section-subscriptions" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.subscriptions') %></a></li>
46
+ <% end %>
47
+ <li><a href="#section-prohibited-use" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.prohibited_use') %></a></li>
48
+ <li><a href="#section-termination" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.termination') %></a></li>
49
+ <li><a href="#section-governing-law" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.governing_law') %></a></li>
50
+ <li><a href="#section-disputes" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.disputes') %></a></li>
51
+ <li><a href="#section-availability" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.availability') %></a></li>
52
+ <% if @config.liability_limitation %>
53
+ <li><a href="#section-liability-limitation" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.liability_limitation') %></a></li>
54
+ <% end %>
55
+ <li><a href="#section-indemnfication" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.indemnification') %></a></li>
56
+ <li><a href="#section-contact" class="<%= @css.link_class %>"><%= I18n.t('tos.sections.contact') %></a></li>
57
+ </ol>
58
+ </section>
59
+
60
+ <!-- User Accounts -->
61
+ <% if @config.user_accounts %>
62
+ <section id="section-user-accounts" class="<%= @css.section_class %>">
63
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.user_accounts') %></h2>
64
+ <p class="<%= @css.body_class %>">
65
+ <%= I18n.t('tos.user_accounts.overview') %>
66
+ </p>
67
+ <p class="<%= @css.body_class %>">
68
+ <%= I18n.t('tos.user_accounts.security') %>
69
+ </p>
70
+ <p class="<%= @css.body_class %>">
71
+ <%= I18n.t('tos.user_accounts.info') %>
72
+ </p>
73
+ </section>
74
+ <% end %>
75
+
76
+ <!-- User Content -->
77
+ <% if @config.user_content %>
78
+ <section id="section-user-content" class="<%= @css.section_class %>">
79
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.user_content') %></h2>
80
+ <p class="<%= @css.body_class %>">
81
+ <%= I18n.t('tos.user_content.overview') %>
82
+ </p>
83
+ <p class="<%= @css.body_class %>">
84
+ <%= I18n.t('tos.user_content.removal') %>
85
+ </p>
86
+ <% if @config.user_content_license %>
87
+ <p class="<%= @css.body_class %>">
88
+ <%= I18n.t('tos.user_content.license') %>
89
+ </p>
90
+ <% end %>
91
+ </section>
92
+ <% end %>
93
+
94
+ <!-- Purchasable Goods -->
95
+ <% if @config.purchasable_goods %>
96
+ <section id="section-purchasable-goods" class="<%= @css.section_class %>">
97
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.purchasable_goods') %></h2>
98
+ <p class="<%= @css.body_class %>">
99
+ <%= I18n.t('tos.purchasable_goods.overview') %>
100
+ </p>
101
+ <p class="<%= @css.body_class %>">
102
+ <%= I18n.t('tos.purchasable_goods.payment') %>
103
+ </p>
104
+ <p class="<%= @css.body_class %>">
105
+ <%= I18n.t('tos.purchasable_goods.purchases') %>
106
+ </p>
107
+ </section>
108
+ <% end %>
109
+
110
+ <!-- Subscriptions -->
111
+ <% if @config.subscription %>
112
+ <section id="section-subscriptions" class="<%= @css.section_class %>">
113
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.subscriptions') %></h2>
114
+ <p class="<%= @css.body_class %>">
115
+ <%= I18n.t('tos.subscriptions.overview') %>
116
+ </p>
117
+ <% if @config.free_trial %>
118
+ <p class="<%= @css.body_class %>">
119
+ <%= I18n.t('tos.subscriptions.free_trial') %>
120
+ </p>
121
+ <% end %>
122
+ <% if @config.auto_renew %>
123
+ <p class="<%= @css.body_class %>">
124
+ <%= I18n.t('tos.subscriptions.auto_renew') %>
125
+ </p>
126
+ <% end %>
127
+ <% if @config.refund_policy == :none %>
128
+ <p class="<%= @css.body_class %>">
129
+ <%= I18n.t('tos.subscriptions.refund_none') %>
130
+ </p>
131
+ <% elsif @config.refund_policy == :full %>
132
+ <p class="<%= @css.body_class %>">
133
+ <%= I18n.t('tos.subscriptions.refund_full') %>
134
+ </p>
135
+ <% elsif @config.refund_policy == :pro_rata %>
136
+ <p class="<%= @css.body_class %>">
137
+ <%= I18n.t('tos.subscriptions.refund_pro_rata') %>
138
+ </p>
139
+ <% end %>
140
+ </section>
141
+ <% end %>
142
+
143
+ <!-- Prohibited Use -->
144
+ <section id="section-prohibited-use" class="<%= @css.section_class %>">
145
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.prohibited_use') %></h2>
146
+ <p class="<%= @css.body_class %>">
147
+ <%= I18n.t('tos.prohibited_use.overview') %>
148
+ </p>
149
+ <ul class="<%= @css.ul_class %>">
150
+ <% @config.prohibited_uses.each do |use| %>
151
+ <li class="<%= @css.body_class %>">
152
+ <%= I18n.t("tos.prohibited_use.#{use.to_s}") rescue use.to_s.titleize %>
153
+ </li>
154
+ <% end %>
155
+ </ul>
156
+ </section>
157
+
158
+ <!-- Termination -->
159
+ <section id="section-termination" class="<%= @css.section_class %>">
160
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.termination') %></h2>
161
+ <p class="<%= @css.body_class %>">
162
+ <%= I18n.t('tos.termination.overview') %>
163
+ </p>
164
+ <p class="<%= @css.body_class %>">
165
+ <%= I18n.t('tos.termination.effect') %>
166
+ </p>
167
+ <p class="<%= @css.body_class %>">
168
+ <%= I18n.t('tos.termination.severability') %>
169
+ </p>
170
+ <p class="<%= @css.body_class %>">
171
+ <%= I18n.t('tos.termination.waiver') %>
172
+ </p>
173
+ </section>
174
+
175
+ <!-- Governing Law -->
176
+ <section id="section-governing-law" class="<%= @css.section_class %>">
177
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.governing_law') %></h2>
178
+ <p class="<%= @css.body_class %>">
179
+ <%= I18n.t('tos.governing_law.overview', governing_law: @config.governing_law) %>
180
+ </p>
181
+ </section>
182
+
183
+ <!-- Disputes -->
184
+ <section id="section-disputes" class="<%= @css.section_class %>">
185
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.disputes') %></h2>
186
+ <% if @config.mediation %>
187
+ <p class="<%= @css.body_class %>">
188
+ <%= I18n.t('tos.disputes.mediation') %>
189
+ </p>
190
+ <% end %>
191
+ <% if @config.dispute_resolution == :arbitration %>
192
+ <p class="<%= @css.body_class %>">
193
+ <%= I18n.t('tos.disputes.arbitration') %>
194
+ </p>
195
+ <% end %>
196
+ <% if @config.dispute_resolution == :litigation %>
197
+ <p class="<%= @css.body_class %>">
198
+ <%= I18n.t('tos.disputes.litigation') %>
199
+ </p>
200
+ <% end %>
201
+ </section>
202
+
203
+ <!-- Availability -->
204
+ <section id="section-availability" class="<%= @css.section_class %>">
205
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.availability') %></h2>
206
+ <p class="<%= @css.body_class %>">
207
+ <%= I18n.t('tos.availability.as_is') %>
208
+ </p>
209
+ <p class="<%= @css.body_class %>">
210
+ <%= I18n.t('tos.availability.maintenance') %>
211
+ </p>
212
+ <p class="<%= @css.body_class %>">
213
+ <%= I18n.t('tos.availability.warranty') %>
214
+ </p>
215
+ <% if @config.service_sla %>
216
+ <p class="<%= @css.body_class %>">
217
+ <%= I18n.t('tos.availability.sla') %>
218
+ </p>
219
+ <% if @config.service_sla_custom %>
220
+ <p class="<%= @css.body_class %>">
221
+ <%= @config.service_sla_custom %>
222
+ </p>
223
+ <% else %>
224
+ <p class="<%= @css.body_class %>">
225
+ <%= I18n.t('tos.availability.sla_details', amount: @config.service_sla_amount, timeframe: @config.service_sla_timeframe) %>
226
+ </p>
227
+ <% end %>
228
+ <% if @config.service_sla_refund %>
229
+ <p class="<%= @css.body_class %>">
230
+ <%= I18n.t('tos.availability.sla_refund', refund: @config.service_sla_refund_type.to_s) %>
231
+ </p>
232
+ <% end %>
233
+ <% end %>
234
+ </section>
235
+
236
+ <!-- Liability Limitation -->
237
+ <% if @config.liability_limitation %>
238
+ <section id="section-liability-limitation" class="<%= @css.section_class %>">
239
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.liability_limitation') %></h2>
240
+ <p class="<%= @css.body_class %>">
241
+ <%= I18n.t('tos.liability_limitation.overview') %>
242
+ </p>
243
+ <% if @config.liability_limitation_type == :amount_paid %>
244
+ <p class="<%= @css.body_class %>">
245
+ <%= I18n.t('tos.liability_limitation.amount_paid', timeframe: @config.liability_limitation_timeframe) %>
246
+ </p>
247
+ <% elsif @config.liability_limitation_type == :amount %>
248
+ <p class="<%= @css.body_class %>">
249
+ <%= I18n.t('tos.liability_limitation.amount', amount: @config.liability_limitation_amount) %>
250
+ </p>
251
+ <% elsif @config.liability_limitation_type == :min_amount_paid_or_amount %>
252
+ <p class="<%= @css.body_class %>">
253
+ <%= I18n.t('tos.liability_limitation.min_amount_paid_or_amount', timeframe: @config.liability_limitation_timeframe, amount: @config.liability_limitation_amount) %>
254
+ </p>
255
+ <% end %>
256
+ <p class="<%= @css.body_class %>">
257
+ <%= I18n.t('tos.liability_limitation.exceptions') %>
258
+ </p>
259
+ </section>
260
+ <% end %>
261
+
262
+ <!-- Indemnification -->
263
+ <section id="section-indemnification" class="<%= @css.section_class %>">
264
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.indemnification') %></h2>
265
+ <p class="<%= @css.body_class %>">
266
+ <%= I18n.t('tos.indemnification.overview') %>
267
+ </p>
268
+ </section>
269
+
270
+ <!-- Contact -->
271
+ <section id="section-contact" class="<%= @css.section_class %>">
272
+ <h2 class="<%= @css.h2_class %>"><%= I18n.t('tos.sections.contact') %></h2>
273
+ <p class="<%= @css.body_class %>">
274
+ <%= I18n.t('tos.contact.text', support_email: @config.support_email, class: @css.link_class) %>
275
+ </p>
276
+ <p class="<%= @css.body_class %>">
277
+ <%= @config.entity_name %>
278
+ </p>
279
+ <% if @config.entity_address %>
280
+ <p class="<%= @css.body_class %>">
281
+ <%= I18n.t('tos.contact.address', entity_address: @config.entity_address) %>
282
+ </p>
283
+ <% end %>
284
+ </section>
285
+ </div>
data/policygen.gemspec ADDED
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/policygen/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "policygen"
7
+ spec.version = Policygen::VERSION
8
+ spec.authors = ["Tim Marks"]
9
+ spec.email = ["t@imothee.com"]
10
+
11
+ spec.summary = "Easily generate privacy policies, terms of service, and cookie policies for your Rails app."
12
+ spec.description = "Policygen makes it easy to generate privacy policies, terms of service, and cookie policies for your Rails app. It includes a generator to create the policies, and a view helper to render them in your app."
13
+ spec.homepage = "https://policygen.xyz"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 3.0.0"
16
+
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/imothee/policygen-rails"
21
+ spec.metadata["changelog_uri"] = "https://github.com/imothee/policygen-rails/blob/main/CHANGELOG.md"
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(__dir__) do
26
+ `git ls-files -z`.split("\x0").reject do |f|
27
+ (File.expand_path(f) == __FILE__) ||
28
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
29
+ end
30
+ end
31
+ spec.bindir = "exe"
32
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ["lib"]
34
+
35
+ # Uncomment to register a new dependency of your gem
36
+ # spec.add_dependency "example-gem", "~> 1.0"
37
+ spec.add_dependency "erubi", "~> 1.11"
38
+ spec.add_dependency "i18n", "~> 1.14.5"
39
+
40
+ # For more information and examples about making a new gem, check out our
41
+ # guide at: https://bundler.io/guides/creating_gem.html
42
+ end
data/sig/policygen.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Policygen
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: policygen
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Tim Marks
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 1980-01-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: erubi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: i18n
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.14.5
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.14.5
41
+ description: Policygen makes it easy to generate privacy policies, terms of service,
42
+ and cookie policies for your Rails app. It includes a generator to create the policies,
43
+ and a view helper to render them in your app.
44
+ email:
45
+ - t@imothee.com
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - ".rubocop.yml"
51
+ - CHANGELOG.md
52
+ - CODE_OF_CONDUCT.md
53
+ - LICENSE.txt
54
+ - README.md
55
+ - Rakefile
56
+ - lib/generators/policygen/install_generator.rb
57
+ - lib/generators/policygen/templates/config/initializers/policygen.rb
58
+ - lib/locales/en.yml
59
+ - lib/policygen.rb
60
+ - lib/policygen/configuration.rb
61
+ - lib/policygen/css/classes.rb
62
+ - lib/policygen/css/tailwind.rb
63
+ - lib/policygen/railtie.rb
64
+ - lib/policygen/renderer.rb
65
+ - lib/policygen/sinatra.rb
66
+ - lib/policygen/version.rb
67
+ - lib/policygen/view_helpers.rb
68
+ - lib/templates/privacy_policy.html.erb
69
+ - lib/templates/tos.html.erb
70
+ - policygen.gemspec
71
+ - sig/policygen.rbs
72
+ homepage: https://policygen.xyz
73
+ licenses:
74
+ - MIT
75
+ metadata:
76
+ allowed_push_host: https://rubygems.org
77
+ homepage_uri: https://policygen.xyz
78
+ source_code_uri: https://github.com/imothee/policygen-rails
79
+ changelog_uri: https://github.com/imothee/policygen-rails/blob/main/CHANGELOG.md
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 3.0.0
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubygems_version: 3.3.26
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Easily generate privacy policies, terms of service, and cookie policies for
99
+ your Rails app.
100
+ test_files: []