Project

joliegg

0.0
The project is in a healthy, maintained state
Jolie's Ruby libraries
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

joliegg

Jolie's Ruby toolkit.

Installation

# Until the gem is published, point Bundler at a checkout:
gem "joliegg", git: "https://github.com/joliegg/gem.git"
# or a local path:
gem "joliegg", path: "../joliegg"

Usage

Every check accepts a full URL, a bare domain, or an email address — the input is reduced to its host, then every domain suffix is matched, so a listed example.com also blocks sub.example.com and user@example.com:

require "joliegg"

Jolie::Moderation::UrlBlocklist.blocked?("https://spam.0-mail.com/signup") # => true
Jolie::Moderation::UrlBlocklist.blocked?("someone@mailinator.com")         # => true
Jolie::Moderation::UrlBlocklist.blocked?("example.com")                    # => false
Jolie::Moderation::UrlBlocklist.match("someone@mailinator.com")            # => "mailinator.com"

Jolie::Moderation::UrlBlocklist.shortener?("bit.ly")        # => true
Jolie::Moderation::UrlBlocklist.shortener?("links.bit.ly")  # => true (suffix-matched)

Jolie::Moderation.moderate_link("https://mailinator.com").categories # => ["BLACK_LIST"]
Jolie::Moderation.moderate_link("https://bit.ly/x").categories       # => ["URL_SHORTENER"]
Jolie::Moderation.link_blocked?("https://bit.ly/x", allow_shorteners: true) # => false

Syncing the data

The JSON files are copied verbatim from the TypeScript package. To refresh them from a local checkout of that repo:

rake "data:sync[/path/to/moderation]"

Development

bundle install
bundle exec rake spec      # tests
bundle exec standardrb     # lint

License

Hippocratic License HL3-CL — see LICENSE.md. Same license as the TypeScript package whose data this gem distributes.