Skip to content

georgedrummond/github_analyze

Repository files navigation

Build Status Gem Version

github_analyze

This gem reports the most or least popular languages used in a GitHub organization.

Installation

Add this line to your application's Gemfile:

gem 'github_analyze'

And then execute:

$ bundle

Or install it yourself as:

$ gem install github_analyze

Usage

First create a GitHub authentication token

require 'github_analyze'

# Create an instance GithubAnalyze::Client
client = GithubAnalyze::Client.new(
  github_authentication_token: 'GITHUB_AUTHENTICATION_TOKEN'
)

# Look up an organization
organization = client.organization(name: 'github')

# Find out the most popular languages used in that organization
organization.most_common_languages 
# => [
#   'Ruby', 
#   'JavaScript', 
#   'Go', 
#   'C', 
#   'Shell'
# ]

# Find least common languages used in that organization
organization.least_common_languages 
# => [
#   'Clojure', 
#   'Perl', 
#   'PowerShell', 
#   'Ragel in Ruby Host', 
#   'Scala'
# ]

organization.ranked_languages
# => {
#   'Ruby' => 98,
#   'JavaScript' => 63,
#   'Go' => 19,
#   'C' => 17,
#   'Shell' => 15,
#   'Objective-C' => 10,
#   'HTML' => 9,
#   'Python' => 9,
#   'C#' => 6,
#   'CSS' => 6,
#   'CoffeeScript' => 6,
#   'Java' => 6,
#   'Puppet' => 3,
#   'Swift' => 3,
#   'C++' => 2,
#   'Haskell' => 2,
#   'TypeScript' => 2,
#   'Clojure' => 1,
#   'Perl' => 1,
#   'PowerShell' => 1,
#   'Ragel in Ruby Host' => 1,
#   'Scala' => 1
# }

Command Line

Run the github_analyze help command to see command line options

Generate CSV export of repositories

gem install github_analyze
GITHUB_AUTHENTICATION_TOKEN=changeme github_analyze csv google /tmp/report.csv
cat /tmp/report.csv

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/georgedrummond/github_analyze. 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.

Code of Conduct

Everyone interacting in the Stackshare project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

:octocat: Find the most popular languages used in a GitHub organization

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published