Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Prints and exports the dependencies within component-based Ruby/Rails applications (#cbra)
Add this line to your application's Gemfile:
gem 'cobradeps'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cobradeps
You need Graphviz to generate the graph.png
If you're using OS X and homebrew, you just need to:
brew install graphviz
For more information about installation on other operating systems, just check Graphviz Download Page
cobradeps [OPTION] [application path]
Component-based Ruby/Rails dependency grapher.
Options are...
-t, --text DEFAULT Outputs a textual representation of the dependencies
-g, --graph Outputs graph.png to the current directory
-d, --dot Outputs graph.dot to the current directory
-h, -H, --help Display this help message.
There are sample #cobra folder structures in spec/examples
. Here is the graph generated for the letters app structure:
path "..." do
blocksThe preferred method of referencing #cbra dependencies is via the path block syntax supported by bundler(http://teotti.com/gemfiles-hierarchy-in-ruby-on-rails-component-based-architecture/):
path "../" do
gem "B"
gem "C"
gem "D"
gem "E1"
gem "E2"
gem "F"
end
Note, that you only need to add direct dependencies when using the block syntax (and not transitive dependencies as discussed below).
The :path option used for #cobras is typically a relative path. Because of that all gems and apps transitively including a gem need to state the relative path to every gem with a path relatuive to their root. For an app, this is the reason why it is unclear which gems it really directly depends on. That's why all dependencies of apps are omitted from the output graph.
To include direct dependencies of an application, add an additional option to the gem
line from the Gemfile like so:
gem "B", path: "../B", group: :direct
gem "C", path: "../C"
gem "D", path: "../D"
gem "E1", path: "../E1"
gem "E2", path: "../E2"
gem "F", path: "../F"
Why do I need to add group: :direct?? In the first release, cobradeps was checking for direct: true, until some time ago this year, the extraneous option direct:
worked, but then a check was added to not allow extra options and the feature has been broken ever since. (as stated by @shageman on his merge commit).
So the hack to allow cobradeps check for direct dependency was use one of the possible options that bundler allows on Gemfile, and as group is used to group gems, normally only used with common values (:production, :development and :test) what makes possible for cobradeps checks for group: :direct
This is the Gemfile of app A from the letters example of which you see the graph above.
##TODOs
Copyright (c) 2014 Stephan Hagemann, stephan.hagemann@gmail.com, @shageman
Released under the MIT license. See LICENSE file for details.
FAQs
Unknown package
We found that cobradeps demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.