Project

webloc

0.01
Low commit activity in last 3 years
A long-lived project that still receives updates
Webloc reads and writes .webloc files on macOS
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

webloc

webloc is a Ruby library that can read from and write to .webloc files as used on macOS. These are a variant of 'plist' format files, specifically used for storing links to URLs.

It works on Ruby 2.7 and up, including Ruby 3.x, and supports URLs of up to 2048 characters in length (and probably longer, but this is around the de facto limit for URLs in most systems).

Installation

gem install webloc

Usage

Reading a .webloc file:

Webloc.load(ARGV.first).url

Writing to a .webloc file:

Webloc.new('https://rubyweekly.com/').save('rubyweekly.webloc')

Thanks

Thanks is due to Christos Karaiskos for this article which helped me understand the plist format a bit more when fixing a bug in 2024.

License

Copyright (C) 2011-2024 Peter Cooper

webloc is licensed under the terms of the MIT License