Socket
Book a DemoInstallSign in
Socket

sys_lib_detector

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sys_lib_detector

0.2.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

SysLibDetector

SysLibDetector helps in solving an irritating issue, which is ruby gems requiring native system dependencies, such as 'nokogiri' gem, as if you don't know upfront that you need to install ‘zlib1g-dev’ and ‘liblzma-dev’ you will be hit with an exception about a missing system library, and you won't be able to know this till checking Nokogiri's website.

How SysLibDetector works

SysLibDetector collects your project's local gems and your system's operating system information and make an API request with this information to a web-service https://sys-libraries.herokuapp.com, which retrieves the possibly found system native libraries required for correct installation and usage of your project's gems.

Dependencies

  • Json: for parsing json responses from the web-service.
  • System: for system's operating system detection
  • Thor: for building a command-line interface.
  • RestClient: a rest client for the web-service communication

Installation

Add this line to your application's Gemfile:

gem 'sys_lib_detector'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sys_lib_detector

Usage

  • Show the available methods

    $ sys-lib-detector help 
    
  • List your project's gems

    $ sys-lib-detector list_all_gems
    
  • List the available required system libraries for your project's gems

    $ sys-lib-detector list_sys_libs
    

    *Note: The web-service is continuously updated with gem's system libraries dependencies upon the contribution of different contributors, and you among those! Check the contribution part below.

  • Install the available required system libraries for your project's gems

    $ sys-lib-detector install_sys_libs
    

    *Note: Supported operating systems are Linux and OS X, with package managers APT and Homebrew respectively.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Adding new gem's system libraries

You can contribute yourself in order for making the whole process more reliable and more useful by adding gems' system dependencies.

This can be done by making a simple POST API request to the web-service (contributing endpoint) https://sys-libraries.herokuapp.com/contribute_requests including your email, gem's information (name and version) and the system libraries dependencies, as in this example

{
	"email": "you@example.com",
	"ruby_gem": {
		"name": "nokogiri",
		"version": "1.8.2"
	},
	"libraries": [
		{
			"platform": "linux",
			"name": "zlib1g-dev"
		},
        	{
			"platform": "linux",
			"name": "liblzma-dev"
		},
		{
			"platform": "osx",
			"name": "libxml2"
		}
	]
}

*NOTE: You can leave version field in ruby_gems attributes empty

*NOTE: platform field in libraries attributes can be any of those: 'linux', 'osx' or 'windows'

SysLibDetector gem

Bug reports and pull requests are welcome on GitHub at https://github.com/HusseinReda/sys_lib_detector. The project is always welcoming for contributions.

Future Plans

  • Adding Windows to supported operating systems.
  • Automating the manual review of the contribution requests of adding gems' dependencies.

License

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

FAQs

Package last updated on 09 Feb 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.