import
文をSettingKey
かTaskKey
でカスタマイズ可能にしたい- 現状は固定
- やりたかったら、それぞれのテストに明示的に書くか、スコープに入るように、テストが置かれるであろうパッケージオブジェクトに色々置くしか無い?
- 拡張ポイントをどこにするか問題
- あくまで個人的意見としては、"sbt pluginの拡張ポイントはできるだけ汎用的" になっているべきだと思う
- 言い換えると、あとからKeyをあまり増やしたくない。(keyが汎用的すぎて、それを設定するユーザー側が)多少面倒だとしても、少ない汎用的なKeyさえ使えば、とにかくなんでも設定可能
- 汎用的にするには、やはり
Key
は関数になっているべき - なので、最初に思いついたのは
それぞれのテスト => Import文
という関数のKeyを作る それぞれのテスト
とは、現状では ParsedDoctest だろう- つまり
ParsedDoctest => Seq[String]
?
This file contains hidden or 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
val removeIdeaDotSbt = "remove-idea-dot-sbt" | |
TaskKey[Unit](removeIdeaDotSbt) := { | |
val f = baseDirectory.value / "project" / "idea.sbt" | |
assert(f.isFile) | |
IO.delete(f) | |
} | |
commands += Command.command("gen-idea-plugin"){ state => | |
val extracted = Project.extract(state) |
This file contains hidden or 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 controllers.util | |
import play.api.mvc.{Result, Controller} | |
import play.api.data.Form | |
import scala.util.Either.RightProjection | |
object Implicits { | |
implicit def formToEither[A](form: Form[A]): Either[Form[A], A] = form.fold(Left.apply, Right.apply) |
発表場所: | Scalaz勉強会 |
---|---|
資料のライセンス: | CC-BY-SA 4.0 |
- 2014/07/13 Scalaz勉強会
- @gakuzzzz
- 中村 学
- 株式会社Tech to Value
- play2-auth が scala-awesomeに載りました
As compiled by Kevin Wright a.k.a @thecoda
(executive producer of the movie, and I didn't even know it... clever huh?)
please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!
This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!
Monday June 16th
This file contains hidden or 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
sealed trait Interact[A] | |
case class Ask(prompt: String) | |
extends Interact[String] | |
case class Tell(msg: String) | |
extends Interact[Unit] | |
trait Monad[M[_]] { | |
def pure[A](a: A): M[A] |
This file contains hidden or 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
trait EnumLike { | |
type Value | |
def value: Value | |
} | |
trait StringEnumLike extends EnumLike { | |
type Value = String | |
} |
This file contains hidden or 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 ; | |
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
import haxe.macro.Expr.Field; | |
import haxe.macro.Expr.FieldType; | |
import haxe.macro.Expr.Function; | |
import haxe.macro.ExprTools; | |
using Lambda; |
This file contains hidden or 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.IOException; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.FileChannel; | |
import java.nio.file.FileSystems; | |
import java.nio.file.StandardOpenOption; | |
import java.security.InvalidAlgorithmParameterException; | |
import java.security.Provider; | |
import java.security.SecureRandom; |