https://github.com/caneroj1/gitgraph
Displays nice graphs of GitHub usage through a Rack App. Can help you analyze things like what languages you most frequently push in, etc.
https://github.com/caneroj1/gitgraph
Last synced: about 1 month ago
JSON representation
Displays nice graphs of GitHub usage through a Rack App. Can help you analyze things like what languages you most frequently push in, etc.
- Host: GitHub
- URL: https://github.com/caneroj1/gitgraph
- Owner: caneroj1
- License: mit
- Created: 2015-03-25T00:26:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-09T15:04:04.000Z (about 10 years ago)
- Last Synced: 2025-04-09T19:53:20.065Z (about 1 month ago)
- Language: Ruby
- Homepage:
- Size: 1.01 MB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitGraph
Displays nice graphs of GitHub usage through a Rack App. Can help you analyze things like what languages you most frequently push in, etc.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'gitGraph'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install gitGraph
## Usage
### Configuration
You can configure GitGraph with just your GitHub username and password:
```ruby
require 'gitGraph'# configuring the client
GitGraph::Configuration.config do |config|
config.username = # your github username
config.password = # your github password
end# your GitGraph client is now all configured to access GitHub's apis
client = GitGraph::GitHub::Client.new
```
Or you can setup your client with an access token as well.```ruby
require 'gitGraph'# configuring the client
GitGraph::Configuration.config do |config|
config.username = # your github username
config.password = # your github password
config.access_token = # your github access token
end
```
### Comparing LanguagesThe following code assumes you have an authenticated client.
```ruby
# start adding GitHub users
client << # some github usernameclient + # another github username
# you can also github users using IDs.
client + 1
client + 537# you can yield the list of users
client.each { |user, name| puts "#{name}: #{user.inspect}" }# let's run a language comparison. this checks all of
# the public repositories for each added user and tallies
# up their language usage.
client.compare_languages(:radar) # using a radar chart# we can change to a bar chart
# the compare languages feature is indexed under
# the :languages key.
client.change_chart_type(:languages, :bar)# let's render our chart
path = # path to where you want the chart
client.render(path)
```### Commits per Day
The following code assumes you have an authenticated client.
```ruby
# start adding GitHub repos
client.add_repo('example/repo') # some github username
client.add_repo('example/repo1')# you can also remove repos
client.remove_repo('example/repo1')# you can yield the list of repos
client.each_repo { |repo| puts repo }# let's compare the commits per day for each repo we added
client.commits # the default is a line chart, you can pass options if you want.# let's render our chart
path = # path to where you want the chart
client.render(path)
```# Pictures
### Compare Languages FeatureExample graph with one user.
![]()
Example graph with one user, with a label.
![]()
Example graph with two users.
![]()
Example graph with two users, with a label.
![]()
### Commits per Day Feature
I decided to use some real repositories to showcase this.
![]()
## Contributing
1. Fork it ( https://github.com/[my-github-username]/gitGraph/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request