- This gem is currently alpha. You need to be invited to SourceNinja Alpha in order to use this gem.
What is SourceNinja
SourceNinja is an awesome service that allows you to stay informed of updates to the open source packages that your application uses. When a newer version of a package is released, SourceNinja alerts you and gives you actionable information to help you determine whether you should upgrade to the newer package.
Visit SourceNinja to learn more.
What is the sourceninja gem
The sourceninja gem is a gem that can be included in your rails application to allow seamless integration with SourceNinja. The sourceninja gem will send all of your gem files and versions to SourceNinja to begin managing your open source libraries.
Log into SourceNinja and create a product. The product you create will be paired with your application.
After you create a product, you will be directed to a page asking what language your application is running. Select
Railsfrom the menu on the left side.
You will be presented with two values, you'll need these two values later.
Install the sourceninja gem. You can do this by adding the following line to your Gemfile.
gem "sourceninja", "~> 0.0.7"
Set the environment variables
SOURCENINJA_PRODUCT_IDusing the values from step 4.
Updated Magically in Production
Now each time you push to production the sourceninja gem will be run and data will be populated back to SourceNinja. If you visit your SourceNinja page you will be given a list of outdated gems.
The sourceninja data is populated whenever the app is initialized.
If you would like to test sourceninja gem locally, you will want to create an initializer script to set the variables.
ENV["SOURCENINJA_TOKEN"] ||= "1cea0be98caf02e830ac2aadbe44e4ee" ENV["SOURCENINJA_PRODUCT_ID"] ||= "fb89e064-b48c-d0c3-81x4-a34a5b60a654"
Upon doing this, each time you start the rails server locally the data will be pushed. You could also use these steps if you want to manage a production instance and a development instance.
Note: DO NOT DO THIS FOR PRODUCTION: No configuration files with sensitive information should ever be required within the application source and required config values should be read in from the ENV by supported libraries.
Feel free to email us at support at sourceninja dot com if you have any questions or issues.