url-shortener v0.1.0
url-shortener
Small library that uses external URL shorteners transparently.
Installation
-
Add the dependency to your
shard.yml
:dependencies: url-shortener: github: juanmougan/url-shortener
-
Run
shards install
Usage
require "url-shortener"
API
Without specifing a provider
The simplest use case is to only provide a URL, and rely on the default provider.
shortened = UrlShortener::Shortener
.from_url("www.uca.edu.ar")
.shorten
Specifing a provider
Alternatively, you can specify a provider to generate the URL.
shortened = UrlShortener::Shortener
.from_url("www.uca.edu.ar")
.with_provider(UrlShortener::TinyUrlProvider.new)
.shorten
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/juanmougan/url-shortener/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Juan Manuel Mougan - creator and maintainer
Repository
url-shortener
Owner
Statistic
- 1
- 0
- 0
- 1
- 0
- over 4 years ago
- April 8, 2020
License
MIT License
Links
Synced at
Sat, 23 Nov 2024 14:12:41 GMT
Languages