Welcome to mirror list, hosted at ThFree Co, Russian Federation.

RepositoryId.scala « util « github « no_carrier « getbootstrap « com « scala « main « src - github.com/twbs/no-carrier.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d870b6233d1fb1359cd8096bda5c9dde8d191b25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package com.getbootstrap.no_carrier.github.util

import com.jcabi.github.Coordinates.{Simple=>RepoId}

object RepositoryId {
  private val OwnerSlashRepo = "([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)".r

  def unapply(ownerRepo: String): Option[RepoId] = {
    ownerRepo match {
      case OwnerSlashRepo(owner, repo) => Some(new RepoId(owner, repo))
      case _ => None
    }
  }
}