teachers_pet 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c300e61f054ddd4ec916af88f716e08dc8bc24a
4
- data.tar.gz: d0eb4991d40b937d9f2fee5989918a5ba1925ce9
3
+ metadata.gz: 2d30fbc91197f42ea30df5cd1a1347cc5da3b082
4
+ data.tar.gz: 3f740ae9fab9e2a13a09399db11cc6bc84e57529
5
5
  SHA512:
6
- metadata.gz: e423beea3282c921e4065471b74b9591e9ca28bc68c66775899efb1d76bee7fc25f1ee8c40b2d2b1f3fa9276a75c938ba400298e29d3bd4f7d9fc81a7afbd035
7
- data.tar.gz: bdf26190158c6b1a7a068f65e9a8d5924c110148b84640d61284e948060fb1cff2758094d6423a8e6c9f9c2f80130ee9baf520d8aad91c994301bc0d6feb7180
6
+ metadata.gz: 9af701ab906d0122f95778c8c0096dcbd4a9b22326d01b028d18dd1e2e01962944e90c96f19436c4e529a5d56efe749ca2c7911457c36b752e709b4c11acba49
7
+ data.tar.gz: e6ac88733408986a70c83fb5e7a6cdc131510f8a8a82c9b42d25cf1399c18309d425ada3c37c57f20c9e7deba78ce6c842416686ae90bc2fbacf4bccbb7315b5
data/bin/forkcollab ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'io/console'
4
+ require 'octokit'
5
+
6
+ puts "Create a personal access token: https://github.com/settings/applications"
7
+ print "Token: "
8
+ token = STDIN.noecho(&:gets).chomp
9
+ puts
10
+
11
+ print "Repository (name/owner): "
12
+ nwo = gets.chomp
13
+
14
+ client = Octokit::Client.new :access_token => token
15
+
16
+ forks = client.forks(nwo)
17
+
18
+ puts "Are you sure you want to add #{forks.count} users as collaborators on '#{nwo}'?"
19
+ print "Please type the name of the repository to confirm: "
20
+ confirm = gets.chomp
21
+
22
+ if confirm == nwo
23
+ forks.each do |fork|
24
+ if fork.owner.type == "User"
25
+ result = client.add_collab(nwo, fork.owner)
26
+ puts "#{fork.owner.login} - #{result}"
27
+ else
28
+ puts "#{fork.owner.login} - false (Organization)"
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module TeachersPet
2
- VERSION = '0.0.0'
2
+ VERSION = '0.0.1'
3
3
  end
data/teachers_pet.gemspec CHANGED
@@ -11,6 +11,10 @@ Gem::Specification.new do |s|
11
11
  s.license = 'MIT'
12
12
 
13
13
  s.files = `git ls-files`.split $/
14
+ s.require_paths = ['lib']
15
+
16
+ s.bindir = 'bin'
17
+ s.executables << 'forkcollab'
14
18
 
15
19
  s.add_dependency 'octokit'
16
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teachers_pet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Britton
@@ -26,11 +26,13 @@ dependencies:
26
26
  version: '0'
27
27
  description: A simple hello world gem
28
28
  email: public@johndbritton.com
29
- executables: []
29
+ executables:
30
+ - forkcollab
30
31
  extensions: []
31
32
  extra_rdoc_files: []
32
33
  files:
33
34
  - .gitignore
35
+ - bin/forkcollab
34
36
  - lib/teachers_pet.rb
35
37
  - lib/teachers_pet/version.rb
36
38
  - teachers_pet.gemspec