Merge pull request #255 from benbalter/dot-repo

allow repos to have . in name
This commit is contained in:
Ben Balter 2018-01-02 10:44:30 -05:00 committed by GitHub
commit 6f69f10c89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions

View File

@ -12,7 +12,8 @@ module Licensee
class GitHubProject < Licensee::Projects::Project class GitHubProject < Licensee::Projects::Project
# If there's any trailing data (e.g. `.git`) this pattern will ignore it: # If there's any trailing data (e.g. `.git`) this pattern will ignore it:
# we're going to use the API rather than clone the repo. # we're going to use the API rather than clone the repo.
GITHUB_REPO_PATTERN = %r{https://github.com/([^\/]+\/[^\/\.]+).*} GITHUB_REPO_PATTERN =
%r{https://github.com/([^\/]+\/([^\/]+(?=\.git)|[^\/]+)).*}
class RepoNotFound < StandardError; end class RepoNotFound < StandardError; end

View File

@ -61,12 +61,4 @@ RSpec.describe 'command line invocation' do
expect(stdout).to match('License: MIT License') expect(stdout).to match('License: MIT License')
end end
end end
context 'when given a repo URL' do
let(:arguments) { 'https://github.com/benbalter/licensee' }
it "detects the file's license" do
expect(stdout).to match('License: MIT License')
end
end
end end