forthebadge forthebadge Gem Version

This gem was last updated on the 15.04.2024 (dd.mm.yyyy notation), at 10:55:12 o'clock.

Introducing the BeautifulUrl project

This project has been created to primarily cover my needs to map a given input (typically a symbol, such as :ruby_homepage), to a specific String - a remote URL, in this case https://www.ruby-lang.org/en/.

In fact this is the primary scenario for this project: it provides a simple mapper between symbols, and remote URLs.

At a later time I also added symbols as shortcuts to local files, so the whole project is a quick way for me to navigate different resources (including RESTful APIs).

I may at a later point add the ability to arbitrarily add new entries via a yaml file, so that other people can extend this project at their own leisure - but for now, the original use case will be kept as-is. Extending the project may happen at a later time.

General usage examples

BeautifulUrl::BeautifulUrl.new('palemoon', :replace_localhost)
BeautifulUrl::BeautifulUrl.new('palemoon' {{ replace_localhost: true }}
BeautifulUrl['palemoon'] # ← This is recommended, as it is simpler.

Creating a .json file

It is possible to create a local .json file containing all the remote URLs that are registered. The method to do so is called BeautifulUrl.create_json_file(). Note that this functionality depends on the case_parser gem; that gem does not work 100% accurately, so do not be surprised if you do not get a complete .json file but only one with the first entry matched. In the future this may be changed, but for now this is the way it is.

Sinatra-Interface

The BeautifulUrl project has a minimalistic sinatra interface.

You can start it in this way:

require 'beautiful_url/www/app.rb'

BeautifulUrl::App.start_sinatra_interface

Note that this depends on an external gem (the cyberweb project). The reason why that dependency exists is because it makes it easier for me to handle the same or similar code across many different ruby-based projects.

The main purpose of this Application is to map given string input into the corresponding URL. It's mostly added for demonstration-purposes, to show how this could be used in a web-interface.

One day I may also want to add a small widget to a browser to allow for this, but I don't like javascript, and don't know how to do this via ruby only either.

Contact information and mandatory 2FA (no longer) coming up in 2022 / 2023

If your creative mind has ideas and specific suggestions to make this gem more useful in general, feel free to drop me an email at any time, via:

shevy@inbox.lt

Before that email I used an email account at Google gmail, but in 2021 I decided to slowly abandon gmail, for various reasons. In order to limit the explanation here, allow me to just briefly state that I do not feel as if I want to promote any Google service anymore when the user becomes the end product (such as via data collection by upstream services, including other proxy-services). My feeling is that this is a hugely flawed business model to begin with, and I no longer wish to support this in any way, even if only indirectly so, such as by using services of companies that try to promote this flawed model.

In regards to responding to emails: please keep in mind that responding may take some time, depending on the amount of work I may have at that moment. So it is not that emails are ignored; it is more that I have not (yet) found the time to read and reply. This means there may be a delay of days, weeks and in some instances also months. There is, unfortunately, not much I can do when I need to prioritise my time investment, but I try to consider all feedback as an opportunity to improve my projects nonetheless.

In 2022 rubygems.org decided to make 2FA mandatory for every gem owner eventually:

see https://blog.rubygems.org/2022/06/13/making-packages-more-secure.html

However had, that has been reverted again, so I decided to shorten this paragraph. Mandatory 2FA may exclude users who do not have a smartphone device or other means to 'identify'. I do not feel it is a fair assumption by others to be made that non-identified people may not contribute code, which is why I reject it. Mandatory 2FA would mean an end to all my projects on rubygems.org, so let's hope it will never happen. (Keep in mind that I refer to mandatory 2FA; I have no qualms for people who use 2FA on their own, but this carrot-and-stick strategy by those who control the rubygems infrastructure is a very bad one to pursue.