repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
ithinkicancode/shapesafe | core/src/test/scala/org/shapesafe/core/ProofSystemTest.scala | package org.shapesafe.core
import org.shapesafe.BaseSpec
object ProofSystemTest {
trait Conj
case class Simple(name: String) extends Conj
object TestSys extends ProofSystem[Conj]
import TestSys._
import Factory._
case class P0() extends Conj
object P0 {
implicit def axiom: P0 =>> Simple = for... |
ithinkicancode/shapesafe | core/src/test/scala/org/shapesafe/core/shape/LeafShapeSpike.scala | package org.shapesafe.core.shape
import org.scalatest.Ignore
import org.shapesafe.BaseSpec
import org.shapesafe.core.arity.Const
import org.shapesafe.graph.commons.util.debug.print_@
import org.shapesafe.graph.commons.util.viz.TypeViz
import shapeless.{HNil, Witness}
@Ignore
class LeafShapeSpike extends BaseSpec {
... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/arity/Var.scala | <filename>core/src/main/scala/org/shapesafe/core/arity/Var.scala
package org.shapesafe.core.arity
case class Var(runtimeArity: Int) extends LeafArity {}
object Var {}
|
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/debugging/Expressions_Imp0.scala | <reponame>ithinkicancode/shapesafe
package org.shapesafe.core.debugging
import org.shapesafe.core.debugging.DebugSymbol.{On1, On2}
trait Expressions_Imp0 {
type Expr[T <: CanPeek] = T#_AsExpr // with T
trait :<<-[A, B]
trait ><[A, B]
// trait Infix[A, S, B] extends (A ~~ Only[S] ~~ B)
// trait PrefixW1... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/shape/LeafShape.scala | <gh_stars>1-10
package org.shapesafe.core.shape
import org.shapesafe.core.arity.Utils.NatAsOp
import org.shapesafe.core.arity.{Arity, ArityAPI, Const, LeafArity}
import org.shapesafe.core.axis.Axis
import org.shapesafe.core.axis.Axis.{->>, :<<-}
import org.shapesafe.core.tuple.{CanFromStatic, StaticTuples, TupleSystem... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/shape/unary/UnaryIndexingFn.scala | <reponame>ithinkicancode/shapesafe
package org.shapesafe.core.shape.unary
import org.shapesafe.core.Poly1Base
import org.shapesafe.core.axis.Axis.UB_->>
import org.shapesafe.core.axis.NewNameAppender
import org.shapesafe.core.shape.{LeafShape, Names, Shape}
import org.shapesafe.m.viz.TypeVizCT
import shapeless.{::, HL... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/shape/unary/Conjecture1.scala | package org.shapesafe.core.shape.unary
import org.shapesafe.core.shape.{Shape, ShapeConjecture}
trait Conjecture1 extends ShapeConjecture {
type SS1 <: Shape
}
object Conjecture1 {
trait ^[S1 <: Shape] extends Conjecture1 {
final type SS1 = S1
}
// object Refute1 extends ShapeReporters.RefuteReporter[... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/arity/Const.scala | <reponame>ithinkicancode/shapesafe
package org.shapesafe.core.arity
import org.shapesafe.graph.commons.util.IDMixin
import org.shapesafe.core.arity.Utils.Op
import shapeless.Witness
import singleton.ops.{==, Require, ToString}
trait Const[S] extends LeafArity with IDMixin {
type SS = S
def singleton: S
overri... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/shape/Index.scala | package org.shapesafe.core.shape
import org.shapesafe.graph.commons.util.IDMixin
import org.shapesafe.graph.commons.util.reflect.format.FormatOvrd.Only
import org.shapesafe.core.debugging.CanPeek
import org.shapesafe.core.debugging.DebugUtil.StrOrRaw
import shapeless.ops.nat.ToInt
import shapeless.{Nat, Witness}
impor... |
ithinkicancode/shapesafe | verify/breeze/src/main/scala/org/shapesafe/breeze/tensor/DoubleVector.scala | <filename>verify/breeze/src/main/scala/org/shapesafe/breeze/tensor/DoubleVector.scala
package org.shapesafe.breeze.tensor
import breeze.linalg.DenseVector
import breeze.signal
import org.shapesafe.core.arity.Const.Literal
import org.shapesafe.core.arity.ProveArity.{|-, |-<}
import org.shapesafe.core.arity.nullary.Size... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/shape/Dimensions.scala | package org.shapesafe.core.shape
import org.shapesafe.core.arity.Arity
import org.shapesafe.core.tuple.{CanInfix_><, StaticTuples}
import scala.language.implicitConversions
// should it be "Arities"?
object Dimensions extends StaticTuples.Total[Arity] with CanInfix_>< {}
|
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/arity/VerifiedArity.scala | package org.shapesafe.core.arity
/**
* always successful, no need to verify
*/
trait VerifiedArity extends Arity.Verifiable {
// final def in: this.type = this
}
object VerifiedArity {
import ProveArity.Factory._
implicit def endo[T <: VerifiedArity]: T =>> T =
ProveArity.forAll[T].=>>(identity[T])
}
|
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/tuple/CanFromStatic.scala | package org.shapesafe.core.tuple
import shapeless.{::, HList}
trait CanFromStatic extends CanCons {
_self: TupleSystem =>
object FromStatic extends AbstractFromHList {
implicit def inductive[
H_TAIL <: HList,
TAIL <: Tuple,
HEAD <: UpperBound
](
implicit
forTail: ... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/ProofScope.scala | <gh_stars>1-10
package org.shapesafe.core
import scala.annotation.implicitNotFound
import scala.language.implicitConversions
/**
* If Poly1 works smoothly there will be no point in defining it, too bad the assumed compiler bug made it necessary
*
* @tparam OUB upper bound of output
*/
trait ProofScope { // TO... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/shape/args/ApplyLiterals.scala | <gh_stars>1-10
package org.shapesafe.core.shape.args
import org.shapesafe.core.shape.ShapeAPI.^
import org.shapesafe.core.shape.{LeafShape, Names}
import shapeless.ops.hlist.Reverse
import shapeless.{HList, SingletonProductArgs}
trait ApplyLiterals extends SingletonProductArgs with ApplyArgs {
// TODO: should the ... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/tuple/CanCons.scala | package org.shapesafe.core.tuple
trait CanCons {
_self: TupleSystem =>
// TODO:too much boilerplate, switch to ~~> Proof pattern or Poly1/Poly2?
trait Cons[-TAIL <: Tuple, -HEAD <: UpperBound] {
type ConsResult <: Tuple
def apply(tail: TAIL, head: HEAD): ConsResult
}
object Cons {
def from[T... |
ithinkicancode/shapesafe | core/src/test/scala/org/shapesafe/core/Spike.scala | <reponame>ithinkicancode/shapesafe
package org.shapesafe.core
import org.scalatest.Ignore
import org.shapesafe.BaseSpec
import shapeless.Witness
@Ignore
class Spike extends BaseSpec {}
object Spike {
def adhocW = Witness("a")
val singletonW = Witness("a")
}
|
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/shape/Shape.scala | <filename>core/src/main/scala/org/shapesafe/core/shape/Shape.scala
package org.shapesafe.core.shape
import org.shapesafe.graph.commons.util.{TreeFormat, TreeLike}
import org.shapesafe.core.debugging.CanPeek
import org.shapesafe.core.shape.LeafShape.Eye
import org.shapesafe.core.shape.args.{ApplyLiterals, ApplyNats}
i... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/arity/Unchecked.scala | <reponame>ithinkicancode/shapesafe<filename>core/src/main/scala/org/shapesafe/core/arity/Unchecked.scala<gh_stars>1-10
package org.shapesafe.core.arity
trait Unchecked extends LeafArity {}
case object Unchecked extends Unchecked {
override def runtimeArity: Int = throw new UnsupportedOperationException("<no runtime... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/tuple/TupleLambdaSystem.scala | //package org.shapesafe.core.tuple
//
///**
// * TODO: Not sure if this thing is ever going to be useful, maybe HType1 => HList => mapped => HType2 is sufficient
// *
// * @tparam UBI Upper bound type of input system
// * @tparam UBO Upper bound type of output system
// */
//trait TupleLambdaSystem[UBI, UBO] {
//
... |
ithinkicancode/shapesafe | core/src/test/scala/org/shapesafe/core/shape/LeafShapeSpec.scala | <reponame>ithinkicancode/shapesafe
package org.shapesafe.core.shape
import org.shapesafe.BaseSpec
import org.shapesafe.core.arity.Arity
import org.shapesafe.core.shape.LeafShape.{FromRecord, FromStatic}
import shapeless.HNil
class LeafShapeSpec extends BaseSpec {
import shapeless.record._
describe("create") {
... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/tuple/StaticTuples.scala | <reponame>ithinkicancode/shapesafe<filename>core/src/main/scala/org/shapesafe/core/tuple/StaticTuples.scala<gh_stars>1-10
package org.shapesafe.core.tuple
import org.shapesafe.graph.commons.util.{IDMixin, TextBlock}
import org.shapesafe.core.debugging.OpStrs.OpStr
import org.shapesafe.core.debugging.Expressions.Expr
i... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/arity/ArityAPI.scala | <filename>core/src/main/scala/org/shapesafe/core/arity/ArityAPI.scala
package org.shapesafe.core.arity
import org.shapesafe.core.arity.ArityReporters.{InterruptArity, PeekArity}
import org.shapesafe.core.arity.ProveArity.|-
import org.shapesafe.core.arity.ops.ArityOpsLike
import org.shapesafe.core.axis.{Axis, NoName, ... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/arity/Utils.scala | <gh_stars>1-10
package org.shapesafe.core.arity
import shapeless.Nat
import singleton.ops.ToInt
import singleton.ops.impl.{std, OpId, OpMacro}
import singleton.twoface.impl.TwoFaceAny
object Utils {
type Op = singleton.ops.impl.Op
// TODO: enable after this has been fixed:
// https://github.com/fthomas/singl... |
ithinkicancode/shapesafe | core/src/main/scala/org/shapesafe/core/shape/binary/Conjecture2.scala | package org.shapesafe.core.shape.binary
import org.shapesafe.core.shape.{Shape, ShapeConjecture}
trait Conjecture2 extends ShapeConjecture {
type SS1 <: Shape
type SS2 <: Shape
}
object Conjecture2 {
trait ^[S1 <: Shape, S2 <: Shape] extends Conjecture2 {
final override type SS1 = S1
final override ... |
ithinkicancode/shapesafe | macro/src/main/scala/org/shapesafe/m/viz/TypeVizCT.scala | <gh_stars>1-10
package org.shapesafe.m.viz
import org.shapesafe.graph.commons.util.reflect.format.{Formats, TypeFormat}
import org.shapesafe.graph.commons.util.viz.TypeVizFormat
import scala.language.experimental.macros
import scala.reflect.macros.whitebox
case object TypeVizCT extends VizCTSystem {
override def ... |
ithinkicancode/shapesafe | core/src/test/scala/org/shapesafe/core/shape/NamesSpec.scala | <filename>core/src/test/scala/org/shapesafe/core/shape/NamesSpec.scala
package org.shapesafe.core.shape
import org.shapesafe.graph.commons.util.viz.TypeViz
import org.shapesafe.BaseSpec
import org.shapesafe.core.shape.Index.Name
import org.shapesafe.core.shape.Indices.Infix
import shapeless.{HNil, Witness}
class Name... |
ithinkicancode/shapesafe | core/src/test/scala/org/shapesafe/core/arity/binary/Require2Spec.scala | <reponame>ithinkicancode/shapesafe
package org.shapesafe.core.arity.binary
import org.shapesafe.core.arity.ops.ArityOpsLike.RequireEqual
import org.shapesafe.core.arity.{Arity, ArityFixture, Unchecked}
import scala.language.existentials
class Require2Spec extends ArityFixture {
describe("can prove") {
descri... |
ithinkicancode/shapesafe | core/src/test/scala/org/shapesafe/core/ProofSystemSpike1.scala | <reponame>ithinkicancode/shapesafe<gh_stars>1-10
//package org.shapesafe.core
//
//import org.shapesafe.BaseSpec
//
//class ProofSystemSpike1 extends BaseSpec {}
//
//object ProofSystemSpike1 {
//
// trait Boolean
// trait True extends Boolean
//
// object Sys extends ProofSystem[Boolean]
// import Sys._
//
// tra... |
LemurPwned/EMB_datastreaming | spark-scala/build.sbt | <filename>spark-scala/build.sbt
name := "CassandraInteg"
version := "1.0"
scalaVersion := "2.11.8"
resolvers += "Spark Packages Repo" at "https://dl.bintray.com/spark-packages/maven"
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-sql" % "2.3.1",
"datastax" % "spark-cassandra-connector" % "2.3.1-s_2.... |
LemurPwned/EMB_datastreaming | spark-scala/AnomalyData.scala | <reponame>LemurPwned/EMB_datastreaming
package anomalyStruct
class AnomalyData(tStart: String, tStop: String, per: Int, obs: Int){
val timestampStart = tStart
val timestampStop = tStop
val period = per
val observations = obs
override def toString = {
s"Start: $timestampStart, Stop: $timestam... |
LemurPwned/EMB_datastreaming | spark-scala/spark_int.scala | package cassandra_job
import org.apache.commons.math3.distribution.TDistribution
import org.apache.spark.sql.types.DoubleType
import org.apache.spark.sql.functions._
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.DataFrame
import com.datastax.spark.connector._
impo... |
bjfletcher/playframework | framework/src/play-server/src/main/scala/play/core/server/common/ServerResultUtils.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.server.common
import akka.stream.Materializer
import akka.stream.scaladsl.Sink
import akka.util.ByteString
import play.api.mvc._
import play.api.http.{ Status, HttpEntity, HttpProtocol }
import play.api.http.HeaderNames._
obje... |
bjfletcher/playframework | framework/src/play-akka-http-server/src/main/scala/play/core/server/akkahttp/ModelConversion.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.server.akkahttp
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.headers._
import akka.stream.Materializer
import akka.stream.scaladsl.Source
import akka.util.ByteString
import java.net.InetSocketAddress
import... |
bjfletcher/playframework | framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/distribution/app/controllers/Application.scala | <reponame>bjfletcher/playframework
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package controllers
import play.api._
import play.api.mvc._
import play.api.Play.current
import scala.collection.JavaConverters._
class Application extends Controller {
def index = Action {
Ok(views.htm... |
bjfletcher/playframework | framework/src/play-ws/src/main/scala/play/api/libs/ws/ning/NingWS.scala | <reponame>bjfletcher/playframework
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.ws.ning
import akka.stream.Materializer
import org.asynchttpclient._
import play.api._
import play.api.inject.ApplicationLifecycle
import play.api.libs.ws._
import play.api.libs.ws.ahc.{ ... |
bjfletcher/playframework | framework/src/sbt-fork-run-plugin/src/main/scala/play/sbt/forkrun/PlayForkProcess.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.sbt.forkrun
import sbt._
import java.io.File
import java.lang.{ Process => JProcess, ProcessBuilder => JProcessBuilder, Runtime => JRuntime }
import java.util.concurrent.CountDownLatch
import scala.concurrent.duration.FiniteDuration... |
bjfletcher/playframework | framework/src/play-json/src/test/scala/play/api/libs/json/JsonExtensionSpec.scala | <filename>framework/src/play-json/src/test/scala/play/api/libs/json/JsonExtensionSpec.scala<gh_stars>0
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.json
import org.specs2.mutable._
import play.api.libs.json._
import play.api.libs.json.Json._
case class User(age: Int,... |
bjfletcher/playframework | framework/src/play/src/test/scala/views/js/helper/HelpersSpec.scala | <gh_stars>0
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package views.js.helper
import org.specs2.mutable.Specification
object HelpersSpec extends Specification {
"@json" should {
"Produce valid JavaScript strings" in {
json("foo").toString must equalTo("\"foo\"")
}
... |
bjfletcher/playframework | framework/src/play-docs/src/main/scala/play/docs/DocServerStart.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.docs
import java.io.File
import java.util.concurrent.Callable
import play.api._
import play.api.mvc._
import play.api.routing.Router
import play.core._
import play.core.server._
import scala.concurrent.Future
import scala.util.Succe... |
bjfletcher/playframework | documentation/manual/working/scalaGuide/main/forms/code/ScalaFieldConstructor.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.forms.scalafieldconstructor {
import org.specs2.mutable.Specification
import play.api.{Environment, Configuration}
import play.api.i18n.{DefaultLangs, DefaultMessagesApi, Messages}
object ScalaFieldConstructorSpec extends Spe... |
bjfletcher/playframework | framework/src/play-java-ws/src/test/scala/play/libs/ws/ahc/AhcWSRequestSpec.scala | package play.libs.ws.ahc
import org.specs2.mock.Mockito
import org.specs2.mutable._
class AhcWSRequestSpec extends Specification with Mockito {
"AhcWSRequest" should {
"should respond to getMethod" in {
val client = mock[AhcWSClient]
val request = new AhcWSRequest(client, "http://example.com", /*m... |
bjfletcher/playframework | framework/src/iteratees/src/test/scala/play/api/libs/iteratee/ExecutionSpec.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.iteratee
import scala.language.reflectiveCalls
import org.specs2.mutable._
import java.io.OutputStream
import java.util.concurrent.{ CountDownLatch, TimeUnit }
import scala.concurrent.{ ExecutionContext, Promise, Future, A... |
bjfletcher/playframework | framework/src/iteratees/src/test/scala/play/api/libs/iteratee/RunQueueSpec.scala | <reponame>bjfletcher/playframework<filename>framework/src/iteratees/src/test/scala/play/api/libs/iteratee/RunQueueSpec.scala
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.iteratee
import scala.language.reflectiveCalls
import org.specs2.mutable._
import java.util.concu... |
bjfletcher/playframework | documentation/manual/working/scalaGuide/main/tests/code-scalatestplus-play/playspec/ExampleSpec.scala | <reponame>bjfletcher/playframework
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.tests.scalatest.playspec
import play.api.test._
import org.scalatest._
import org.scalatestplus.play._
import play.api.test.Helpers._
import play.api.libs.ws._
import play.api.mvc._
import Re... |
bjfletcher/playframework | templates/play-scala/test/ApplicationSpec.scala | <reponame>bjfletcher/playframework
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
/**
* Add your spec here.
* You can mock out a whole application including requests, plugins etc.
* For more information, consult the wiki.
*/
@... |
bjfletcher/playframework | framework/src/play-cache/src/main/scala/play/api/cache/Cached.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.cache
import javax.inject.Inject
import play.api._
import play.api.libs.streams.Accumulator
import play.api.mvc._
import play.api.libs.Codecs
import play.api.http.HeaderNames.{ IF_NONE_MATCH, ETAG, EXPIRES }
import play.api.mvc.... |
bjfletcher/playframework | framework/src/play/src/main/scala/play/core/j/JavaHttpErrorHandlerAdapter.scala | <filename>framework/src/play/src/main/scala/play/core/j/JavaHttpErrorHandlerAdapter.scala
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.j
import javax.inject.Inject
import play.api.http.HttpErrorHandler
import play.api.mvc.RequestHeader
import play.http.{ HttpErrorHandler... |
bjfletcher/playframework | framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/multiproject/transitive/app/Transitive.scala | <filename>framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/multiproject/transitive/app/Transitive.scala
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
object Transitive |
bjfletcher/playframework | framework/src/play-ws/src/test/scala/play/api/libs/openid/RichUrl.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.openid
trait RichUrl[A] {
def hostAndPath: String
}
|
bjfletcher/playframework | framework/src/play-ws/src/test/scala/play/api/libs/openid/package.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs
import scala.io.Source
import org.jboss.netty.handler.codec.http.QueryStringDecoder
import java.net.{ MalformedURLException, URL }
import util.control.Exception._
import collection.JavaConverters._
import scala.language.im... |
bjfletcher/playframework | framework/src/play-jdbc-evolutions/src/test/scala/play/api/db/evolutions/EvolutionsReaderSpec.scala | <filename>framework/src/play-jdbc-evolutions/src/test/scala/play/api/db/evolutions/EvolutionsReaderSpec.scala
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.db.evolutions
import java.io.File
import org.specs2.mutable.Specification
import play.api.{ Environment, Mode }
objec... |
bjfletcher/playframework | documentation/manual/working/scalaGuide/main/tests/code-scalatestplus-play/oneserverpertest/ExampleSpec.scala | <gh_stars>0
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.tests.scalatest.oneserverpertest
import play.api.test._
import org.scalatest._
import org.scalatestplus.play._
import play.api.test.Helpers._
import play.api.libs.ws._
import play.api.mvc._
import Results._
// #sc... |
bjfletcher/playframework | framework/src/play/src/test/scala/play/core/test/package.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core
import play.api.{ ApplicationLoader, BuiltInComponentsFromContext, Environment, Play }
package object test {
/**
* Run the given block of code with an application.
*/
def withApplication[T](block: => T): T = {
v... |
bjfletcher/playframework | framework/src/play-ws/src/test/scala/play/api/libs/oauth/OAuthSpec.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.oauth
import akka.util.ByteString
import play.api.Application
import play.api.libs.ws.WS
import play.api.mvc._
import play.api.test._
import scala.concurrent.{ Future, Promise }
class OAuthSpec extends PlaySpecification {... |
bjfletcher/playframework | documentation/manual/working/scalaGuide/main/dependencyinjection/code/static.sbt | <gh_stars>0
//#content
routesGenerator := StaticRoutesGenerator
//#content |
bjfletcher/playframework | framework/src/play-jdbc/src/test/scala/play/api/db/ConnectionPoolConfigSpec.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.db
import javax.inject.Inject
import play.api.test._
class ConnectionPoolConfigSpec extends PlaySpecification {
"DBModule bindings" should {
"use HikariCP when default pool is default" in new WithApplication(FakeApplica... |
bjfletcher/playframework | framework/src/play-netty-server/src/main/scala/play/core/server/netty/NettyModelConversion.scala | <reponame>bjfletcher/playframework
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.server.netty
import java.net.{ URI, InetSocketAddress }
import akka.stream.Materializer
import akka.stream.scaladsl.{ Sink, Source }
import akka.util.ByteString
import com.typesafe.netty.http... |
bjfletcher/playframework | framework/src/play-test/src/main/scala/play/api/test/package.scala | <reponame>bjfletcher/playframework<filename>framework/src/play-test/src/main/scala/play/api/test/package.scala
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api
/**
* Contains test helpers.
*/
package object test {
/**
* Provided as an implicit by WithServer and WithBrow... |
bjfletcher/playframework | framework/src/play-java/src/main/scala/play/core/ObjectMapperModule.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core
import com.fasterxml.jackson.databind.ObjectMapper
import play.api._
import play.api.inject._
import play.libs.Json
import javax.inject._
import scala.concurrent.Future
/**
* Module that injects an object mapper to the JSON... |
bjfletcher/playframework | documentation/manual/working/scalaGuide/main/async/code/ScalaWebSockets.scala | <filename>documentation/manual/working/scalaGuide/main/async/code/ScalaWebSockets.scala<gh_stars>0
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.async.websockets
import akka.stream.Materializer
import akka.stream.scaladsl._
import play.api.http.websocket.{ TextMessage, Me... |
bjfletcher/playframework | framework/src/play-jdbc/src/main/scala/play/api/db/package.scala | <gh_stars>0
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api
/**
* Contains the JDBC database access API.
*
* Example, retrieving a connection from the 'customers' datasource:
* {{{
* val conn = DB.getConnection("customers")
* }}}
*/
package object db {
type NamedData... |
bjfletcher/playframework | framework/src/fork-run/src/main/scala/play/forkrun/Logger.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.forkrun
import java.io.{ PrintStream, PrintWriter, StringWriter }
import play.runsupport.{ Colors, LoggerProxy }
object Logger {
case class Level(value: Int, name: String, label: String) {
override def toString = name
}
... |
bjfletcher/playframework | framework/src/play/src/main/scala/play/core/parsers/FormUrlEncodedParser.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.parsers
/** An object for parsing application/x-www-form-urlencoded data */
object FormUrlEncodedParser {
/**
* Parse the content type "application/x-www-form-urlencoded" which consists of a bunch of & separated key=value... |
bjfletcher/playframework | framework/src/play/src/main/scala/play/utils/Colors.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.utils
object Colors {
import scala.Console._
lazy val isANSISupported = {
Option(System.getProperty("sbt.log.noformat")).map(_ != "true").orElse {
Option(System.getProperty("os.name"))
.map(_.toLowerCase(java... |
bjfletcher/playframework | framework/src/sbt-fork-run-plugin/src/sbt-test/fork-run/dev-mode/project/plugins.sbt | <reponame>bjfletcher/playframework
//
// Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
//
addSbtPlugin("com.typesafe.play" % "sbt-fork-run-plugin" % playVersion)
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0")
// get the play version from a system property or otherwise the run.properties fi... |
bjfletcher/playframework | framework/src/sbt-plugin/src/main/scala/play/sbt/run/PlayRun.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.sbt.run
import annotation.tailrec
import collection.JavaConverters._
import sbt._
import sbt.Keys._
import play.sbt._
import play.sbt.PlayImport._
import play.sbt.PlayImport.PlayKeys._
import play.sbt.PlayInternalKeys._
import pla... |
bjfletcher/playframework | framework/src/play/src/main/scala/play/core/Execution.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core
import java.util.concurrent.ForkJoinPool
import play.api.{ Application, Play }
import scala.concurrent.{ ExecutionContext, ExecutionContextExecutor }
/**
* Provides access to Play's internal ExecutionContext.
*/
private[play... |
bjfletcher/playframework | framework/src/play-integration-test/src/test/scala/play/it/tools/HttpBin.scala | <reponame>bjfletcher/playframework<filename>framework/src/play-integration-test/src/test/scala/play/it/tools/HttpBin.scala
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.it.tools
import akka.stream.Materializer
import akka.stream.scaladsl.Source
import play.api.libs.ws.ahc.AhcW... |
bjfletcher/playframework | framework/src/play-java/src/test/scala/play/data/Task.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.data.models
import java.util.Date
import scala.beans.BeanProperty
import scala.annotation.meta.field
class Task {
type Min = play.data.validation.Constraints.Min @field
type Required = play.data.validation.Constraints.Required... |
bjfletcher/playframework | framework/src/play-ws/src/main/scala/play/api/libs/ws/ssl/debug/FixInternalDebugLogging.scala | /*
*
* * Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*
*/
package play.api.libs.ws.ssl.debug
import play.api.libs.ws.ssl._
import java.security.AccessController
import scala.util.control.NonFatal
/**
* This fixes logging for the SSL Debug class. It will worth for both Java 1.6 and Java 1.7... |
bjfletcher/playframework | framework/src/play-integration-test/src/test/scala/play/it/bindings/GlobalSettingsSpec.scala | <reponame>bjfletcher/playframework
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.it.bindings
import java.lang.reflect.Method
import java.util.concurrent.CompletableFuture
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.routing.Router
import play.api.Applic... |
bjfletcher/playframework | documentation/manual/working/javaGuide/main/forms/code/javaguide/forms/html/routes/package.scala | <filename>documentation/manual/working/javaGuide/main/forms/code/javaguide/forms/html/routes/package.scala
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package javaguide.forms.html
package object routes {
val Application = javaguide.forms.controllers.routes.Application
}
|
bjfletcher/playframework | framework/src/play-ws/src/test/scala/play/api/libs/ws/ssl/AlgorithmsSpec.scala | <filename>framework/src/play-ws/src/test/scala/play/api/libs/ws/ssl/AlgorithmsSpec.scala
/*
*
* * Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*
*/
package play.api.libs.ws.ssl
import org.specs2.mutable._
import java.security.{ SecureRandom, KeyPairGenerator }
import org.joda.time.Instant
impo... |
bjfletcher/playframework | documentation/manual/working/scalaGuide/main/tests/code/specs2/ExamplePlaySpecificationSpec.scala | <gh_stars>0
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.tests.specs2
import play.api.test._
// #scalafunctionaltest-playspecification
object ExamplePlaySpecificationSpec extends PlaySpecification {
"The specification" should {
"have access to HeaderNames" in {
... |
bjfletcher/playframework | framework/src/sbt-plugin/src/main/scala/play/sbt/routes/RoutesCompiler.scala | <reponame>bjfletcher/playframework
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.sbt.routes
import play.core.PlayVersion
import play.routes.compiler.{ RoutesGenerator, RoutesCompilationError }
import play.routes.compiler.RoutesCompiler.{ RoutesCompilerTask, GeneratedSource }
im... |
bjfletcher/playframework | framework/src/play/src/test/scala/play/libs/FSpec.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.libs
import java.util.Arrays
import java.util.concurrent.{ LinkedBlockingQueue, TimeoutException }
import java.util.concurrent.TimeUnit.{ MILLISECONDS, SECONDS }
import org.specs2.mutable._
import play.api.libs.iteratee.ExecutionSpe... |
bjfletcher/playframework | documentation/manual/working/scalaGuide/main/json/code/ScalaJsonAutomatedSpec.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.json
import play.api.data.validation.ValidationError
import play.api.libs.json.Json
import org.junit.runner.RunWith
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
@RunWith(classOf[JUnitRunner])... |
bjfletcher/playframework | documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/JavaWSSpec.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package javaguide.ws
import org.specs2.mutable._
import play.api.test._
import play.api.mvc._
import play.api.libs.json._
import play.test.Helpers._
import play.api.test.FakeApplication
import play.api.libs.json.JsObject
import javaguide.test... |
bjfletcher/playframework | framework/src/play-ws/src/main/scala/play/api/libs/ws/ahc/Streamed.scala | package play.api.libs.ws.ahc
import akka.stream.scaladsl.Source
import akka.util.ByteString
import org.asynchttpclient.AsyncHandler.State
import org.asynchttpclient.{ AsyncHttpClient, HttpResponseBodyPart, HttpResponseHeaders, HttpResponseStatus, Request }
import org.asynchttpclient.handler.StreamedAsyncHandler
import... |
bjfletcher/playframework | documentation/manual/working/scalaGuide/main/tests/code-scalatestplus-play/allbrowserspersuite/ExampleSpec.scala | <reponame>bjfletcher/playframework<filename>documentation/manual/working/scalaGuide/main/tests/code-scalatestplus-play/allbrowserspersuite/ExampleSpec.scala
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.tests.scalatest.allbrowserspersuite
import play.api.test._
import org... |
bjfletcher/playframework | framework/src/play/src/main/scala/play/utils/InlineCache.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.utils
import java.lang.ref.WeakReference
/**
* Creates a wrapper for a function that uses an inline cache to
* optimize calls to the function. The function's result for a
* a *single* input will be cached. If the input changes, ... |
bjfletcher/playframework | framework/src/play-cache/src/main/scala/play/api/cache/SerializableResult.scala | <filename>framework/src/play-cache/src/main/scala/play/api/cache/SerializableResult.scala<gh_stars>0
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.cache
import java.io._
import akka.util.ByteString
import play.api.http.HttpEntity
import play.api.mvc._
import scala.annotatio... |
bjfletcher/playframework | framework/src/iteratees/src/test/scala/play/api/libs/concurrent/NonBlockingMutexSpec.scala | <reponame>bjfletcher/playframework
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.concurrent
import scala.language.reflectiveCalls
import org.specs2.mutable._
import java.io.OutputStream
import java.util.concurrent.{ CountDownLatch, Executors, TimeUnit }
import java.ut... |
bjfletcher/playframework | framework/src/play-ws/src/test/scala/play/api/libs/ws/WSConfigParserSpec.scala | /*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.ws
import org.specs2.mutable._
import com.typesafe.config.ConfigFactory
import play.api.Environment
import play.api.test.WithApplication
import scala.concurrent.duration._
object WSConfigParserSpec extends Specification {... |
bjfletcher/playframework | framework/src/play-streams/src/test/scala/play/api/libs/streams/StreamsSpec.scala | <reponame>bjfletcher/playframework
/*
* Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.streams
import play.api.libs.streams.impl._
import org.specs2.mutable.Specification
import scala.concurrent.Future
class StreamsSpec extends Specification {
"Streams helper interface" ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.