Skip to content

Commit 9826a5b

Browse files
committed
Add the working-with-comments samples
1 parent 27fcc94 commit 9826a5b

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "http://rubygems.org"
2+
3+
gem "octokit", "~> 2.0"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
GEM
2+
remote: http://rubygems.org/
3+
specs:
4+
faraday (0.8.8)
5+
multipart-post (~> 1.2.0)
6+
multipart-post (1.2.0)
7+
octokit (2.1.1)
8+
sawyer (~> 0.3.0)
9+
sawyer (0.3.0)
10+
faraday (~> 0.8, < 0.10)
11+
uri_template (~> 0.5.0)
12+
uri_template (0.5.3)
13+
14+
PLATFORMS
15+
ruby
16+
17+
DEPENDENCIES
18+
octokit (~> 2.0)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'octokit'
2+
3+
# !!! DO NOT EVER USE HARD-CODED VALUES IN A REAL APP !!!
4+
# Instead, set and test environment variables, like below
5+
client = Octokit::Client.new :access_token => ENV['MY_PERSONAL_TOKEN']
6+
7+
client.commit_comments("octocat/Spoon-Knife", "cbc28e7c8caee26febc8c013b0adfb97a4edd96e").each do |comment|
8+
username = comment[:user][:login]
9+
post_date = comment[:created_at]
10+
content = comment[:body]
11+
12+
puts "#{username} made a comment on #{post_date}. It says:\n'#{content}'\n"
13+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'octokit'
2+
3+
# !!! DO NOT EVER USE HARD-CODED VALUES IN A REAL APP !!!
4+
# Instead, set and test environment variables, like below
5+
client = Octokit::Client.new :access_token => ENV['MY_PERSONAL_TOKEN']
6+
7+
client.pull_request_comments("octocat/Spoon-Knife", 1176).each do |comment|
8+
username = comment[:user][:login]
9+
post_date = comment[:created_at]
10+
content = comment[:body]
11+
12+
puts "#{username} made a comment on #{post_date}. It says:\n'#{content}'\n"
13+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'octokit'
2+
3+
# !!! DO NOT EVER USE HARD-CODED VALUES IN A REAL APP !!!
4+
# Instead, set and test environment variables, like below
5+
client = Octokit::Client.new :access_token => ENV['MY_PERSONAL_TOKEN']
6+
7+
client.issue_comments("octocat/Spoon-Knife", 1176).each do |comment|
8+
username = comment[:user][:login]
9+
post_date = comment[:created_at]
10+
content = comment[:body]
11+
12+
puts "#{username} made a comment on #{post_date}. It says:\n'#{content}'\n"
13+
end

0 commit comments

Comments
 (0)