profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/zorbash/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Dimitris Zorbas zorbash @mindfulchefuk London, UK https://zorbash.com Brave sourcerer / Code Acrobat / Technical Debt Collector Side-project: https://tefter.io

carolinux/Subs.py 2

Subtitle Syncer

zorbash/dotfiles 1

My dotfiles

mindfulchefuk/ruby 0

Ruby Style Guide

tefter/awesome-saas-services 0

A curated list of the best in class SaaS services for developers and business owners.

zorbash/absinthe 0

The GraphQL toolkit for Elixir

zorbash/amnesia 0

Mnesia wrapper for Elixir.

zorbash/athtech.github.io 0

Athens Developers & Technologists community site

zorbash/awesome 0

😎 Awesome lists about all kinds of interesting topics

zorbash/awesome-elixir 0

A curated list of amazingly awesome Elixir and Erlang libraries, resources and shiny things. Updates:

push eventzorbash/opus

Dimitris Zorbas

commit sha e64d868b64e854fe9ca3da9527505c66e05e20e0

Release version 0.8.0

view details

push time in 2 months

created tagzorbash/opus

tagv0.8.0

A framework for pluggable business logic components

created time in 2 months

push eventzorbash/opus

Dimitris Zorbas

commit sha 99d609c3b36a2743d1bffb362d2c1fb45cbd6d48

Update the docs

view details

push time in 2 months

push eventzorbash/opus

Maxim Krizhanovski

commit sha 6f0dc06d23a01f3a5431fbde5b82a6e57dce4f16

Accept anonymous function for the error_message Resolves #20

view details

push time in 2 months

issue closedzorbash/opus

Accept a function in :error_message

Current behavior

defmodule ArithmeticPipeline do
  use Opus.Pipeline

  step  :add_one,         with: &(&1 + 1)
  check :even?,           with: &(rem(&1, 2) == 0), error_message: :expected_an_even
  step :do_something_else

The error message should accept a function which will be called with the return value of the previous stage so that the error message can be parameterised.

closed time in 2 months

zorbash

PR merged zorbash/opus

Accept anonymous function for the error_message

Thank you for this great framework. Adding the option to the error_message was a great way to see the internals.

+71 -7

3 comments

5 changed files

Darhazer

pr closed time in 2 months

pull request commentzorbash/opus

Accept anonymous function for the error_message

A couple of minor comments, looks good otherwise!

Darhazer

comment created time in 2 months

Pull request review commentzorbash/opus

Accept anonymous function for the error_message

 defmodule Opus.Pipeline.StageTest do     end   end +  describe ":error_message option, with a function" do+    defmodule ErrorMessages do+      def invalid(input), do: "Invalid input: #{input}"+    end++    defmodule ErrorMessageWithFunctionPipeline do+      use Opus.Pipeline++      step :double+      step :maybe_fail,

Please run mix format.

** (Mix) mix format failed due to --check-formatted.
The following files were not formatted:

  * test/opus/pipeline/stage_test.exs
Darhazer

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentzorbash/opus

Accept anonymous function for the error_message

 defmodule Opus.Pipeline.StageTest do     end   end +  describe ":error_message option, with a function" do+    defmodule ErrorMessages do+      def invalid(input), do: "Invalid input: #{input}"+    end++    defmodule ErrorMessageWithFunctionPipeline do+      use Opus.Pipeline++      step :double+      step :maybe_fail,+        error_message: fn n ->+          "Can't work with #{n}"+        end+      step :fail_for_sure, error_message: &ErrorMessages.invalid/1

I'd prefer defining the fail_for_sure function and raise with raise/1. Otherwise the reader has think that this does indeed fail for sure with UndefinedFunctionError because the function is undefined.

Darhazer

comment created time in 2 months

PullRequestReviewEvent

pull request commentzorbash/opus

Accept anonymous function for the error_message

Thank you @Darhazer for submitting a PR for this much needed enhancement.

Darhazer

comment created time in 2 months

fork zorbash/ruby-1

Ruby Style Guide

fork in 3 months