Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
iss #22: parse include_private_repos from config
Browse files Browse the repository at this point in the history
  • Loading branch information
maizy committed Aug 7, 2014
1 parent 2974c21 commit 3ef3e75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/hedgehog/models/Account.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ trait Account {
protected def baseWebUrl: String = GITHUB_BASE_WEB_URL

def webProfileUrl: String =
s"$baseWebUrl/${urlEncodePathSegment(this.name)}" //FIXME: wtf? ${urlEncodePathSegment(this.name)} == "()"
s"$baseWebUrl/${urlEncodePathSegment(this.name)}"

def getRepoUrl(repo: Repo): String =
s"$webProfileUrl/${urlEncodePathSegment(repo.fullName)}"
Expand Down
10 changes: 8 additions & 2 deletions app/hedgehog/models/Sources.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ object AccountSettings {
def apply(config: ConfigObject): AccountSettings = AccountSettings(config.toConfig)

def apply(config: Config): AccountSettings = {
//TODO: use some typesafe.config wrapper
val isOrg = try {
config.getBoolean("org")
} catch {
Expand All @@ -52,10 +53,15 @@ object AccountSettings {
case e: com.typesafe.config.ConfigException =>
throw new ConfigError(s"wrong 'name' for source: $config")
}
val includePrivate = try {
config.getBoolean("include_private_repos")
} catch {
case e: com.typesafe.config.ConfigException => false
}
if (isOrg) {
new AccountSettings(GithubOrg(name))
new AccountSettings(GithubOrg(name), includePrivate)
} else {
new AccountSettings(GithubUser(name))
new AccountSettings(GithubUser(name), includePrivate)
}
}

Expand Down

0 comments on commit 3ef3e75

Please sign in to comment.