Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ShareProgress
is a gem designed to make creating A/B tests of Share Buttons for advocacy webpages simple and direct. It wraps the ShareProgress HTTP API while providing a simple, ActiveRecord-like interface for creating, updating and deleting buttons on ShareProgress.org itself.
Add this line to your application's Gemfile:
gem 'share_progress'
And then execute:
$ bundle
Or install it yourself as:
$ gem install share_progress
The current version of share_progress
is centered around Button
and Variant
classes. Currently, this gem wraps a subset of the ShareProgress API intended to work within applications that need to create share buttons for use on their website.
Before beginning, the application will expect that your environment defines an Environment Variable named SHARE_PROGRESS_API_KEY
. This key can be retrieved for your account from run.shareprogress.org.
ShareProgress
defines an API for interacting with the button portion of the ShareProgress API that is similar to ActiveRecord. Creating a new button is as simple as calling Button.new(params)
where the params in question are the variables of the button (see Button parameter options for more details). Button variants (which define A/B/X testing variants for testing share options on ShareProgress) can be added by setting the variants
property of your created button, or added through the add_or_update(variant)
method. Button variants can be defined as hashes containing the correct parameters (options for Variant values can be seen in the sample request in the documentation) or by passing in instances of the FacebookVariant
, TwitterVariant
and EmailVariant
classes.
To create or update your button and its variants, simply call button.save
, which will marshal all your changes and submit them to the API. If the request is successful, save
will return true
, while errors will cause the method to return false
and button.errors
will contain the relevant errors on the save attempt.
Note: The API currently includes options for destroy
on variants, which will, when complete, allow you to remove a variant from a button after that button has been saved. This is currently an experimental feature. It is not tested and unlikely to work reliably, if at all. These features should not be used in production.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake rspec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/SumOfUs/share_progress.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that share_progress demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.