New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

policygen

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

policygen

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Policygen

Policygen helps you setup and publish Privacy Policies and Terms of Service policies to your site with ease. Simply set your config in the initializer and we'll do the hard work for you.

Installation

Add this line to your application's Gemfile:

gem 'policygen'

And then execute:

$ bundle

Or install it yourself as:

$ gem install policygen
Run the installer

To setup the policygen config file in your rails project run

rails generate policygen:install
If using Tailwind as your css framework

Add the following to app/config/tailwind.config.js

module.exports = {
  content: [
    './public/*.html',
    ...,
    getPolicygenViewPath()
  ]
}

function getPolicygenViewPath() {
  const { execSync } = require("child_process");
  const path = execSync("bundle show policygen").toString().trim();
  return `${path}/**/*.{erb,html,rb}`;
}

Usage

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

Once you've answered all the config questions you're ready to render your privacy and terms page.

Privacy Policy
<div class="whatever-your-container-is">
  <%= privacy_policy %>
</div>
Terms Policy
<div class="whatever-your-container-is">
  <%= terms_of_service %>
</div>

Styling your policies

Custom CSS
/* The outmost container class */
.policygen-container {
}
/* The h1 header class */
.policygen-h1 {
}
/* The h2 header class */
.policygen-h2 {
}
/* The h3 header class */
.policygen-h3 {
}
/* The section class, break/margin between each section of the policy */
.policygen-section {
}
/* Body text, the paragraph text within each section */
.policygen-body-text {
}
/* Unordered lists */
.policygen-ul {
}
/* Ordered list */
.policygen-ol {
}
/* Bold paragraph class */
.policygen-bold {
}
/* Link class, remember to have a hover on this class */
.policygen-link {
}
Tailwindcss

You can change the colors used

config.tailwind_config = {
  heading_color: "text-gray-900",
  body_color: "text-gray-800",
  link_color: "text-blue-500 hover:text-blue-700"
}

Development

Building the gem
gem build
gem push twinkle-x.x.x.gem

Contributing

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.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Policygen project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 13 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc