Class: TeachersPet::Actions::Forks
- Inherits:
-
Base
- Object
- Base
- TeachersPet::Actions::Forks
show all
- Defined in:
- lib/teachers_pet/actions/forks.rb
Instance Attribute Summary
Attributes inherited from Base
#client, #options
Instance Method Summary
collapse
Methods inherited from Base
#execute, #init_client, #initialize, #octokit_config, #read_file, #read_members_file, #read_students_file
Instance Method Details
#get_forks ⇒ Object
10
11
12
|
# File 'lib/teachers_pet/actions/forks.rb', line 10
def get_forks
self.client.forks(self.repository)
end
|
#repository ⇒ Object
6
7
8
|
# File 'lib/teachers_pet/actions/forks.rb', line 6
def repository
self.options[:repository]
end
|
#run ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/teachers_pet/actions/forks.rb', line 14
def run
self.init_client
forks = self.get_forks
CSV.open(self.options[:output], 'wb') do |csv|
forks.each do |fork|
login = fork.owner.login
if fork.owner.type == "User"
csv << [login]
else
puts "Ignoring organization: @#{login}"
end
end
end
end
|