Project

share_with

0.0
The project is in a healthy, maintained state
Model and build up sharing links from yaml files to HTML code.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
>= 0
 Project Readme

ShareWith

This is a Ruby gem thought to render the sharing links for the most popular networks.

ShareWith also introduces a syntax, built upon a YAML file, to declare parameters and templates, and elements to self-describe the service itself.

This YAML file will be used to generate the object that renders the templates in plain HTML text.

Ruby Gem Version

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add share_with

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install share_with

Usage

As first step must require the gem:

require "share_with"

Then we can instantiate the Collection class and the list of services to load:

@collection = ShareWith::Collection.new(services: ["twitter", "facebook"])

Once filled the params required to render the template:

@collection.set_value_to_all("url", "https://freeaptitude.altervista.org/projects/share-with.html")

Finally we get the HTML code as a text string:

@collection.render_all("icon")

More Help

More info is available at: