librariesio/repo_miner

Name: repo_miner

Owner: Libraries.io

Description: :pick: Mine repositories for interesting changes over time

Created: 2017-07-11 15:23:37.0

Updated: 2018-03-29 09:40:25.0

Pushed: 2018-03-29 09:40:24.0

Homepage: https://rubygems.org/gems/repo_miner

Size: 75

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

RepoMiner

Build Status Code Climate Test Coverage Code Climate license

RepoMiner is a ruby library designed to mine time sensitive information from git repositories. Things like:

This is a new and incomplete project that's under active development.

I'll be live streaming some of the development of this project on twitch: https://www.twitch.tv/andrew_nesbitt

Installation

Add this line to your application's Gemfile:

'repo_miner'

And then execute:

$ bundle

Or install it yourself as:

$ gem install repo_miner
Usage

Make a new repository:

sitory = RepoMiner::Repository.new('/path/to/git/repo')

Analyse all commits for a given branch:

its = repository.analyse('master')

See mined dependency data for a given commit:

its.length #=> 34

its.last #=> <RepoMiner::Commit:0x007fd87fdf1150(message: "Fixes 1597", sha: c656e48ada19c6c83f7705893f0a73cfc1844abf, data: {:email=>{:committer=>"andrewnez@gmail.com", :author=>"andrewnez@gmail.com"}, :dependencies=>{:added_manifests=>[], :modified_manifests=>[{:path=>"Gemfile", :platform=>"rubygems", :added_dependencies=>[], :modified_dependencies=>[], :removed_dependencies=>[{:name=>"sass", :requirement=>"= 3.4.24", :type=>:runtime}]}, {:path=>"Gemfile.lock", :platform=>"rubygems", :added_dependencies=>[{:name=>"sass-listen", :requirement=>"4.0.0", :type=>"runtime"}], :modified_dependencies=>[{:name=>"commonmarker", :requirement=>"0.16.8", :type=>"runtime", :previous_requirement=>"0.16.7"}, {:name=>"gitlab", :requirement=>"4.2.0", :type=>"runtime", :previous_requirement=>"4.1.0"}, {:name=>"rack-cors", :requirement=>"1.0.0", :type=>"runtime", :previous_requirement=>"0.4.1"}, {:name=>"sass", :requirement=>"3.5.1", :type=>"runtime", :previous_requirement=>"3.4.24"}, {:name=>"sassc", :requirement=>"1.11.4", :type=>"runtime", :previous_requirement=>"1.11.2"}], :removed_dependencies=>[]}], :removed_manifests=>[]}})>

You can also skip commits that you've already analysed:

its = repository.analyse('master', '00e7221')
its.length # => 9
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. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/librariesio/repo_miner. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.