module Ruboty::Capistrano::GitHubRepositoryValidator
Public Class Methods
included(klass)
click to toggle source
# File lib/ruboty/capistrano/github_repository_validators.rb, line 3 def self.included(klass) raise 'wrong include error' unless klass.ancestors.include?(Ruboty::Actions::Base) end
Public Instance Methods
validates()
click to toggle source
# File lib/ruboty/capistrano/github_repository_validators.rb, line 7 def validates !!github_client.branch(repo, branch) rescue Octokit::NotFound => e errors << e.message false end
Private Instance Methods
github_client()
click to toggle source
# File lib/ruboty/capistrano/github_repository_validators.rb, line 16 def github_client Octokit::Client.new(access_token: Ruboty::Capistrano.config.github_access_token) end
repo()
click to toggle source
# File lib/ruboty/capistrano/github_repository_validators.rb, line 20 def repo Ruboty::Capistrano.config.remote_repo_path[role] end