Class: Sbuilder::CliText

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/cli-text.rb

Constant Summary collapse

SBUILDER_EXTENSION =
<<-EOS.unindent

# Load and configure sbuilder plugin extensions
#
# SCHEMA
#
# extend:
#    loaders:
#          - gem: <gem-name>
#            className: <class name>
#            configuration:
#                   <configuration-value>
#
# <gem-name>: gem name to require
# <class name>: name of interface loader in 'type' property in 'interfaces' array
# <configuration-value>: a (hash) value passed to 'className'::configure' -method
#
EOS
SBUILDER_INVARIANTS =
<<-EOS.unindent

# Activate invariant operator defines in sBuilder code repository
#
# SCHEMA:
# 
# invariants:
#   - <invariant-name>: <invariant description>
#
# 
# <invariant-name>: name of TlAplus operator defined in sBuilder code repository
# <invariant description>: documentantion text for the invariant
#
EOS
SBUILDER_RESOLVERS =
<<-EOS.unindent

# Define how parameter names are mapped to domain
#
# SCHEMA:
#
# resolvers: 
#  - file: <file name in cnf-dir>
#    url:  <path or url>
#
# Give either 'file' or 'url'
# <file name in cnf-dir>: file name in cnf-directory
# <path or url>: path relative to cwd, or http url
#
#
#

EOS
SBUILBER_INTERFACES =
<<-EOS.unindent

# Define how to load interfaces configuration
#
# SCHEMA:
# 
# interfaces: 
#  - type: <interface loader name>
# 
#    file: <file name in cnf-dir>
#    infrastructureServices: <is infrastructureService>
#    url:  <path or url>
#    cache: <cache file path>
#
# <interface loader name>: name of interface loader, 
#                          valid values:  'swagger' and className values 
#                          given in 'extend.loaders' array
# <is infrastructureService>: true or false (default false)
# <file name in cnf-dir> : file name in cnf-directory
# <path or url>          : path relative to cwd, or http url, 
#                          e.g https://cdn.rawgit.com/swagger-api/swagger-spec/master/examples/v2.0/yaml/petstore-expanded.yaml
# <cache file path>      : path relative to cwd, where interface file is cached
# 
# COMMENTS:
# - give 'file' xor 'url' property
# - property 'cache' optional, useful when http access slow
# - infrastructureServices are modelled as procedures, which may modify state
#   or return values used in 'normal' interfaces
#      

EOS
SBUILER_SETUPS =
<<-EOS.unindent

# Define environment setups
#
# SCHEMA:
# setups:
#   - setupDirectory: <setupname>
#     extensions:
#         file: <file name in cnf-dir>
#         url:  <path or url>
#     preferences:
#         <hash-values>
#     assumptions:
#          <assume-op-names>
#
# <setupname>           : name of setup = sub directory under <gen_dir>
# <file name in cnf-dir>: name extension configurion file in cnf-directory
# <path or url>         : relative name or url of configurion file
# <hash-values>         : optional properties overriding global generate preferences
# <assume-op-names>     : array of operator names to put into ASSUME directives
#
# COMMENTS:
# - preferences property is optional
EOS
SBUILDER_GENERATE =
<<-EOS.unindent

# Generate definitions
#   
# SCHEMA:
# generate:
#   - output: <path>
#     inputs: 
#
#       - desc: <description text>
#         modelData: none
#         template: markdown-header.mustache
#            input: <name-of-template>
#
# <path>: relative path under <gen-directory>
# <description text>: text avaiblable for template in {{META.desc}} property
# <name-of-template>: name of file to output into <path>
#
# COMMENTS:
# - can be used to render also model data using mustache template 
#   in this case 
#    modelData : <model-data>, where
#                valid values for <model-data>: ['none', 'interfaces', 'steps',
#                'definitions','domains' ], 
#                see document   <gen_dir>/<setup>/doc/data-model.md for content
#  template: <mustache-template>, where
#            <mustache-template> is a file <src_dir>
#
EOS
SBUILDER_PREFERENCES =
<<-EOS.unindent

# Generate preferences
#
# preferences:
#     <hash-values>
#
# <hash-values> key-value pairs passed to mustache templates in 'PREFERENCES' -property
#
# Default templates use following propeties
#     debug-output: <true/false>, output call message in interface processes, default 'true'
#
EOS
EXTENSION_HEADER_DOM =
<<-EOS.unindent
 
# Define extension for domains
#
# SCHEMA:
# - domain-extension:
#    - domain: <domain-name>
#      cardinality: <cardinality>
#      values:
#         - <str-value>
#
# 
# <domain-name>: domain name resolved
# <cardinality>: integer value for domain, default 1
# <str-value>: fixed value for domain
#
# COMMENTS:
# - give 'cardinality' xor 'values' property
#

EOS
EXTENSION_HEADER_IF =
<<-EOS.unindent

# Define name of extension point for interface
#
# SCHEMA:
# - interface-extension:
#      - matcher: <string-or-regex>
#        implementation: <name-implmentation>
#
# <string-or-regex>: string or regexp matching inteface
#                    example regex !ruby/regexp /customer?\(post\)/ matches
#                    customers(post) and customer(post) 
# <name-of-implementation>: must define macro 'p_<name-of-implementation>'

EOS
EXTENSION_HEADER_SETUP =
<<-EOS.unindent

# Define environment steps 
#
# SCHEMA:
# - step-extension:
#      - interface: <interface-name>
#        bindExact: true
#        input: 
#           <input> 
#        inputs:
#           - input:
#                <input>
#
# 
# <interface-name>: name of interface to call in step, e.g. customer(post)
# <input>: parameter bindings for interface. See 'sbuilder.rb example pet' 
# and `sbuilder.rb example customer` for examples.
# 
# 
# COMMENTS:
# - give 'inputs' xor 'input' (first level hash)
# - 'bindExact' optional, 
#     - use 'bindExact': true when input range for interface
#       becomes so big that TLA+ model checker slows down when 
#       evaluating the input domain range. 
#     - When 'bindExact': true all fields for 'input' property must 
#       be given value. Hint use '_default' property in <input>
#     - Hint: use 'inputs' when 'bindExact': true use 'inputs' to
#       allow non-determinism in process input .
#


EOS
RESOLVER_HEADER =
<<-EOS.unindent
# Example of an YAML resolver
#
# Contains array of hashes
# 
# - Name: <name of resolver>
#   Matcher: <string/regexp to match a paramset name to resolve>
#   Rules: <array of RULE-ELEMENTS>
# 
#   RULE-ELEMENT: MATCHER | INCLUDE-MAPPER
#
#   INCLUDE-MAPPER: hash with Include attribute
#      Include: <name of mapper>
# 
#   MATCHER: hash of with Matcher/Domain attributes
#      Matcher: <string/regexpp to match paramenter id>
#               use !ruby/regexp modifier for a value to make it
#               to a regular expression. For exapmle
#
#                Matcher: !ruby/regexp /.*/
#
#      Domain: domain to assign to parameter
#
EOS