Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 3 files changed
  • 0 comments
  • 1 contributor

Showing 3 changed files with 16 additions and 7 deletions. Show diff stats Hide diff stats

  1. +0 4 Gemfile.lock
  2. +5 0 lib/access_token.rb
  3. +11 3 lib/githubviz.rb
4 Gemfile.lock
@@ -3,13 +3,9 @@ GEM
3 3 specs:
4 4 daemons (1.1.6)
5 5 eventmachine (0.12.10)
6   - json (1.5.4)
7   - mime-types (1.17.2)
8 6 rack (1.4.1)
9 7 rack-protection (1.2.0)
10 8 rack
11   - rest-client (1.6.7)
12   - mime-types (>= 1.16)
13 9 sinatra (1.3.2)
14 10 rack (~> 1.3, >= 1.3.6)
15 11 rack-protection (~> 1.2)
5 lib/access_token.rb
... ... @@ -0,0 +1,5 @@
  1 +class TOKEN
  2 + def get_token
  3 + @access = 'ACCESSTOKEN'
  4 + end
  5 +end
14 lib/githubviz.rb
@@ -6,6 +6,7 @@
6 6 class GithubViz < Sinatra::Base
7 7
8 8 require 'github-v3-api.rb'
  9 +require 'access_token.rb'
9 10
10 11 set :public_directory, Proc.new { File.join(root, "public") }
11 12 set :public_folder, File.dirname(__FILE__) + '/public'
@@ -66,7 +67,8 @@ def process_data
66 67
67 68 if @user
68 69
69   - @api = GitHubV3API.new(ACCESSTOKEN)
  70 + @token = TOKEN.new
  71 + @api = GitHubV3API.new(@token.get_token)
70 72
71 73 @data[@user] = @api.get("/users/#{@user}")
72 74 @data[@user]['level'] = 0
@@ -80,7 +82,10 @@ def process_data
80 82
81 83 get '/repo_viz' do
82 84 @user = params[:user]
83   - @api = GitHubV3API.new(ACCESSTOKEN)
  85 +
  86 + @token = TOKEN.new
  87 + @api = GitHubV3API.new(@token.get_token)
  88 +
84 89 user_data = @api.users.get(@user)
85 90 my_repos = @api.repos.list
86 91 page = 1
@@ -175,7 +180,10 @@ def process_data
175 180 end
176 181
177 182 get '/circle_viz' do
178   - @api = GitHubV3API.new(ACCESSTOKEN)
  183 +
  184 + @token = TOKEN.new
  185 + @api = GitHubV3API.new(@token.get_token)
  186 +
179 187 @user = params[:user]
180 188 user_data = @api.users.get(@user)
181 189 #@data[@user] = @api.get("/users/#{@user}")

No commit comments for this range

Something went wrong with that request. Please try again.