inquirex 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +88 -6
- data/lib/.DS_Store +0 -0
- data/lib/inquirex/accumulator.rb +29 -0
- data/lib/inquirex/actions/action.rb +68 -0
- data/lib/inquirex/actions/base.rb +41 -0
- data/lib/inquirex/actions/custom.rb +31 -0
- data/lib/inquirex/actions/outbox.rb +57 -0
- data/lib/inquirex/actions/runner.rb +52 -0
- data/lib/inquirex/actions/send_email.rb +174 -0
- data/lib/inquirex/actions/template.rb +95 -0
- data/lib/inquirex/actions/webhook.rb +139 -0
- data/lib/inquirex/actions.rb +57 -0
- data/lib/inquirex/answers.rb +13 -0
- data/lib/inquirex/completion_metadata.rb +82 -0
- data/lib/inquirex/definition.rb +67 -5
- data/lib/inquirex/dsl/action_builder.rb +53 -0
- data/lib/inquirex/dsl/flow_builder.rb +49 -6
- data/lib/inquirex/engine/state_serializer.rb +7 -4
- data/lib/inquirex/engine.rb +136 -6
- data/lib/inquirex/errors.rb +5 -0
- data/lib/inquirex/graph/mermaid_exporter.rb +2 -0
- data/lib/inquirex/node.rb +2 -0
- data/lib/inquirex/rules/all.rb +12 -0
- data/lib/inquirex/rules/any.rb +11 -0
- data/lib/inquirex/rules/base.rb +6 -0
- data/lib/inquirex/rules/contains.rb +12 -0
- data/lib/inquirex/rules/equals.rb +12 -0
- data/lib/inquirex/rules/greater_than.rb +12 -0
- data/lib/inquirex/rules/less_than.rb +12 -0
- data/lib/inquirex/rules/not_empty.rb +12 -0
- data/lib/inquirex/validation/adapter.rb +1 -0
- data/lib/inquirex/validation/null_adapter.rb +5 -0
- data/lib/inquirex/version.rb +1 -1
- data/lib/inquirex/widget_registry.rb +1 -0
- data/lib/inquirex.rb +13 -0
- metadata +30 -18
- data/.relaxed_rubocop.yml +0 -153
- data/.rub +0 -0
- data/.ruby-version +0 -1
- data/.secrets.baseline +0 -127
- data/Brewfile +0 -7
- data/Rakefile +0 -36
- data/docs/badges/coverage_badge.svg +0 -21
- data/examples/01_readme_example.rb +0 -55
- data/examples/02_readme_mermaid.png +0 -0
- data/examples/02_readme_mermaid.rb +0 -36
- data/examples/README.md +0 -33
- data/justfile +0 -70
- data/lefthook.yml +0 -35
- data/sig/inquirex.rbs +0 -4
metadata
CHANGED
|
@@ -1,48 +1,61 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: inquirex
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Konstantin Gredeskoul
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
-
dependencies:
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: ostruct
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0.6'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0.6'
|
|
12
26
|
description: Inquirex lets you define multi-step questionnaires as directed graphs
|
|
13
27
|
with conditional branching, using a conversational DSL (ask, say, mention) and an
|
|
14
28
|
AST-based rule system (contains, equals, greater_than, all, any). The engine walks
|
|
15
29
|
the graph, collects structured answers, and serializes everything to JSON — making
|
|
16
30
|
it the ideal backbone for cross-platform intake forms where the frontend is a chat
|
|
17
|
-
widget, a terminal, or a mobile app. Framework-agnostic,
|
|
18
|
-
immutable definitions.
|
|
31
|
+
widget, a terminal, or a mobile app. Framework-agnostic, no third-party dependencies,
|
|
32
|
+
thread-safe immutable definitions.
|
|
19
33
|
email:
|
|
20
34
|
- kigster@gmail.com
|
|
21
35
|
executables: []
|
|
22
36
|
extensions: []
|
|
23
37
|
extra_rdoc_files: []
|
|
24
38
|
files:
|
|
25
|
-
- ".relaxed_rubocop.yml"
|
|
26
|
-
- ".rub"
|
|
27
|
-
- ".ruby-version"
|
|
28
|
-
- ".secrets.baseline"
|
|
29
|
-
- Brewfile
|
|
30
39
|
- CHANGELOG.md
|
|
31
40
|
- LICENSE.txt
|
|
32
41
|
- README.md
|
|
33
|
-
-
|
|
34
|
-
- docs/badges/coverage_badge.svg
|
|
35
|
-
- examples/01_readme_example.rb
|
|
36
|
-
- examples/02_readme_mermaid.png
|
|
37
|
-
- examples/02_readme_mermaid.rb
|
|
38
|
-
- examples/README.md
|
|
39
|
-
- justfile
|
|
40
|
-
- lefthook.yml
|
|
42
|
+
- lib/.DS_Store
|
|
41
43
|
- lib/inquirex.rb
|
|
42
44
|
- lib/inquirex/accumulator.rb
|
|
45
|
+
- lib/inquirex/actions.rb
|
|
46
|
+
- lib/inquirex/actions/action.rb
|
|
47
|
+
- lib/inquirex/actions/base.rb
|
|
48
|
+
- lib/inquirex/actions/custom.rb
|
|
49
|
+
- lib/inquirex/actions/outbox.rb
|
|
50
|
+
- lib/inquirex/actions/runner.rb
|
|
51
|
+
- lib/inquirex/actions/send_email.rb
|
|
52
|
+
- lib/inquirex/actions/template.rb
|
|
53
|
+
- lib/inquirex/actions/webhook.rb
|
|
43
54
|
- lib/inquirex/answers.rb
|
|
55
|
+
- lib/inquirex/completion_metadata.rb
|
|
44
56
|
- lib/inquirex/definition.rb
|
|
45
57
|
- lib/inquirex/dsl.rb
|
|
58
|
+
- lib/inquirex/dsl/action_builder.rb
|
|
46
59
|
- lib/inquirex/dsl/flow_builder.rb
|
|
47
60
|
- lib/inquirex/dsl/rule_helpers.rb
|
|
48
61
|
- lib/inquirex/dsl/step_builder.rb
|
|
@@ -66,7 +79,6 @@ files:
|
|
|
66
79
|
- lib/inquirex/version.rb
|
|
67
80
|
- lib/inquirex/widget_hint.rb
|
|
68
81
|
- lib/inquirex/widget_registry.rb
|
|
69
|
-
- sig/inquirex.rbs
|
|
70
82
|
homepage: https://github.com/inquirex/inquirex
|
|
71
83
|
licenses:
|
|
72
84
|
- MIT
|
data/.relaxed_rubocop.yml
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
# Relaxed.Ruby.Style
|
|
2
|
-
## Version 2.5
|
|
3
|
-
|
|
4
|
-
Style/Alias:
|
|
5
|
-
Enabled: false
|
|
6
|
-
StyleGuide: https://relaxed.ruby.style/#stylealias
|
|
7
|
-
|
|
8
|
-
Style/AsciiComments:
|
|
9
|
-
Enabled: false
|
|
10
|
-
StyleGuide: https://relaxed.ruby.style/#styleasciicomments
|
|
11
|
-
|
|
12
|
-
Style/BeginBlock:
|
|
13
|
-
Enabled: false
|
|
14
|
-
StyleGuide: https://relaxed.ruby.style/#stylebeginblock
|
|
15
|
-
|
|
16
|
-
Style/BlockDelimiters:
|
|
17
|
-
Enabled: false
|
|
18
|
-
StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters
|
|
19
|
-
|
|
20
|
-
Style/CommentAnnotation:
|
|
21
|
-
Enabled: false
|
|
22
|
-
StyleGuide: https://relaxed.ruby.style/#stylecommentannotation
|
|
23
|
-
|
|
24
|
-
Style/Documentation:
|
|
25
|
-
Enabled: false
|
|
26
|
-
StyleGuide: https://relaxed.ruby.style/#styledocumentation
|
|
27
|
-
|
|
28
|
-
Layout/DotPosition:
|
|
29
|
-
Enabled: false
|
|
30
|
-
StyleGuide: https://relaxed.ruby.style/#layoutdotposition
|
|
31
|
-
|
|
32
|
-
Style/DoubleNegation:
|
|
33
|
-
Enabled: false
|
|
34
|
-
StyleGuide: https://relaxed.ruby.style/#styledoublenegation
|
|
35
|
-
|
|
36
|
-
Style/EndBlock:
|
|
37
|
-
Enabled: false
|
|
38
|
-
StyleGuide: https://relaxed.ruby.style/#styleendblock
|
|
39
|
-
|
|
40
|
-
Style/FormatString:
|
|
41
|
-
Enabled: false
|
|
42
|
-
StyleGuide: https://relaxed.ruby.style/#styleformatstring
|
|
43
|
-
|
|
44
|
-
Style/IfUnlessModifier:
|
|
45
|
-
Enabled: false
|
|
46
|
-
StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier
|
|
47
|
-
|
|
48
|
-
Style/Lambda:
|
|
49
|
-
Enabled: false
|
|
50
|
-
StyleGuide: https://relaxed.ruby.style/#stylelambda
|
|
51
|
-
|
|
52
|
-
Style/ModuleFunction:
|
|
53
|
-
Enabled: false
|
|
54
|
-
StyleGuide: https://relaxed.ruby.style/#stylemodulefunction
|
|
55
|
-
|
|
56
|
-
Style/MultilineBlockChain:
|
|
57
|
-
Enabled: false
|
|
58
|
-
StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain
|
|
59
|
-
|
|
60
|
-
Style/NegatedIf:
|
|
61
|
-
Enabled: false
|
|
62
|
-
StyleGuide: https://relaxed.ruby.style/#stylenegatedif
|
|
63
|
-
|
|
64
|
-
Style/NegatedWhile:
|
|
65
|
-
Enabled: false
|
|
66
|
-
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
|
|
67
|
-
|
|
68
|
-
Style/NumericPredicate:
|
|
69
|
-
Enabled: false
|
|
70
|
-
StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate
|
|
71
|
-
|
|
72
|
-
Style/ParallelAssignment:
|
|
73
|
-
Enabled: false
|
|
74
|
-
StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
|
|
75
|
-
|
|
76
|
-
Style/PercentLiteralDelimiters:
|
|
77
|
-
Enabled: false
|
|
78
|
-
StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters
|
|
79
|
-
|
|
80
|
-
Style/PerlBackrefs:
|
|
81
|
-
Enabled: false
|
|
82
|
-
StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs
|
|
83
|
-
|
|
84
|
-
Style/Semicolon:
|
|
85
|
-
Enabled: false
|
|
86
|
-
StyleGuide: https://relaxed.ruby.style/#stylesemicolon
|
|
87
|
-
|
|
88
|
-
Style/SignalException:
|
|
89
|
-
Enabled: false
|
|
90
|
-
StyleGuide: https://relaxed.ruby.style/#stylesignalexception
|
|
91
|
-
|
|
92
|
-
Style/SingleLineBlockParams:
|
|
93
|
-
Enabled: false
|
|
94
|
-
StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams
|
|
95
|
-
|
|
96
|
-
Style/SingleLineMethods:
|
|
97
|
-
Enabled: false
|
|
98
|
-
StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods
|
|
99
|
-
|
|
100
|
-
Layout/SpaceBeforeBlockBraces:
|
|
101
|
-
Enabled: false
|
|
102
|
-
StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces
|
|
103
|
-
|
|
104
|
-
Layout/SpaceInsideParens:
|
|
105
|
-
Enabled: false
|
|
106
|
-
StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens
|
|
107
|
-
|
|
108
|
-
Style/SpecialGlobalVars:
|
|
109
|
-
Enabled: false
|
|
110
|
-
StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars
|
|
111
|
-
|
|
112
|
-
Style/StringLiterals:
|
|
113
|
-
Enabled: false
|
|
114
|
-
StyleGuide: https://relaxed.ruby.style/#stylestringliterals
|
|
115
|
-
|
|
116
|
-
Style/TrailingCommaInArguments:
|
|
117
|
-
Enabled: false
|
|
118
|
-
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments
|
|
119
|
-
|
|
120
|
-
Style/TrailingCommaInArrayLiteral:
|
|
121
|
-
Enabled: false
|
|
122
|
-
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral
|
|
123
|
-
|
|
124
|
-
Style/TrailingCommaInHashLiteral:
|
|
125
|
-
Enabled: false
|
|
126
|
-
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
|
|
127
|
-
|
|
128
|
-
Style/SymbolArray:
|
|
129
|
-
Enabled: false
|
|
130
|
-
StyleGuide: http://relaxed.ruby.style/#stylesymbolarray
|
|
131
|
-
|
|
132
|
-
Style/WhileUntilModifier:
|
|
133
|
-
Enabled: false
|
|
134
|
-
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
|
|
135
|
-
|
|
136
|
-
Style/WordArray:
|
|
137
|
-
Enabled: false
|
|
138
|
-
StyleGuide: https://relaxed.ruby.style/#stylewordarray
|
|
139
|
-
|
|
140
|
-
Lint/AmbiguousRegexpLiteral:
|
|
141
|
-
Enabled: false
|
|
142
|
-
StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral
|
|
143
|
-
|
|
144
|
-
Lint/AssignmentInCondition:
|
|
145
|
-
Enabled: false
|
|
146
|
-
StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition
|
|
147
|
-
|
|
148
|
-
Layout/LineLength:
|
|
149
|
-
Enabled: false
|
|
150
|
-
|
|
151
|
-
Metrics:
|
|
152
|
-
Enabled: false
|
|
153
|
-
|
data/.rub
DELETED
|
File without changes
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4.0.5
|
data/.secrets.baseline
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "1.5.0",
|
|
3
|
-
"plugins_used": [
|
|
4
|
-
{
|
|
5
|
-
"name": "ArtifactoryDetector"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"name": "AWSKeyDetector"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"name": "AzureStorageKeyDetector"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "Base64HighEntropyString",
|
|
15
|
-
"limit": 4.5
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"name": "BasicAuthDetector"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "CloudantDetector"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"name": "DiscordBotTokenDetector"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"name": "GitHubTokenDetector"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "GitLabTokenDetector"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"name": "HexHighEntropyString",
|
|
34
|
-
"limit": 3.0
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"name": "IbmCloudIamDetector"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "IbmCosHmacDetector"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"name": "IPPublicDetector"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"name": "JwtTokenDetector"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"name": "KeywordDetector",
|
|
50
|
-
"keyword_exclude": ""
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"name": "MailchimpDetector"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"name": "NpmDetector"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "OpenAIDetector"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"name": "PrivateKeyDetector"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"name": "PypiTokenDetector"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"name": "SendGridDetector"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "SlackDetector"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"name": "SoftlayerDetector"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"name": "SquareOAuthDetector"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"name": "StripeDetector"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"name": "TelegramBotTokenDetector"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"name": "TwilioKeyDetector"
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
"filters_used": [
|
|
90
|
-
{
|
|
91
|
-
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
|
|
95
|
-
"min_level": 2
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"path": "detect_secrets.filters.heuristic.is_lock_file"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"path": "detect_secrets.filters.heuristic.is_sequential_string"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"path": "detect_secrets.filters.heuristic.is_swagger_file"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"path": "detect_secrets.filters.heuristic.is_templated_secret"
|
|
123
|
-
}
|
|
124
|
-
],
|
|
125
|
-
"results": {},
|
|
126
|
-
"generated_at": "2026-04-13T21:29:03Z"
|
|
127
|
-
}
|
data/Brewfile
DELETED
data/Rakefile
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/gem_tasks"
|
|
4
|
-
require "rspec/core/rake_task"
|
|
5
|
-
require "timeout"
|
|
6
|
-
require "yard"
|
|
7
|
-
|
|
8
|
-
def shell(*args)
|
|
9
|
-
puts "running: #{args.join(" ")}"
|
|
10
|
-
system(args.join(" "))
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
task :clean do
|
|
14
|
-
shell("rm -rf pkg/ tmp/ coverage/ doc/ ")
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
task gem: [:build] do
|
|
18
|
-
shell("gem install pkg/*")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
task permissions: [:clean] do
|
|
22
|
-
shell("chmod -v o+r,g+r * */* */*/* */*/*/* */*/*/*/* */*/*/*/*/*")
|
|
23
|
-
shell("find . -type d -exec chmod o+x,g+x {} \\;")
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
task build: :permissions
|
|
27
|
-
|
|
28
|
-
YARD::Rake::YardocTask.new(:doc) do |t|
|
|
29
|
-
t.files = %w[lib/**/*.rb exe/*.rb - README.md LICENSE.txt CHANGELOG.md]
|
|
30
|
-
t.options.unshift("--title", '"FlowEngine — DSL + AST for buildiong complex flows in Ruby."')
|
|
31
|
-
t.after = -> { exec("open doc/index.html") } if RUBY_PLATFORM =~ /darwin/
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
35
|
-
|
|
36
|
-
task default: :spec
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="99" height="20">
|
|
3
|
-
<linearGradient id="b" x2="0" y2="100%">
|
|
4
|
-
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
|
5
|
-
<stop offset="1" stop-opacity=".1"/>
|
|
6
|
-
</linearGradient>
|
|
7
|
-
<mask id="a">
|
|
8
|
-
<rect width="99" height="20" rx="3" fill="#fff"/>
|
|
9
|
-
</mask>
|
|
10
|
-
<g mask="url(#a)">
|
|
11
|
-
<path fill="#555" d="M0 0h63v20H0z"/>
|
|
12
|
-
<path fill="#4c1" d="M63 0h36v20H63z"/>
|
|
13
|
-
<path fill="url(#b)" d="M0 0h99v20H0z"/>
|
|
14
|
-
</g>
|
|
15
|
-
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
|
16
|
-
<text x="31.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
|
17
|
-
<text x="31.5" y="14">coverage</text>
|
|
18
|
-
<text x="80" y="15" fill="#010101" fill-opacity=".3">95%</text>
|
|
19
|
-
<text x="80" y="14">95%</text>
|
|
20
|
-
</g>
|
|
21
|
-
</svg>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require "bundler/setup"
|
|
5
|
-
require "inquirex"
|
|
6
|
-
|
|
7
|
-
DEFINITION = Inquirex.define id: "tax-intake-2025", version: "1.0.0" do
|
|
8
|
-
meta title: "Tax Preparation Intake", subtitle: "Let's understand your situation"
|
|
9
|
-
start :filing_status
|
|
10
|
-
|
|
11
|
-
ask :filing_status do
|
|
12
|
-
type :enum
|
|
13
|
-
question "What is your filing status?"
|
|
14
|
-
options single: "Single", married_jointly: "Married Filing Jointly"
|
|
15
|
-
widget target: :desktop, type: :radio_group, columns: 2
|
|
16
|
-
widget target: :mobile, type: :dropdown
|
|
17
|
-
transition to: :dependents
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
ask :dependents do
|
|
21
|
-
type :integer
|
|
22
|
-
question "How many dependents?"
|
|
23
|
-
default 0
|
|
24
|
-
transition to: :business_income
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
confirm :business_income do
|
|
28
|
-
question "Do you have business income?"
|
|
29
|
-
transition to: :business_count, if_rule: equals(:business_income, true)
|
|
30
|
-
transition to: :done
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
ask :business_count do
|
|
34
|
-
type :integer
|
|
35
|
-
question "How many businesses?"
|
|
36
|
-
transition to: :done
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
say :done do
|
|
40
|
-
text "Thanks for completing the intake."
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
engine = Inquirex::Engine.new(DEFINITION)
|
|
45
|
-
|
|
46
|
-
engine.answer("single") # filing_status
|
|
47
|
-
engine.answer(2) # dependents
|
|
48
|
-
engine.answer(false) # business_income
|
|
49
|
-
engine.advance # done (display step)
|
|
50
|
-
engine.finished? # => true
|
|
51
|
-
|
|
52
|
-
if __FILE__ == $0
|
|
53
|
-
require 'json'
|
|
54
|
-
puts JSON.pretty_generate(DEFINITION.to_h)
|
|
55
|
-
end
|
|
Binary file
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require_relative '01_readme_example'
|
|
4
|
-
require 'inquirex'
|
|
5
|
-
require 'stringio'
|
|
6
|
-
|
|
7
|
-
output = StringIO.new
|
|
8
|
-
exporter = Inquirex::Graph::MermaidExporter.new(DEFINITION)
|
|
9
|
-
output << exporter.export
|
|
10
|
-
|
|
11
|
-
source = <<~HTML
|
|
12
|
-
<html>
|
|
13
|
-
<head>
|
|
14
|
-
<meta charset="utf-8">
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
<meta charset="utf-8">
|
|
18
|
-
<div class="mermaid">
|
|
19
|
-
#{output.string}
|
|
20
|
-
</div>
|
|
21
|
-
<script type="module">
|
|
22
|
-
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
|
|
23
|
-
mermaid.initialize({ startOnLoad: true });
|
|
24
|
-
</script>
|
|
25
|
-
</html>
|
|
26
|
-
HTML
|
|
27
|
-
|
|
28
|
-
if __FILE__ == $0
|
|
29
|
-
File.write('mermaid.html', source)
|
|
30
|
-
system("open mermaid.html")
|
|
31
|
-
sleep 10
|
|
32
|
-
|
|
33
|
-
at_exit do
|
|
34
|
-
File.delete('mermaid.html')
|
|
35
|
-
end
|
|
36
|
-
end
|
data/examples/README.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Examples
|
|
2
|
-
|
|
3
|
-
This folder contains just a couple examples to demonstrate the API and the functionality.
|
|
4
|
-
|
|
5
|
-
For a fuller list of more comprehensive examples, please see the [examples in the `inquirex-tty` gem](https://github.com/inquirex/inquirex-tty/tree/main/examples).
|
|
6
|
-
|
|
7
|
-
## Running Examples
|
|
8
|
-
|
|
9
|
-
These examples are meant to be run as executables from the root level of the gem folder.
|
|
10
|
-
|
|
11
|
-
### First Example
|
|
12
|
-
|
|
13
|
-
This example should print to stdout the DSL definition in JSON:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# First example — creates a DSL definition and prints it to stdout in JSON format
|
|
17
|
-
./examples/01_readme_example.rb | jq
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### Second Example
|
|
21
|
-
|
|
22
|
-
This is a more interesting example. It builds on the first, takes that definition and uses the mermaid converter to write a tiny HTML file with a mermaid diagram inside, which represents the definition defined in the first file.
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# creates a mermaid.html file at the root of the project
|
|
26
|
-
# opens the browser with the file and waits 10 seconds
|
|
27
|
-
# deletes the HTML file and exits
|
|
28
|
-
./examples/02_readme_mermaid.rb
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
The mermaid file generated should look like this:
|
|
32
|
-
|
|
33
|
-
<img src="02_readme_mermaid.png" width="300px" text-align="left"></img>
|
data/justfile
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# Tell 'just' to run bash, source our setup script, then execute the recipe
|
|
2
|
-
set shell := ["bash", "-c"]
|
|
3
|
-
|
|
4
|
-
version := `grep VERSION lib/inquirex/version.rb | awk '{print $3}' | tr -d '"' | tr -d '\n'`
|
|
5
|
-
rbenv := 'eval "$(rbenv init bash)"; bundle exec '
|
|
6
|
-
repo := 'git@github.com:inquirex/inquirex.git'
|
|
7
|
-
|
|
8
|
-
[no-exit-message]
|
|
9
|
-
recipes:
|
|
10
|
-
just --choose
|
|
11
|
-
|
|
12
|
-
# Sync all dependencies
|
|
13
|
-
install:
|
|
14
|
-
bin/setup
|
|
15
|
-
|
|
16
|
-
build: install
|
|
17
|
-
|
|
18
|
-
# Lint and reformat files
|
|
19
|
-
lint:
|
|
20
|
-
{{ rbenv }} rubocop
|
|
21
|
-
|
|
22
|
-
# Lint and reformat files (-a) — pass -A as an argument
|
|
23
|
-
format *args:
|
|
24
|
-
{{ rbenv }} rubocop -a {{ args }}
|
|
25
|
-
|
|
26
|
-
# Run all the tests
|
|
27
|
-
test *args:
|
|
28
|
-
export ENVIRONMENT=test; {{ rbenv }} rspec {{args}}
|
|
29
|
-
|
|
30
|
-
# Run tests with coverage
|
|
31
|
-
test-coverage *args:
|
|
32
|
-
export ENVIRONMENT=test; export COVERAGE=true; {{ rbenv }} rspec {{ args }}
|
|
33
|
-
|
|
34
|
-
ci: lint test-coverage
|
|
35
|
-
|
|
36
|
-
alias check-all := ci
|
|
37
|
-
|
|
38
|
-
clean:
|
|
39
|
-
#!/usr/bin/env bash
|
|
40
|
-
@find . -name .DS_Store -delete -print || true
|
|
41
|
-
@rm -rf tmp/*
|
|
42
|
-
|
|
43
|
-
# Run all lefthook pre-commit hooks
|
|
44
|
-
lefthook:
|
|
45
|
-
{{ rbenv }} lefthook run pre-commit --all-files
|
|
46
|
-
|
|
47
|
-
# Print current gem version
|
|
48
|
-
version:
|
|
49
|
-
@echo "{{ version }}"
|
|
50
|
-
|
|
51
|
-
# Clobber
|
|
52
|
-
clobber:
|
|
53
|
-
{{ rbenv }} rake clobber
|
|
54
|
-
|
|
55
|
-
# Generate documentation
|
|
56
|
-
doc:
|
|
57
|
-
#!/usr/bin/env bash
|
|
58
|
-
{{ rbenv }} rake doc
|
|
59
|
-
|
|
60
|
-
# Create
|
|
61
|
-
publish: build
|
|
62
|
-
{{ rbenv }} rake release[remote]
|
|
63
|
-
|
|
64
|
-
# Tag v{{ version }}, publish the GH release, & refresh the Homebrew tap.
|
|
65
|
-
release:
|
|
66
|
-
git fetch --tags
|
|
67
|
-
git tag -f "v{{ version }}"
|
|
68
|
-
git push -f --tags
|
|
69
|
-
gh release delete -y "v{{ version }}" --repo {{ repo }} 2>/dev/null || true
|
|
70
|
-
gh release create "v{{ version }}" --generate-notes --repo {{ repo }}
|
data/lefthook.yml
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
output:
|
|
2
|
-
- summary
|
|
3
|
-
- failure
|
|
4
|
-
|
|
5
|
-
pre-commit:
|
|
6
|
-
parallel: true
|
|
7
|
-
jobs:
|
|
8
|
-
- name: lint
|
|
9
|
-
run: bundle exec rubocop -c .rubocop.yml {staged_files}
|
|
10
|
-
glob: "*.{rb,Gemfile}"
|
|
11
|
-
stage_fixed: true
|
|
12
|
-
|
|
13
|
-
- name: check for conflict markers and whitespace issues
|
|
14
|
-
run: git --no-pager diff --check
|
|
15
|
-
|
|
16
|
-
# If tests take >1 second, move this (or just the long-running tests) to pre-push.
|
|
17
|
-
- name: run tests
|
|
18
|
-
run: just test
|
|
19
|
-
|
|
20
|
-
- name: fix rubocop formatting issues
|
|
21
|
-
run: bundle exec rubocop -a {staged_files}
|
|
22
|
-
glob: "*.{rb,Gemfile,gemspec}"
|
|
23
|
-
stage_fixed: true
|
|
24
|
-
|
|
25
|
-
- name: spell check
|
|
26
|
-
run: codespell {staged_files}
|
|
27
|
-
glob: "*.{rb,md,gemspec}"
|
|
28
|
-
|
|
29
|
-
- name: format markdown
|
|
30
|
-
run: mdformat {staged_files}
|
|
31
|
-
glob: "*.md"
|
|
32
|
-
stage_fixed: true
|
|
33
|
-
|
|
34
|
-
- name: scan for secrets
|
|
35
|
-
run: detect-secrets-hook --baseline .secrets.baseline
|
data/sig/inquirex.rbs
DELETED