Skip to content

Commit cef2620

Browse files
nathosjonico
authored andcommitted
Update the graph rendering example to support Octokit >2.0 (#146)
* Update Gemfile with newer dependency versions * Update to use access_token config option * Revert environment variables to their previous values * Update comment/exmample environment variables to be less confusing * Revert "Update comment/exmample environment variables to be less confusing" This reverts commit 50191ab. * Revert "Revert environment variables to their previous values" This reverts commit 5594477.
1 parent 4121752 commit cef2620

File tree

3 files changed

+49
-42
lines changed

3 files changed

+49
-42
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "http://rubygems.org"
22

3-
gem "json", "~> 1.8"
4-
gem 'sinatra', '~> 1.3.5'
5-
gem 'sinatra_auth_github', '~> 0.13.3'
6-
gem 'octokit', '~> 1.23.0'
3+
gem "json", "~>2.1.0"
4+
gem "sinatra", "~>1.4.8"
5+
gem "sinatra_auth_github", "~>1.2.0"
6+
gem "octokit", "~>4.7.0"
Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,55 @@
11
GEM
22
remote: http://rubygems.org/
33
specs:
4-
addressable (2.3.3)
5-
faraday (0.8.6)
6-
multipart-post (~> 1.1)
7-
faraday_middleware (0.9.0)
8-
faraday (>= 0.7.4, < 0.9)
9-
hashie (1.2.0)
10-
json (1.8.3)
11-
multi_json (1.6.1)
12-
multipart-post (1.2.0)
13-
netrc (0.7.7)
14-
octokit (1.23.0)
15-
addressable (~> 2.2)
16-
faraday (~> 0.8)
17-
faraday_middleware (~> 0.9)
18-
hashie (~> 1.2)
19-
multi_json (~> 1.3)
20-
netrc (~> 0.7.7)
21-
rack (1.5.2)
22-
rack-protection (1.4.0)
4+
activesupport (5.1.3)
5+
concurrent-ruby (~> 1.0, >= 1.0.2)
6+
i18n (~> 0.7)
7+
minitest (~> 5.1)
8+
tzinfo (~> 1.1)
9+
addressable (2.5.2)
10+
public_suffix (>= 2.0.2, < 4.0)
11+
concurrent-ruby (1.0.5)
12+
faraday (0.13.1)
13+
multipart-post (>= 1.2, < 3)
14+
i18n (0.8.6)
15+
json (2.1.0)
16+
minitest (5.10.3)
17+
multipart-post (2.0.0)
18+
octokit (4.7.0)
19+
sawyer (~> 0.8.0, >= 0.5.3)
20+
public_suffix (3.0.0)
21+
rack (1.6.8)
22+
rack-protection (1.5.3)
2323
rack
24-
sinatra (1.3.5)
25-
rack (~> 1.4)
26-
rack-protection (~> 1.3)
27-
tilt (~> 1.3, >= 1.3.3)
28-
sinatra_auth_github (0.13.3)
24+
sawyer (0.8.1)
25+
addressable (>= 2.3.5, < 2.6)
26+
faraday (~> 0.8, < 1.0)
27+
sinatra (1.4.8)
28+
rack (~> 1.5)
29+
rack-protection (~> 1.4)
30+
tilt (>= 1.3, < 3)
31+
sinatra_auth_github (1.2.0)
2932
sinatra (~> 1.0)
30-
warden-github (~> 0.13.1)
31-
tilt (1.3.4)
32-
warden (1.2.1)
33+
warden-github (~> 1.2.0)
34+
thread_safe (0.3.6)
35+
tilt (2.0.8)
36+
tzinfo (1.2.3)
37+
thread_safe (~> 0.1)
38+
warden (1.2.7)
3339
rack (>= 1.0)
34-
warden-github (0.13.2)
35-
octokit (>= 1.22.0)
40+
warden-github (1.2.0)
41+
activesupport (> 3.0)
42+
octokit (> 2.1.0)
3643
warden (> 1.0)
3744

3845
PLATFORMS
3946
ruby
4047

4148
DEPENDENCIES
42-
json (~> 1.8)
43-
octokit (~> 1.23.0)
44-
sinatra (~> 1.3.5)
45-
sinatra_auth_github (~> 0.13.3)
49+
json (~> 2.1.0)
50+
octokit (~> 4.7.0)
51+
sinatra (~> 1.4.8)
52+
sinatra_auth_github (~> 1.2.0)
4653

4754
BUNDLED WITH
48-
1.11.2
55+
1.15.4

api/ruby/rendering-data-as-graphs/server.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class MyGraphApp < Sinatra::Base
1010
# CLIENT_SECRET = ENV['GITHUB_CLIENT_SECRET']
1111
# end
1212

13-
CLIENT_ID = ENV['GH_GRAPH_CLIENT_ID']
14-
CLIENT_SECRET = ENV['GH_GRAPH_SECRET_ID']
13+
CLIENT_ID = ENV['GITHUB_CLIENT_ID']
14+
CLIENT_SECRET = ENV['GITHUB_CLIENT_SECRET']
1515

1616
enable :sessions
1717

@@ -28,7 +28,7 @@ class MyGraphApp < Sinatra::Base
2828
if !authenticated?
2929
authenticate!
3030
else
31-
octokit_client = Octokit::Client.new(:login => github_user.login, :oauth_token => github_user.token)
31+
octokit_client = Octokit::Client.new(:login => github_user.login, :access_token => github_user.token)
3232
repos = octokit_client.repositories
3333
language_obj = {}
3434
repos.each do |repo|
@@ -79,4 +79,4 @@ class MyGraphApp < Sinatra::Base
7979
end
8080
end
8181
end
82-
end
82+
end

0 commit comments

Comments
 (0)