- specs2よりベターなテストフレームワーク
- より具体的に言うとrspecのようにnestしても同じように書ける一貫性が欲しい(テストの構造化をより自由に行うため)
- rubyのwebmockのようなhttp mock server
- テストフレームワークとシームレスに結合できるタイプのものがほしい。WireMockはrequestのmatchingの自由度が低すぎる
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
# play-jsonからhoconフォーマットへだいたい変換するスクリプト | |
# Seqだけはカッコが同一行へ存在しないと変換を失敗する | |
sed -i -e 's/Json.obj(/{/g' $1 | |
sed -i -e 's/ -> /: /g' $1 | |
sed -i -e 's/,$//g' $1 | |
sed -i -e 's/Seq(\(.*\))/[\1]/g' $1 | |
sed -i -e 's/L$//g' $1 | |
sed -i -e 's/)/}/g' $1 | |
sed -i -e 's/^\(\s*\)"\([^"]*\)"/\1\2/g' $1 |
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
val scoobiRun = taskKey[Int]("A sample int task.") | |
scoobiRun := { | |
(compile in Compile).value | |
println(1) | |
1 | |
} |
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 utils.specs2 | |
import org.specs2.main.SmartDiffs | |
import play.api.libs.json._ | |
import scala.util.Success | |
import scala.util.Try | |
object JsonProcessableDiffs extends SmartDiffs { | |
private[this] def toJsObectOption(map: Map[String, JsValue]) = if (map.isEmpty) |
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 com.sksamuel.elastic4s.ElasticClient | |
import com.sksamuel.elastic4s.ElasticDsl._ | |
import com.sksamuel.elastic4s.ElasticsearchClientUri | |
import org.elasticsearch.common.settings.ImmutableSettings | |
import org.elasticsearch.node.NodeBuilder._ | |
import scala.collection.JavaConverters._ | |
object Main { | |
private def transportClient = { | |
val settings = ImmutableSettings.settingsBuilder. |
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
// ==UserScript== | |
// @name Github milestone enhanced issue list | |
// @namespace https://github.com/bigwheel | |
// @version 1.0 | |
// @description this is description | |
// @author bigwheel | |
// @match http://github.o-in.dwango.co.jp/* | |
// @grant GM_xmlhttpRequest | |
// @require http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js | |
// ==/UserScript== |
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
[error] RemoteTransportException: : [node03][inet[/192.168.1.3:9300]][indices:data/read/search] (TransportSearchTypeAction.java:233) | |
[error] org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:233) | |
[error] org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$1.onFailure(TransportSearchTypeAction.java:179) | |
[error] org.elasticsearch.search.action.SearchServiceTransportAction$6.handleException(SearchServiceTransportAction.java:249) | |
[error] org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:185) | |
[error] org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:175) | |
[error] org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:125) | |
[error] org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) | |
[error] org.el |
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
#!/usr/bin/env ruby | |
srand(Time.local(2012, 8, 2).to_i) | |
class Member | |
attr_reader :name, :power | |
def initialize(name) | |
@name = name | |
@power = rand | |
end |
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
#!/usr/bin/env ruby | |
class Member | |
attr_reader :name | |
def initialize(name) | |
@name = name | |
end | |
def win?(opponent) | |
result_table = { gu: { gu: :even, choki: :win, pa: :lose }, |
OlderNewer