New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

get_root

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get_root

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

GetRoot

This is essentially written for RuboCop::Packaging to get the root directory of your git repository at runtime.

This only works on a git repository. Otherwise this won't work, because it essentially looks for the presence of a .git directory.

Installation

Add this line to your application's Gemfile:

gem 'get_root'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install get_root

Usage

You can use get_root for your project in the following way:

require 'get_root'

root_path = GetRoot.path  # or GetRoot::path

Here's a snippet to see how it runs/behaves:

irb(main):001:0> require 'get_root'
=> true

irb(main):002:0> Dir.pwd  # to show the current directory.
=> "/home/utkarsh/github/rubocop-packaging/spec/rubocop/cop/packaging"

irb(main):003:0> GetRoot.path  # to get the root direcotry of this project
=> "/home/utkarsh/github/rubocop-packaging"

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.
To install this gem onto your local machine, run bundle exec rake install.

Contributing

As always, bug reports and pull requests are heartily welcomed! 💖
This project is intended to be a safe and welcoming space for collaboration.

License

get_root is available as open-source under the MIT License.

FAQs

Package last updated on 09 Jul 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc