Fucked up last commit
This commit is contained in:
parent
2a5f12c16d
commit
0f8f0cf620
|
@ -2,24 +2,23 @@ module Project::GithubApi
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
def github_data
|
||||
Github.repos.get user: org, repo: name rescue nil
|
||||
Github.repos.get user: github_get_organization, repo: name rescue nil
|
||||
end
|
||||
|
||||
def github_branches
|
||||
Github.repos.branches user: org, repo: name rescue nil
|
||||
Github.repos.branches user: github_get_organization, repo: name rescue nil
|
||||
end
|
||||
|
||||
def github_tags
|
||||
Github.repos.tags user: org, repo: name rescue nil
|
||||
Github.repos.tags user: github_get_organization, repo: name rescue nil
|
||||
end
|
||||
|
||||
def github_get_commit(hash)
|
||||
Github.repos.commits.list user: org, repo: name, sha: hash rescue nil
|
||||
Github.repos.commits.list user: github_get_organization, repo: name, sha: hash rescue nil
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def org
|
||||
github_organization || APP_CONFIG["github_organization"]
|
||||
def github_get_organization
|
||||
return APP_CONFIG['github_organization'] if github_organization.empty?
|
||||
github_organization
|
||||
end
|
||||
end
|
|
@ -1,4 +1,4 @@
|
|||
=render 'submenu'
|
||||
.col-xs-12.col-md-10.col-md-offset-1
|
||||
.row
|
||||
.alert.alert-danger.text-center=t('layout.projects.no_github_repo_error', organization:@project.github_data || APP_CONFIG['github_organization'])
|
||||
.alert.alert-danger.text-center=t('layout.projects.no_github_repo_error', organization:@project.github_get_organization)
|
|
@ -1,6 +1,7 @@
|
|||
#configuration of Github api gem
|
||||
|
||||
Github.configure do |c|
|
||||
puts ENV["GITHUB_LOGIN"]
|
||||
c.basic_auth = ENV["GITHUB_LOGIN"] + ":" + ENV["GITHUB_PASSWORD"]
|
||||
c.auto_pagination = true
|
||||
c.stack do |builder|
|
||||
|
|
Loading…
Reference in New Issue