Skip to content

Commit

Permalink
docs: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ocvit committed Mar 11, 2024
1 parent 45157e2 commit da86719
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Contract is called *__matched__* when:
- *__at least one__* expectation is matched (if present)

Rule is *__matched__* when it returns *__truthy__* value.\
Rule is *__not matched__* when it returns *__falsey__* value (`nil`, `false`) or *__raises an error__*.
Rule is *__not matched__* when it returns *__falsy__* value (`nil`, `false`) or *__raises an error__*.

Contract is triggered *__after__* operation under guard is succesfully executed.
Contract is triggered *__after__* operation under guard is successfully executed.

## Usage

Expand Down Expand Up @@ -216,14 +216,14 @@ Default sampler creates marshalized dumps of contract state in specified folder
}

# default sampler can be reconfigured
ConfigedSampler = Contr::Sampler::Default.new(
ConfiguredSampler = Contr::Sampler::Default.new(
folder: "/tmp/contract_dumps", # default: "/tmp/contracts"
path_template: "%<contract_name>s_%<period_id>i.bin", # default: "%<contract_name>s/%<period_id>i.dump"
period: 3600 # default: 600 (= 10 minutes)
)

class SomeContract < Contr::Act
sampler ConfigedSampler
sampler ConfiguredSampler

# ...
end
Expand Down Expand Up @@ -305,14 +305,14 @@ Default logger logs contract state to specified stream in JSON format. State str
}

# default logger can be reconfigured
ConfigedLogger = Contr::Logger::Default.new(
ConfiguredLogger = Contr::Logger::Default.new(
stream: $stderr, # default: $stdout
log_level: :warn, # default: :debug
tag: "shit-happened" # default: "contract-failed"
)

class SomeContract < Contr::Act
logger ConfigedLogger
logger ConfiguredLogger

# ...
end
Expand Down Expand Up @@ -400,11 +400,11 @@ class SomeContract < Contr::Act
# ...
end
end
# guarantees: check_1
# expecations: check_2
# async: pools: {main: <fixed>, rules: nil}
# sampler: Contr::Sampler::Default
# logger: Contr::Logger:Default
# guarantees: check_1
# expectations: check_2
# async: pools: {main: <fixed>, rules: nil}
# sampler: Contr::Sampler::Default
# logger: Contr::Logger:Default

class OtherContract < SomeContract
async pools: {rules: Contr::Async::Pool::GlobalIO.new}
Expand All @@ -414,11 +414,11 @@ class OtherContract < SomeContract
# ...
end
end
# guarantees: check_1, check_3
# expecations: check_2
# async pools: {main: <fixed>, rules: <global_io>}
# sampler: CustomSampler
# logger: Contr::Logger:Default
# guarantees: check_1, check_3
# expectations: check_2
# async pools: {main: <fixed>, rules: <global_io>}
# sampler: CustomSampler
# logger: Contr::Logger:Default

class AnotherContract < OtherContract
async pools: {main: Contr::Async::Pool::GlobalIO.new}
Expand All @@ -428,11 +428,11 @@ class AnotherContract < OtherContract
# ...
end
end
# guarantees: check_1, check_3
# expecations: check_2, check_4
# async pools: {main: <global_io>, rules: <global_io>}
# sampler: CustomSampler
# logger: nil
# guarantees: check_1, check_3
# expectations: check_2, check_4
# async pools: {main: <global_io>, rules: <global_io>}
# sampler: CustomSampler
# logger: nil
```

Rule block arguments can be accessed in different ways:
Expand Down

0 comments on commit da86719

Please sign in to comment.