ストーリー駆動開発のためのシンプルなライブラリ
Narrativeは、Rustのトレイトで表現されたストーリーに基づいてソフトウェアの全体または一部を開発するためのライブラリです。主にE2Eテスト用に設計されていますが、そのシンプルさから様々な用途に対応できます。
I'd like to propose "Neovim No-Nonsence Protocol" as the working name for this project to help our discussion. It can also be used as the official name when releasing it if no nice names are found.
for i <- 2..10000 do | |
spawn(fn -> | |
# `rem(a, b)` returns the remainder of a / b. | |
Dispatcher.listen(Pattern.new(fn x -> x > i and rem(x, i) == 0 end)) | |
receive do | |
x -> IO.puts("#{x} is not a prime number because #{x} is divisible by #{i}") | |
end | |
end) | |
end |
# Things to prepare | |
alias Cizen.Dispatcher | |
alias Cizen.Pattern | |
require Pattern | |
# Dispatch something | |
Dispatcher.dispatch(10) | |
Dispatcher.dispatch({:ok, %{body: "Hello World"}}) | |
# Listens numbers less than 10. |
# This is a comment. | |
# Allows you to use SomeModule with the long path. | |
alias Too.Long.Path.To.SomeModule | |
# This is needed for using macros in SomeModule. | |
require SomeModule | |
# Spawns a new process that prints a result of 1 + 1. | |
spawn(fn -> |
git clone https://github.com/andytill/erlyberly.git && cd erlyberly
defmodule Server do | |
use GenServer | |
def init(pid) do | |
{:ok, pid} | |
end | |
def handle_info({:DOWN, _ref, :process, _object, _reason}, state) do | |
{:stop, :normal, state} | |
end |
mix new cizen_dining_philosophers | |
cd cizen_dining_philosophers |
import React from 'react'; | |
import { connect } from 'react-redux'; | |
import { pageSelector } from './selectors.js'; | |
import { taskPage, relaxPage } from './pages.js'; | |
import TaskPage from './TaskPage.js'; | |
import RelaxPage from './RelaxPage.js'; | |
import ErrorPage from './ErrorPage.js'; | |
const mapStateToProps = state => { | |
const page = pageSelector(state); |
defmacro defobject(definition) do | |
quote do | |
json = unquote(definition) |> Poison.encode! |> Poison.decode! | |
case ExJsonSchema.Validator.validate(Zpids.Display.Object.schema, json) do | |
{:error, x} -> | |
raise inspect x | |
_ -> :ok | |
end | |
def definition, do: unquote(definition) | |
end |