Skip to content

Commit

Permalink
#2 HTTPS for git
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 15, 2017
1 parent afd9a09 commit c7f82d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/tdx/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,17 @@ def tests(path)
end

def issues(commits)
dates = if @uri.start_with?('git@')
dates = if @uri.include?('github.com')
client = if @opts[:login]
Octokit::Client.new(login: @opts[:login], password: @opts[:password])
else
Octokit::Client.new
end
repo = @uri.gsub(/^git@github.com:|.git$/, '')
repo = if @uri.start_with?('git@')
@uri.gsub(/^git@github\.com:|\.git$/, '')
else
@uri.gsub(%r{^https://github\.com/|\.git$}, '')
end
client.list_issues(repo, state: :all).map(&:created_at)
else
[]
Expand Down
2 changes: 1 addition & 1 deletion test/test_tdx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_git_repo
def test_real_github_repo
assert(
TDX::Base.new(
'git@github.com:yegor256/tdx.git', opts([])
'https://github.com/yegor256/tdx.git', opts([])
).svg.include?('<path ')
)
end
Expand Down

0 comments on commit c7f82d4

Please sign in to comment.