Keep your project in shape! More info: https://gemnasium.com
This gem lets you push your dependency files to Gemnasium to track your project's dependencies and get notified about updates and security advisories.
Gemnasium app offers Github integration with fully automated synchronization but you can use this gem if you don't want to authorize access to your repositories (ie: for privacy concern).
Supported dependency files are:
Add this line to your application's Gemfile:
gem 'gemnasium'
Or in your terminal:
$ gem install gemnasium
Add configuration file in your project
$ gemnasium install
Install command supports 2 options : --rake
and --git
to respectively install the gemnasium rake task and a post-commit git hook.
gemnasium install
will add the config/gemnasium.yml file to your .gitignore so your private API key won't be committed. If you use another versionning system, please remember to ignore this file.
Warning: your api key is dedicated to your own user account and must not be published!
Fill the values of the new config/gemnasium.yml file.
There is multiple ways to use the gemnasium gem. You can choose whichever you prefer.
Using gemnasium from the command line is as simple as typing gemnasium [command]
:
To create a project on Gemnasium:
$ gemnasium create
Create command will look for data in your config/gemnasium.yml configuration file to create a project.
If your project was previously managed automatically from Github you can use the --force
option to overwrite existing setup.
Please note that automatic Github synchronization will be dropped once project is configured with this gem.
To push your dependency files on Gemnasium:
$ gemnasium push
Gemnasium gem comes with a rake task ready to be used. To use it, you need to install it via: gemnasium install --rake
Once installed, you'll have access to 2 tasks:
To create a project on Gemnasium:
$ rake gemnasium:create
Create command will look for data in your config/gemnasium.yml configuration file to create a project.
If your project was previously managed automatically from Github you can use the gemnasium:create:force
subtask to overwrite existing setup.
Please note that automatic Github synchronization will be dropped once project is configured with this gem.
To push your dependency files on Gemnasium:
$ rake gemnasium:push
We wrote for you a ready-to-use post-commit git hook.
Once installed via gemnasium install --git
, the gem will push your dependency files after each commit only if they have changed.
If you need to use Gemnasium gem right into your code, you can do so just like below:
require 'gemnasium'
# To install gemnasium files
#
# options is a Hash which can contain the following keys:
# project_path (required) - [String] path to the project
# install_rake_task - [Boolean] whether or not to install the rake task
# install_git_hook - [Boolean] whether or not to install the git hook
Gemnasium.install(options)
# To create your project on gemnasium
#
# options is a Hash which can contain the following keys:
# project_path (required) - [String] path to the project
# overwrite_attr - [Boolean] whether or not to overwrite existing project's attributes
Gemnasium.create_project(options)
# To push supported dependency files to gemnasium
#
# options is a Hash which can contain the following keys:
# project_path (required) - [String] path to the project
Gemnasium.push(options)
Here is a sample config file:
api_key: "some_secret_api_key"
profile_name: "tech-angels"
project_name: "vandamme"
project_branch: "master"
ignored_paths:
- spec/
- tmp/
This will handle the dependencies of the vandamme project for the tech-angels profile on master branch. Gemnasium gem will also ignore the project dependency files found in spec/ and tmp/.
Gemnasium will try to display the most accurate error message when something goes wrong.
Though, if you're stil stuck with something, feel free to contact Gemnasium support.