Skip to content

Commit

Permalink
Rename GitHubPlugin to SourceLinkPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
srmagura committed Oct 24, 2021
1 parent 89537bc commit 8c44bb3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Expand Up @@ -49,17 +49,17 @@ export class Repository {
project?: string;

/**
* The hostname for this GitHub or Bitbucket project.
* The hostname for this GitHub/Bitbucket/.etc project.
*
* Defaults to: `github.com` (for normal, public GitHub instance projects)
*
* Or the hostname for an enterprise version of GitHub, e.g. `github.acme.com`
* Can be the hostname for an enterprise version of GitHub, e.g. `github.acme.com`
* (if found as a match in the list of git remotes).
*/
hostname = "github.com";

/**
* Whether this is a GitHub or Bitbucket repository.
* Whether this is a GitHub, Bitbucket, or other type of repository.
*/
type: RepositoryType = RepositoryType.GitHub;

Expand Down Expand Up @@ -201,8 +201,8 @@ export class Repository {
* A handler that watches for repositories with GitHub origin and links
* their source files to the related GitHub pages.
*/
@Component({ name: "git-hub" })
export class GitHubPlugin extends ConverterComponent {
@Component({ name: "source-link" })
export class SourceLinkPlugin extends ConverterComponent {
/**
* List of known repositories.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/index.ts
@@ -1,7 +1,7 @@
export { CategoryPlugin } from "./CategoryPlugin";
export { CommentPlugin } from "./CommentPlugin";
export { DecoratorPlugin } from "./DecoratorPlugin";
export { GitHubPlugin } from "./GitHubPlugin";
export { SourceLinkPlugin } from "./SourceLinkPlugin";
export { GroupPlugin } from "./GroupPlugin";
export { ImplementsPlugin } from "./ImplementsPlugin";
export { PackagePlugin } from "./PackagePlugin";
Expand Down
@@ -1,11 +1,11 @@
import * as github from "../lib/converter/plugins/GitHubPlugin";
import { Repository } from "../lib/converter/plugins/SourceLinkPlugin";
import { RepositoryType } from "../lib/models";
import { strictEqual as equal } from "assert";

describe("Repository", function () {
describe("constructor", function () {
it("defaults to github.com hostname", function () {
const repository = new github.Repository("", "", []);
const repository = new Repository("", "", []);

equal(repository.hostname, "github.com");
equal(repository.type, RepositoryType.GitHub);
Expand All @@ -14,7 +14,7 @@ describe("Repository", function () {
it("handles a personal GitHub HTTPS URL", function () {
const mockRemotes = ["https://github.com/joebloggs/foobar.git"];

const repository = new github.Repository("", "", mockRemotes);
const repository = new Repository("", "", mockRemotes);

equal(repository.hostname, "github.com");
equal(repository.user, "joebloggs");
Expand All @@ -25,7 +25,7 @@ describe("Repository", function () {
it("handles an enterprise GitHub URL", function () {
const mockRemotes = ["git@github.acme.com:joebloggs/foobar.git"];

const repository = new github.Repository("", "", mockRemotes);
const repository = new Repository("", "", mockRemotes);

equal(repository.hostname, "github.acme.com");
equal(repository.user, "joebloggs");
Expand All @@ -38,7 +38,7 @@ describe("Repository", function () {
"ssh://org@bigcompany.githubprivate.com/joebloggs/foobar.git",
];

const repository = new github.Repository("", "", mockRemotes);
const repository = new Repository("", "", mockRemotes);

equal(repository.hostname, "bigcompany.githubprivate.com");
equal(repository.user, "joebloggs");
Expand All @@ -51,7 +51,7 @@ describe("Repository", function () {
"https://joebloggs@bitbucket.org/joebloggs/foobar.git",
];

const repository = new github.Repository("", "", mockRemotes);
const repository = new Repository("", "", mockRemotes);

equal(repository.hostname, "bitbucket.org");
equal(repository.user, "joebloggs");
Expand All @@ -62,7 +62,7 @@ describe("Repository", function () {
it("handles a Bitbucket SSH URL", function () {
const mockRemotes = ["git@bitbucket.org:joebloggs/foobar.git"];

const repository = new github.Repository("", "", mockRemotes);
const repository = new Repository("", "", mockRemotes);

equal(repository.hostname, "bitbucket.org");
equal(repository.user, "joebloggs");
Expand All @@ -78,7 +78,7 @@ describe("Repository", function () {
it("returns a GitHub URL", function () {
const mockRemotes = ["https://github.com/joebloggs/foobar.git"];

const repository = new github.Repository(
const repository = new Repository(
repositoryPath,
"main",
mockRemotes
Expand All @@ -96,7 +96,7 @@ describe("Repository", function () {
"https://joebloggs@bitbucket.org/joebloggs/foobar.git",
];

const repository = new github.Repository(
const repository = new Repository(
repositoryPath,
"main",
mockRemotes
Expand Down

0 comments on commit 8c44bb3

Please sign in to comment.