Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing slash from html_url if present #64

Merged
merged 3 commits into from
Jun 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/jekyll-github-metadata/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def cname
end

def html_url
@html_url ||= (repo_pages_info["html_url"] || repo_compat.pages_url)
@html_url ||= (repo_pages_info["html_url"] || repo_compat.pages_url).chomp("/")
end

def uri
Expand Down
2 changes: 1 addition & 1 deletion spec/repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

it "uses the html_url" do
expect(repo.html_url).to eql("http://jekyllrb.com")
expect(repo.repo_pages_info["html_url"]).to eql(repo.html_url)
expect(repo.repo_pages_info["html_url"]).to eql("#{repo.html_url}/")
end

it "sees the preview env" do
Expand Down
2 changes: 1 addition & 1 deletion spec/webmock/api_get_jekyll_repo_pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"status": "built",
"cname": "jekyllrb.com",
"custom_404": false,
"html_url": "http://jekyllrb.com"
"html_url": "http://jekyllrb.com/"
}