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

dynamic_links

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamic_links

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

DynamicLinks is a flexible URL shortening Ruby gem, designed to provide various strategies for URL shortening, similar to Firebase Dynamic Links.

Usage

To use DynamicLinks, you need to configure the shortening strategy in an initializer or before you start shortening URLs.

Configuration

In your Rails initializer or similar setup code, configure DynamicLinks like this:

DynamicLinks.configure do |config|
  config.shortening_strategy = :MD5
end

Shortening a URL

To shorten a URL, simply call:

shortened_url = DynamicLinks.shorten_url("https://example.com")

Available Shortening Strategies

DynamicLinks supports various shortening strategies. The default strategy is MD5, but you can choose among several others, including NanoIdStrategy, RedisCounterStrategy, Sha256Strategy, and more.

Depending on the strategy you choose, you may need to install additional dependencies.

Optional Dependencies

  • For NanoIdStrategy, add gem 'nanoid', '~> 2.0' to your Gemfile.
  • For RedisCounterStrategy, add gem 'redis', '>= 4' to your Gemfile.

Ensure you bundle these dependencies along with the DynamicLinks gem if you plan to use these strategies.

Installation

Add this line to your application's Gemfile:

gem "dynamic_links"

And then execute:

$ bundle

Or install it yourself as:

$ gem install dynamic_links

Contributing

We welcome contributions to DynamicLinks! Please read the contributing guidelines to get started.

License

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

FAQs

Package last updated on 01 Jan 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