Class: TeachersPet::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/teachers_pet/cli.rb,
lib/teachers_pet/commands/forks.rb,
lib/teachers_pet/commands/open_issue.rb,
lib/teachers_pet/commands/push_files.rb,
lib/teachers_pet/commands/add_to_team.rb,
lib/teachers_pet/commands/clone_repos.rb,
lib/teachers_pet/commands/create_repos.rb,
lib/teachers_pet/commands/add_collaborators.rb,
lib/teachers_pet/commands/merge_pull_requests.rb,
lib/teachers_pet/commands/create_student_teams.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.common_optionsObject

TODO figure out a way to display options as groups


7
8
9
10
11
12
13
14
15
16
# File 'lib/teachers_pet/cli.rb', line 7

def self.common_options
  check_unknown_options!

  option :username, default: ENV['USER']
  option :password
  option :token, default: ENV['TEACHERS_PET_GITHUB_TOKEN'], desc: "Provide a token instead of a username+password to authenticate via OAuth. See https://github.com/education/teachers_pet#authentication."

  option :api, banner: 'ORIGIN', default: Configuration.apiEndpoint, desc: "The API endpoint of your GitHub Enterprise instance, if you have one."
  option :web, banner: 'ORIGIN', default: Configuration.webEndpoint, desc: "The URL of your GitHub Enterprise instance, if you have one."
end

.students_optionObject


18
19
20
# File 'lib/teachers_pet/cli.rb', line 18

def self.students_option
  option :students, default: TeachersPet::Configuration.studentsFile, banner: 'PATH', desc: "The path to the file containing the list of students"
end

Instance Method Details

#add_collaboratorsObject


9
10
11
# File 'lib/teachers_pet/commands/add_collaborators.rb', line 9

def add_collaborators
  TeachersPet::Actions::AddCollaborators.new(options).run
end

#add_to_teamObject


9
10
11
# File 'lib/teachers_pet/commands/add_to_team.rb', line 9

def add_to_team
  TeachersPet::Actions::AddToTeam.new(options).run
end

#clone_reposObject


11
12
13
# File 'lib/teachers_pet/commands/clone_repos.rb', line 11

def clone_repos
  TeachersPet::Actions::CloneRepos.new(options).run
end

#create_reposObject


11
12
13
# File 'lib/teachers_pet/commands/create_repos.rb', line 11

def create_repos
  TeachersPet::Actions::CreateRepos.new(options).run
end

#create_student_teamsObject


9
10
11
# File 'lib/teachers_pet/commands/create_student_teams.rb', line 9

def create_student_teams
  TeachersPet::Actions::CreateStudentTeams.new(options).run
end

#forksObject


8
9
10
# File 'lib/teachers_pet/commands/forks.rb', line 8

def forks
  TeachersPet::Actions::Forks.new(options).run
end

#merge_pull_requestsObject


7
8
9
# File 'lib/teachers_pet/commands/merge_pull_requests.rb', line 7

def merge_pull_requests
  TeachersPet::Actions::MergePullRequests.new(options).run
end

#open_issueObject


14
15
16
# File 'lib/teachers_pet/commands/open_issue.rb', line 14

def open_issue
  TeachersPet::Actions::OpenIssue.new(options).run
end

#push_filesObject


11
12
13
# File 'lib/teachers_pet/commands/push_files.rb', line 11

def push_files
  TeachersPet::Actions::PushFiles.new(options).run
end