This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
package grepgit.core | |
import scala.collection.mutable | |
import scala.reflect.ClassTag | |
/** | |
* A Generator of elements of type [[A]]. | |
* | |
* [[Generator]] is basically the inverse of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.reflect.runtime.universe._ | |
import scala.util.{Failure, Success, Try} | |
object CompanionTypeSystem { | |
def apply[SealedClass: TypeTag, Companion: TypeTag](fBoundedType: String): Set[Companion] = { | |
val sealedClassType = typeOf[SealedClass] | |
val companionType = typeOf[Companion] | |
val upperBound = sealedClassType | |
val refineCompanionWithTypeParameter = getTypeWithTypeParameterOrElseCheckTypeMember(companionType, fBoundedType, upperBound, isSelfRecursive = false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io._ | |
import java.util.zip.{GZIPInputStream, GZIPOutputStream} | |
import org.apache.commons.compress.archivers.tar.{TarArchiveInputStream, TarArchiveEntry, TarArchiveOutputStream} | |
import org.apache.commons.io.{IOUtils, FileUtils} | |
object IO { | |
def addToArchive(tarArchive: TarArchiveOutputStream, file: File, base: String = ""): Unit = { | |
val entryName = base + file.getName | |
val entry = new TarArchiveEntry(file, entryName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* We've run into a few common pitfalls when dealing with Futures in Scala, so I wrote these three helpful | |
* classes to give some baked-in functionality. | |
* | |
* I'd love to hear about other helpers you're using like these, or if you have improvement suggestions. | |
* [email protected] / @connerdelights | |
*/ | |
import scala.concurrent.{ExecutionContext, CanAwait, Awaitable, Future, Promise} | |
import scala.concurrent.duration.Duration | |
import scala.util.Try |