runefs / maroon Goto Github PK
View Code? Open in Web Editor NEWA gem to make pure DCI available in Ruby (was originally named Moby)
License: MIT License
A gem to make pure DCI available in Ruby (was originally named Moby)
License: MIT License
I'm having trouble getting my head around what's going on on the inside. Is there a design document somewhere?
This is my code:
require 'maroon/kernel'
require 'build'
module Demands
Context.define :DemandProcessing do
def initialize(demand, requied_organization, params)
@demand = demand
@requied_organization = requied_organization
@params = params
end
role :demand do
def withdraw(amount)
source.movement(amount)
source.log 'withdrawal ' + amount.to_s
end
end
role :requied_organization do
def find_or_create(params)
#...
end
end
def process
organization, status = requied_organization.find_or_create(params)
return status
end
end
demand = Demand.new
required_organization = Organization.new
ctx = Demands::DemandsProcessing.new(demand, required_organization)
ctx.process
And I get next error:
/home/johnbat26/.rvm/gems/ruby-2.0.0-p247@wc/gems/sourcify-0.5.0/lib/sourcify/proc/scanner/dstring.rb:49:in start_tag': undefined method
[]' for nil:NilClass (NoMethodError)
from /home/johnbat26/.rvm/gems/ruby-2.0.0-p247@wc/gems/sourcify-0.5.0/lib/sourcify/proc/scanner/dstring.rb:53:in `end_tag'
Why?
Thanks for Maroon and your video.
Do you know of a facility in DCI which allows/enables multiple concurrently active roles.
For instance, when a wiki session/persona/login has ('read' by virtue of being regular user) and ('edit' by virtue of being admin user).
Thanks, MarkT
I'm working my way through the code but I'm getting an error when running the tests.
The error is in get_args
where it runs
sexp = sexp[1][1..-1]
It seems that sexp[1]
is returning nil so a NoMethoError
is thrown when the [1..-1]
is run.
I haven't dug deeper yet, but wanted to get feedback in case there was some small piece missing.
I'm trying to wrap my head around how this fits into an application. It's been a stumbling block for me.
I would expect to install the gem and be able to require "maroon"
and then get going, but that doesn't work and I don't understand what I should do.
I started down the path of adding a lib/maroon.rb
file which would contain what I needed, but I keep bumping into errors.
What files need to be required and once in my project, how do I (or do I need to) generate the files/classes for the contexts?
consider renaming this repository to match the "maroon" name of the gem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.