onboardable 1.6.0 → 1.7.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 +62 -36
- data/README.md +9 -12
- data/lib/onboardable/errors.rb +8 -0
- data/lib/onboardable/list/base.rb +14 -12
- data/lib/onboardable/list/builder.rb +14 -11
- data/lib/onboardable/list/navigation.rb +15 -13
- data/lib/onboardable/step.rb +11 -4
- data/lib/onboardable/version.rb +1 -1
- data/lib/onboardable.rb +5 -5
- data/sig/onboardable/list/base.rbs +3 -3
- data/sig/onboardable/list/builder.rbs +2 -2
- data/sig/onboardable/list/navigation.rbs +10 -2
- data/sig/onboardable/step.rbs +3 -7
- data/sig/onboardable.rbs +6 -2
- metadata +33 -53
- data/CODE_OF_CONDUCT.md +0 -120
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -93
- data/Rakefile +0 -12
- data/onboardable.gemspec +0 -52
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1d83b9d41592134927cc1cd817c3fe71296afb2e1830841a19e089a0f5728e46
|
|
4
|
+
data.tar.gz: 96be9c04f91bb5d41758507d0e8b278776b3bf2f020d7727bdde69e9198934de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1db951c625cf221676418bda44d8fc48e505acbcf282e49afecbf5b058a78bbe332485f733984513e0326381bfd6fedece1c8fa88179a2a8314572b37b889803
|
|
7
|
+
data.tar.gz: 582aafe668c68ec327cf20838376270e5de78c94021996140815f360c508aa2ef34a119ff8c7c203751118bdf724010b5b042ebe9507d2c29d944e3c11d41e58
|
data/CHANGELOG.md
CHANGED
|
@@ -1,72 +1,98 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.7.1 (2026-10-25)
|
|
4
|
+
|
|
5
|
+
- Fix RBS signatures and type-check `lib/` with Steep.
|
|
6
|
+
- Package only `lib/`, `sig/`, `README.md`, `CHANGELOG.md` and `LICENSE.txt` in the gem.
|
|
7
|
+
- Fix README examples: `#next_step?` usage and the custom progress formula.
|
|
8
|
+
- Update README release steps for trusted publishing.
|
|
9
|
+
- Run tests before publishing the gem.
|
|
10
|
+
- Publish through the `release` environment and pin GitHub Actions to commit SHAs.
|
|
11
|
+
- Enforce 100% line and branch coverage.
|
|
12
|
+
- Update development dependencies to their latest versions.
|
|
13
|
+
|
|
14
|
+
## 1.7.0 (2026-05-12)
|
|
15
|
+
|
|
16
|
+
- Update Ruby version requirements to 3.3.
|
|
17
|
+
- Drop Ruby 3.2 from the CI matrix.
|
|
18
|
+
- Update development dependencies to their latest versions.
|
|
19
|
+
|
|
20
|
+
## 1.6.0 (2025-12-26)
|
|
4
21
|
|
|
5
22
|
- Add support for Ruby 4.0.
|
|
6
23
|
|
|
7
|
-
## 1.5.0
|
|
24
|
+
## 1.5.0 (2025-08-02)
|
|
8
25
|
|
|
9
26
|
- Drop support for Ruby 3.1.
|
|
10
27
|
- Update development dependencies to their latest versions.
|
|
11
28
|
|
|
12
|
-
## 1.4.0
|
|
29
|
+
## 1.4.0 (2025-04-01)
|
|
13
30
|
|
|
14
31
|
- Add support for Ruby 3.4.
|
|
15
32
|
- Drop support for Ruby 3.0.
|
|
16
33
|
|
|
17
|
-
## 1.3.3
|
|
34
|
+
## 1.3.3 (2024-08-15)
|
|
18
35
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
36
|
+
- Update RBS files to improve type-checking.
|
|
37
|
+
- Add the GitHub Actions package ecosystem to Dependabot.
|
|
21
38
|
|
|
22
|
-
## 1.3.2
|
|
39
|
+
## 1.3.2 (2024-07-09)
|
|
23
40
|
|
|
24
|
-
-
|
|
41
|
+
- Adjust RBS files to improve type-checking.
|
|
25
42
|
|
|
26
|
-
## 1.3.1
|
|
43
|
+
## 1.3.1 (2024-06-10)
|
|
27
44
|
|
|
28
|
-
-
|
|
45
|
+
- Fix the custom progress formula calculation.
|
|
29
46
|
|
|
30
|
-
## 1.3.0
|
|
47
|
+
## 1.3.0 (2024-06-10)
|
|
31
48
|
|
|
32
|
-
-
|
|
49
|
+
- Add an option to calculate onboarding progress using a custom formula.
|
|
50
|
+
- `has_onboarding` now accepts options and creates a new builder on each call,
|
|
51
|
+
so repeated calls replace the steps instead of appending to them.
|
|
52
|
+
- `list_builder=` is now a plain setter and no longer takes a block.
|
|
53
|
+
- Add the public `onboarding=` class method; `has_onboarding` is now its alias.
|
|
33
54
|
|
|
34
|
-
## 1.2.2
|
|
55
|
+
## 1.2.2 (2024-06-03)
|
|
35
56
|
|
|
36
|
-
-
|
|
57
|
+
- Fix the default `#current_step` when no step name is given.
|
|
37
58
|
|
|
38
|
-
## 1.2.1
|
|
59
|
+
## 1.2.1 (2024-06-01)
|
|
39
60
|
|
|
40
|
-
-
|
|
61
|
+
- Add trusted publishing to the release workflow.
|
|
62
|
+
- **Breaking:** rename `List::Builder#build!` to `#build` and
|
|
63
|
+
`#create_step_from!` to `#create_step_from` (no aliases kept).
|
|
41
64
|
|
|
42
|
-
## 1.2.0
|
|
65
|
+
## 1.2.0 (2024-05-25)
|
|
43
66
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
67
|
+
- Add `#next_step?` method to check if the target step is the next step.
|
|
68
|
+
- Add `#prev_step?` method to check if the target step is the previous step.
|
|
69
|
+
- Add `#current_step?` method to check if the target step is the current step.
|
|
47
70
|
|
|
48
|
-
## 1.1.1
|
|
71
|
+
## 1.1.1 (2024-05-21)
|
|
49
72
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
73
|
+
- Add `onboarding` class method that builds the onboarding list.
|
|
74
|
+
- Add [documentation link](https://rubydoc.info/gems/onboardable) to the gemspec.
|
|
52
75
|
|
|
53
|
-
## 1.1.0
|
|
76
|
+
## 1.1.0 (2024-05-21)
|
|
54
77
|
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
78
|
+
- Add `step_from` method for adding steps from external sources.
|
|
79
|
+
- Warn when a step with an existing name is overridden.
|
|
80
|
+
- Add YARD documentation.
|
|
81
|
+
- **Breaking:** rename `Onboardable::ListBuilder` to `Onboardable::List::Builder`
|
|
82
|
+
and `Onboardable::List` to `Onboardable::List::Base`.
|
|
83
|
+
- **Breaking:** rename the public `ListBuilder#add_step` to `List::Builder#create_step`
|
|
84
|
+
(the `step` DSL alias is unchanged).
|
|
58
85
|
|
|
59
|
-
## 1.0.1
|
|
86
|
+
## 1.0.1 (2024-05-09)
|
|
60
87
|
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
- Added `progress` method for calculating onboarding completion percentage.
|
|
88
|
+
- Add `first_step` and `last_step` methods to access the boundaries of the step list.
|
|
89
|
+
- Add `progress` method for calculating the onboarding completion percentage.
|
|
64
90
|
|
|
65
|
-
## 1.0.0
|
|
91
|
+
## 1.0.0 (2024-05-08)
|
|
66
92
|
|
|
67
|
-
-
|
|
68
|
-
|
|
93
|
+
- `first_step?` and `last_step?` accept an optional step argument,
|
|
94
|
+
allowing checks against any step.
|
|
69
95
|
|
|
70
|
-
## 0.1.0
|
|
96
|
+
## 0.1.0 (2024-05-07)
|
|
71
97
|
|
|
72
|
-
- Initial release
|
|
98
|
+
- Initial release.
|
data/README.md
CHANGED
|
@@ -59,11 +59,6 @@ end
|
|
|
59
59
|
|
|
60
60
|
### Using the Onboarding Steps
|
|
61
61
|
|
|
62
|
-
To enhance the guidance for users on how to navigate and manage the
|
|
63
|
-
onboarding flow using the Onboardable gem, here's a concise guide that
|
|
64
|
-
could be included in the documentation. This guide covers initialization,
|
|
65
|
-
navigation, step verification, and completion of the onboarding process.
|
|
66
|
-
|
|
67
62
|
After defining and accessing the onboarding steps as described
|
|
68
63
|
earlier, manage the onboarding process through various controls
|
|
69
64
|
that allow step navigation and state verification:
|
|
@@ -136,7 +131,7 @@ that allow step navigation and state verification:
|
|
|
136
131
|
onboarding.first_step?(step)
|
|
137
132
|
onboarding.last_step?(step)
|
|
138
133
|
onboarding.current_step?(step)
|
|
139
|
-
onboarding.
|
|
134
|
+
onboarding.next_step?(step)
|
|
140
135
|
onboarding.prev_step?(step)
|
|
141
136
|
```
|
|
142
137
|
|
|
@@ -153,7 +148,7 @@ that allow step navigation and state verification:
|
|
|
153
148
|
that takes the current step index and the total number of steps as arguments.
|
|
154
149
|
|
|
155
150
|
```ruby
|
|
156
|
-
CALCULATION = ->(step_index, steps_size) { step_index + steps_size }
|
|
151
|
+
CALCULATION = ->(step_index, steps_size) { ((step_index + 1).to_f / steps_size) * 100 }
|
|
157
152
|
onboarding.progress(CALCULATION)
|
|
158
153
|
```
|
|
159
154
|
|
|
@@ -164,7 +159,7 @@ that allow step navigation and state verification:
|
|
|
164
159
|
class User
|
|
165
160
|
include Onboardable
|
|
166
161
|
|
|
167
|
-
CALCULATION = ->(step_index, steps_size) { step_index + steps_size }
|
|
162
|
+
CALCULATION = ->(step_index, steps_size) { ((step_index + 1).to_f / steps_size) * 100 }
|
|
168
163
|
|
|
169
164
|
has_onboarding progress_calculation: CALCULATION do
|
|
170
165
|
# ...
|
|
@@ -233,10 +228,12 @@ user-friendly onboarding process using the Onboardable gem.
|
|
|
233
228
|
2. Then, run `rake spec` to run the tests.
|
|
234
229
|
3. Also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
235
230
|
4. To install this gem onto your local machine, run `bundle exec rake install`.
|
|
236
|
-
5. To release a new version, update the version number in `version.rb`.
|
|
237
|
-
6.
|
|
238
|
-
|
|
239
|
-
|
|
231
|
+
5. To release a new version, update the version number in `lib/onboardable/version.rb`.
|
|
232
|
+
6. In `CHANGELOG.md`, rename the `## Unreleased` heading to the new version and release date
|
|
233
|
+
(e.g. `## 1.8.0 (2026-11-01)`), then merge the changes into `main`.
|
|
234
|
+
7. Run the [Publish](https://github.com/dmrAnderson/onboardable/actions/workflows/publish.yml)
|
|
235
|
+
workflow, which tags the version and pushes the gem to [rubygems.org](https://rubygems.org)
|
|
236
|
+
via trusted publishing.
|
|
240
237
|
|
|
241
238
|
## 🤝 Contributing
|
|
242
239
|
|
data/lib/onboardable/errors.rb
CHANGED
|
@@ -10,6 +10,7 @@ module Onboardable
|
|
|
10
10
|
#
|
|
11
11
|
# @param klass [Class] The class that does not have the method defined.
|
|
12
12
|
# @param method [Symbol] The method that was called on the class.
|
|
13
|
+
# @return [void]
|
|
13
14
|
def initialize(klass, method)
|
|
14
15
|
super("Method `#{method}` is not defined for `#{klass}`.")
|
|
15
16
|
end
|
|
@@ -21,6 +22,7 @@ module Onboardable
|
|
|
21
22
|
#
|
|
22
23
|
# @param klass [Class] The class that failed to convert.
|
|
23
24
|
# @param step [Object] The object that was attempted to be converted to a Step.
|
|
25
|
+
# @return [void]
|
|
24
26
|
def initialize(klass, step)
|
|
25
27
|
super("Can't convert #{klass} to Step (#{klass}#to_onboarding_step gives #{step.class}).")
|
|
26
28
|
end
|
|
@@ -30,6 +32,7 @@ module Onboardable
|
|
|
30
32
|
class EmptyStepsError < Error
|
|
31
33
|
# Initializes a new instance of EmptyStepsError.
|
|
32
34
|
# This error indicates that an operation requiring non-empty steps was attempted on an empty collection.
|
|
35
|
+
# @return [void]
|
|
33
36
|
def initialize
|
|
34
37
|
super('Cannot be performed because the steps is empty.')
|
|
35
38
|
end
|
|
@@ -41,6 +44,7 @@ module Onboardable
|
|
|
41
44
|
#
|
|
42
45
|
# @param step [String] The invalid step that triggered the error.
|
|
43
46
|
# @param expected_steps [Array<String>] The list of valid steps expected at this point.
|
|
47
|
+
# @return [void]
|
|
44
48
|
def initialize(step, expected_steps)
|
|
45
49
|
super("Invalid step: `#{step}`. Must be one of: `#{expected_steps.join('`, `')}`.")
|
|
46
50
|
end
|
|
@@ -52,6 +56,7 @@ module Onboardable
|
|
|
52
56
|
#
|
|
53
57
|
# @param comparison [Integer] The invalid comparison result that triggered the error.
|
|
54
58
|
# @param expected_comparisons [Array<Integer>] The list of valid comparison results expected.
|
|
59
|
+
# @return [void]
|
|
55
60
|
def initialize(comparison, expected_comparisons)
|
|
56
61
|
super("Invalid comparison result: `#{comparison}`. Must be one of: #{expected_comparisons.join('`, `')}.")
|
|
57
62
|
end
|
|
@@ -63,6 +68,7 @@ module Onboardable
|
|
|
63
68
|
#
|
|
64
69
|
# @param step [String] The last step that was attempted to be surpassed.
|
|
65
70
|
# @param expected_steps [Array<String>] The complete list of valid steps in the onboarding process.
|
|
71
|
+
# @return [void]
|
|
66
72
|
def initialize(step, expected_steps)
|
|
67
73
|
super("Currently `#{step}` the last step. Available steps are: `#{expected_steps.join('`, `')}`.")
|
|
68
74
|
end
|
|
@@ -74,6 +80,7 @@ module Onboardable
|
|
|
74
80
|
#
|
|
75
81
|
# @param step [String] The first step that was attempted to be preceded.
|
|
76
82
|
# @param expected_steps [Array<String>] The complete list of valid steps in the onboarding process.
|
|
83
|
+
# @return [void]
|
|
77
84
|
def initialize(step, expected_steps)
|
|
78
85
|
super("Currently `#{step}` the first step. Available steps are: `#{expected_steps.join('`, `')}`.")
|
|
79
86
|
end
|
|
@@ -85,6 +92,7 @@ module Onboardable
|
|
|
85
92
|
#
|
|
86
93
|
# @param status [Symbol] The invalid status that triggered the error.
|
|
87
94
|
# @param expected_statuses [Array<Symbol>] The list of valid statuses expected.
|
|
95
|
+
# @return [void]
|
|
88
96
|
def initialize(status, expected_statuses)
|
|
89
97
|
super("Invalid status: `#{status}`. Must be one of: `#{expected_statuses.join('`, `')}`.")
|
|
90
98
|
end
|
|
@@ -10,19 +10,20 @@ module Onboardable
|
|
|
10
10
|
# Default calculation for onboarding progress as a percentage.
|
|
11
11
|
PROGRESS_CALCULATION = ->(step_index, steps_size) { (step_index.to_f / steps_size) * 100 }
|
|
12
12
|
|
|
13
|
-
# @return [Array<Step>] The steps in the list.
|
|
13
|
+
# @return [Array<Onboardable::Step>] The steps in the list.
|
|
14
14
|
attr_reader :steps
|
|
15
15
|
|
|
16
|
-
# @return [Step] The current step in the list.
|
|
16
|
+
# @return [Onboardable::Step] The current step in the list.
|
|
17
17
|
attr_reader :current_step
|
|
18
18
|
|
|
19
19
|
# Initializes a new instance of the List with steps and a current step.
|
|
20
20
|
#
|
|
21
|
-
# @param steps [Array<Step>] An array of steps comprising the onboarding process.
|
|
22
|
-
# @param current_step [Step] The step currently active in the process.
|
|
21
|
+
# @param steps [Array<Onboardable::Step>] An array of steps comprising the onboarding process.
|
|
22
|
+
# @param current_step [Onboardable::Step] The step currently active in the process.
|
|
23
23
|
# @param options [Hash] Optional parameters for configuring the list.
|
|
24
24
|
# @option options [Proc] :progress_calculation A custom calculation for progress percentage.
|
|
25
25
|
# Receives step_index and steps_size as arguments and returns a Float.
|
|
26
|
+
# @return [void]
|
|
26
27
|
def initialize(steps, current_step, options = {})
|
|
27
28
|
self.steps = steps
|
|
28
29
|
self.current_step = current_step
|
|
@@ -45,16 +46,16 @@ module Onboardable
|
|
|
45
46
|
|
|
46
47
|
# Sets and validates an array of steps.
|
|
47
48
|
#
|
|
48
|
-
# @param steps [Array<Step>] The steps to be assigned to the list.
|
|
49
|
-
# @return [Array<Step>] The assigned steps.
|
|
49
|
+
# @param steps [Array<Onboardable::Step>] The steps to be assigned to the list.
|
|
50
|
+
# @return [Array<Onboardable::Step>] The assigned steps.
|
|
50
51
|
def steps=(steps)
|
|
51
52
|
@steps = Array(Array.try_convert(steps)).freeze
|
|
52
53
|
end
|
|
53
54
|
|
|
54
55
|
# Updates the current step and recalibrates the status of all steps in the list.
|
|
55
56
|
#
|
|
56
|
-
# @param current_step [Step] The new current step to set.
|
|
57
|
-
# @return [Step] The updated current step.
|
|
57
|
+
# @param current_step [Onboardable::Step] The new current step to set.
|
|
58
|
+
# @return [Onboardable::Step] The updated current step.
|
|
58
59
|
def current_step=(current_step)
|
|
59
60
|
step_index(current_step).then do |index|
|
|
60
61
|
update_each_step_status(index)
|
|
@@ -74,7 +75,7 @@ module Onboardable
|
|
|
74
75
|
|
|
75
76
|
# Determines the index of a given step in the list, ensuring the step exists.
|
|
76
77
|
#
|
|
77
|
-
# @param step [Step] The step for which the index is requested.
|
|
78
|
+
# @param step [Onboardable::Step] The step for which the index is requested.
|
|
78
79
|
# @return [Integer] The index of the step within the list.
|
|
79
80
|
def step_index(step)
|
|
80
81
|
steps.index { |item| item == step } || step_error!(step)
|
|
@@ -83,7 +84,7 @@ module Onboardable
|
|
|
83
84
|
# Updates the status of each step in the list based on the current step index.
|
|
84
85
|
#
|
|
85
86
|
# @param current_step_index [Integer] The index of the current step in the list.
|
|
86
|
-
# @return [Array<Step>] The updated steps array.
|
|
87
|
+
# @return [Array<Onboardable::Step>] The updated steps array.
|
|
87
88
|
def update_each_step_status(current_step_index)
|
|
88
89
|
steps.each_with_index do |step, index|
|
|
89
90
|
step.update_status!(index <=> current_step_index)
|
|
@@ -92,8 +93,9 @@ module Onboardable
|
|
|
92
93
|
|
|
93
94
|
# Raises a StepError indicating an invalid step was encountered.
|
|
94
95
|
#
|
|
95
|
-
# @param step [Step] The step that triggered the error.
|
|
96
|
-
# @
|
|
96
|
+
# @param step [Onboardable::Step] The step that triggered the error.
|
|
97
|
+
# @return [void]
|
|
98
|
+
# @raise [Onboardable::StepError] Raises an error if the step does not exist in the list.
|
|
97
99
|
def step_error!(step)
|
|
98
100
|
raise StepError.new(step.to_str, steps.map(&:to_str))
|
|
99
101
|
end
|
|
@@ -16,7 +16,7 @@ module Onboardable
|
|
|
16
16
|
options[STEP_KEY] ||= {}
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
# @return [Step] The current step in the building process, defaulting to the first added step.
|
|
19
|
+
# @return [Onboardable::Step] The current step in the building process, defaulting to the first added step.
|
|
20
20
|
attr_accessor :current_step
|
|
21
21
|
|
|
22
22
|
# Initializes a new instance of ListBuilder.
|
|
@@ -24,6 +24,7 @@ module Onboardable
|
|
|
24
24
|
# @param options [Hash] Options to be set for the builder.
|
|
25
25
|
# @option options [Proc] :progress_calculation A custom calculation for progress percentage.
|
|
26
26
|
# Receives step_index and steps_size as arguments and returns a Float.
|
|
27
|
+
# @return [void]
|
|
27
28
|
def initialize(options = {})
|
|
28
29
|
self.options = options
|
|
29
30
|
end
|
|
@@ -32,7 +33,7 @@ module Onboardable
|
|
|
32
33
|
#
|
|
33
34
|
# @param name [String] The name of the step.
|
|
34
35
|
# @param data [Hash] The data associated with the step.
|
|
35
|
-
# @return [Step] The created step.
|
|
36
|
+
# @return [Onboardable::Step] The created step.
|
|
36
37
|
def create_step(name, data = {})
|
|
37
38
|
Step.new(name, data).tap { |step| add_step(step) }
|
|
38
39
|
end
|
|
@@ -41,7 +42,7 @@ module Onboardable
|
|
|
41
42
|
# Converts a class to a Step object and adds it to the builder.
|
|
42
43
|
#
|
|
43
44
|
# @param klass [Class] The class to be converted to a step.
|
|
44
|
-
# @return [Step] The converted step.
|
|
45
|
+
# @return [Onboardable::Step] The converted step.
|
|
45
46
|
def create_step_from(klass)
|
|
46
47
|
(Step.try_convert(klass) || undefined_method_error!(klass)).tap { |step| add_step(step) }
|
|
47
48
|
end
|
|
@@ -50,7 +51,7 @@ module Onboardable
|
|
|
50
51
|
# Constructs a new List object from the steps added to the builder.
|
|
51
52
|
#
|
|
52
53
|
# @param current_step_name [String, nil] The name of the current step.
|
|
53
|
-
# @return [Base] A new List object initialized with the steps and the specified current step.
|
|
54
|
+
# @return [Onboardable::List::Base] A new List object initialized with the steps and the specified current step.
|
|
54
55
|
def build(current_step_name = nil)
|
|
55
56
|
Base.new(
|
|
56
57
|
convert_to_steps!,
|
|
@@ -69,14 +70,15 @@ module Onboardable
|
|
|
69
70
|
# @param options [Hash] Options to be set for the builder.
|
|
70
71
|
# @option options [Proc] :progress_calculation A custom calculation for progress percentage.
|
|
71
72
|
# Receives step_index and steps_size as arguments and returns a Float.
|
|
73
|
+
# @return [Hash] The assigned options.
|
|
72
74
|
def options=(options)
|
|
73
75
|
@options = Hash(options).except(STEP_KEY)
|
|
74
76
|
end
|
|
75
77
|
|
|
76
78
|
# Adds a step to the builder.
|
|
77
79
|
#
|
|
78
|
-
# @param step [Step] The step to be added.
|
|
79
|
-
# @return [Step] The added step.
|
|
80
|
+
# @param step [Onboardable::Step] The step to be added.
|
|
81
|
+
# @return [Onboardable::Step] The added step.
|
|
80
82
|
def add_step(step)
|
|
81
83
|
step.name.then do |name|
|
|
82
84
|
warn_about_override(name) if steps.key?(name)
|
|
@@ -88,8 +90,8 @@ module Onboardable
|
|
|
88
90
|
|
|
89
91
|
# Converts the internal hash of steps to an array of Step objects.
|
|
90
92
|
#
|
|
91
|
-
# @return [Array<Step>] An array of steps.
|
|
92
|
-
# @raise [EmptyStepsError] Raises if there are no steps to convert.
|
|
93
|
+
# @return [Array<Onboardable::Step>] An array of steps.
|
|
94
|
+
# @raise [Onboardable::EmptyStepsError] Raises if there are no steps to convert.
|
|
93
95
|
def convert_to_steps!
|
|
94
96
|
steps.any? ? steps.values : raise(EmptyStepsError)
|
|
95
97
|
end
|
|
@@ -97,8 +99,8 @@ module Onboardable
|
|
|
97
99
|
# Retrieves a Step object from the builder's steps based on the step name.
|
|
98
100
|
#
|
|
99
101
|
# @param name [String] The name of the step to be converted to a Step object.
|
|
100
|
-
# @return [Step] The corresponding Step object.
|
|
101
|
-
# @raise [StepError] Raises if the specified step name is not present in steps hash.
|
|
102
|
+
# @return [Onboardable::Step] The corresponding Step object.
|
|
103
|
+
# @raise [Onboardable::StepError] Raises if the specified step name is not present in steps hash.
|
|
102
104
|
def convert_to_step!(name)
|
|
103
105
|
steps[name] || raise(StepError.new(name, steps.keys))
|
|
104
106
|
end
|
|
@@ -106,7 +108,8 @@ module Onboardable
|
|
|
106
108
|
# Raises an UndefinedMethodError indicating that the conversion method is not defined for the class.
|
|
107
109
|
#
|
|
108
110
|
# @param klass [Class] The class that does not have the conversion method defined.
|
|
109
|
-
# @
|
|
111
|
+
# @return [void]
|
|
112
|
+
# @raise [Onboardable::UndefinedMethodError] Raises an error indicating the missing conversion method.
|
|
110
113
|
def undefined_method_error!(klass)
|
|
111
114
|
raise UndefinedMethodError.new(klass, Step::CONVERSION_METHOD)
|
|
112
115
|
end
|
|
@@ -6,7 +6,7 @@ module Onboardable
|
|
|
6
6
|
module Navigation
|
|
7
7
|
# Returns the next step in the onboarding process.
|
|
8
8
|
#
|
|
9
|
-
# @return [Step, nil] The next step in the list or nil if the current step is the last one.
|
|
9
|
+
# @return [Onboardable::Step, nil] The next step in the list or nil if the current step is the last one.
|
|
10
10
|
def next_step
|
|
11
11
|
current_index = step_index(current_step)
|
|
12
12
|
steps[current_index.next]
|
|
@@ -14,7 +14,7 @@ module Onboardable
|
|
|
14
14
|
|
|
15
15
|
# Checks if the specified step is the next step in the onboarding process.
|
|
16
16
|
#
|
|
17
|
-
# @param step [Step] The step to check.
|
|
17
|
+
# @param step [Onboardable::Step] The step to check.
|
|
18
18
|
# @return [Boolean] True if the specified step is the next step, false otherwise.
|
|
19
19
|
def next_step?(step)
|
|
20
20
|
next_step == step
|
|
@@ -22,14 +22,14 @@ module Onboardable
|
|
|
22
22
|
|
|
23
23
|
# Moves the current step pointer to the next step in the onboarding process.
|
|
24
24
|
#
|
|
25
|
-
# @return [Step] The next step in the list.
|
|
25
|
+
# @return [Onboardable::Step] The next step in the list.
|
|
26
26
|
def next_step!
|
|
27
27
|
self.current_step = next_step || last_step_error!
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
# Returns the previous step in the onboarding process.
|
|
31
31
|
#
|
|
32
|
-
# @return [Step, nil] The previous step in the list or nil if the current step is the first one.
|
|
32
|
+
# @return [Onboardable::Step, nil] The previous step in the list or nil if the current step is the first one.
|
|
33
33
|
def prev_step
|
|
34
34
|
current_index = step_index(current_step)
|
|
35
35
|
current_index.positive? ? steps[current_index.pred] : nil
|
|
@@ -37,7 +37,7 @@ module Onboardable
|
|
|
37
37
|
|
|
38
38
|
# Checks if the specified step is the previous step in the onboarding process.
|
|
39
39
|
#
|
|
40
|
-
# @param step [Step] The step to check.
|
|
40
|
+
# @param step [Onboardable::Step] The step to check.
|
|
41
41
|
# @return [Boolean] True if the specified step is the previous step, false otherwise.
|
|
42
42
|
def prev_step?(step)
|
|
43
43
|
prev_step == step
|
|
@@ -45,14 +45,14 @@ module Onboardable
|
|
|
45
45
|
|
|
46
46
|
# Moves the current step pointer to the previous step in the onboarding process.
|
|
47
47
|
#
|
|
48
|
-
# @return [Step] The previous step in the list.
|
|
48
|
+
# @return [Onboardable::Step] The previous step in the list.
|
|
49
49
|
def prev_step!
|
|
50
50
|
self.current_step = prev_step || first_step_error!
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
# Checks if the specified step is the first step in the onboarding process.
|
|
54
54
|
#
|
|
55
|
-
# @param step [Step] The step to check (defaults to the current step if not specified).
|
|
55
|
+
# @param step [Onboardable::Step] The step to check (defaults to the current step if not specified).
|
|
56
56
|
# @return [Boolean] True if the specified step is the first step, false otherwise.
|
|
57
57
|
def first_step?(step = current_step)
|
|
58
58
|
first_step == step
|
|
@@ -60,7 +60,7 @@ module Onboardable
|
|
|
60
60
|
|
|
61
61
|
# Checks if the specified step is the last step in the onboarding process.
|
|
62
62
|
#
|
|
63
|
-
# @param step [Step] The step to check (defaults to the current step if not specified).
|
|
63
|
+
# @param step [Onboardable::Step] The step to check (defaults to the current step if not specified).
|
|
64
64
|
# @return [Boolean] True if the specified step is the last step, false otherwise.
|
|
65
65
|
def last_step?(step = current_step)
|
|
66
66
|
last_step == step
|
|
@@ -68,14 +68,14 @@ module Onboardable
|
|
|
68
68
|
|
|
69
69
|
# Retrieves the first step in the onboarding process.
|
|
70
70
|
#
|
|
71
|
-
# @return [Step] The first step in the list.
|
|
71
|
+
# @return [Onboardable::Step] The first step in the list.
|
|
72
72
|
def first_step
|
|
73
73
|
steps.fetch(0)
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
# Checks if the specified step is the current step in the onboarding process.
|
|
77
77
|
#
|
|
78
|
-
# @param step [Step] The step to check.
|
|
78
|
+
# @param step [Onboardable::Step] The step to check.
|
|
79
79
|
# @return [Boolean] True if the specified step is the current step, false otherwise.
|
|
80
80
|
def current_step?(step)
|
|
81
81
|
current_step == step
|
|
@@ -83,7 +83,7 @@ module Onboardable
|
|
|
83
83
|
|
|
84
84
|
# Retrieves the last step in the onboarding process.
|
|
85
85
|
#
|
|
86
|
-
# @return [Step] The last step in the list.
|
|
86
|
+
# @return [Onboardable::Step] The last step in the list.
|
|
87
87
|
def last_step
|
|
88
88
|
steps.fetch(-1)
|
|
89
89
|
end
|
|
@@ -92,14 +92,16 @@ module Onboardable
|
|
|
92
92
|
|
|
93
93
|
# Raises a FirstStepError indicating the current step is the first step in the onboarding process.
|
|
94
94
|
#
|
|
95
|
-
# @
|
|
95
|
+
# @return [void]
|
|
96
|
+
# @raise [Onboardable::FirstStepError] The error indicating the current step is the first step.
|
|
96
97
|
def first_step_error!
|
|
97
98
|
raise FirstStepError.new(current_step.name, steps.map(&:to_str))
|
|
98
99
|
end
|
|
99
100
|
|
|
100
101
|
# Raises a LastStepError indicating the current step is the last step in the onboarding process.
|
|
101
102
|
#
|
|
102
|
-
# @
|
|
103
|
+
# @return [void]
|
|
104
|
+
# @raise [Onboardable::LastStepError] The error indicating the current step is the last step.
|
|
103
105
|
def last_step_error!
|
|
104
106
|
raise LastStepError.new(current_step.name, steps.map(&:to_str))
|
|
105
107
|
end
|
data/lib/onboardable/step.rb
CHANGED
|
@@ -23,7 +23,8 @@ module Onboardable
|
|
|
23
23
|
# Attempts to convert a class to a Step object using a specified conversion method.
|
|
24
24
|
#
|
|
25
25
|
# @param klass [Class] The class to convert to a Step.
|
|
26
|
-
# @return [Step, nil] The converted Step object,
|
|
26
|
+
# @return [Onboardable::Step, nil] The converted Step object,
|
|
27
|
+
# or nil if the class does not respond to the conversion method.
|
|
27
28
|
def try_convert(klass)
|
|
28
29
|
return unless klass.respond_to?(CONVERSION_METHOD)
|
|
29
30
|
|
|
@@ -38,7 +39,8 @@ module Onboardable
|
|
|
38
39
|
#
|
|
39
40
|
# @param klass [Class] The class that failed to convert.
|
|
40
41
|
# @param step [Object] The invalid object returned from the conversion method.
|
|
41
|
-
# @
|
|
42
|
+
# @return [void]
|
|
43
|
+
# @raise [Onboardable::StepConversionError] Raises an error for a failed conversion attempt.
|
|
42
44
|
def conversion_error!(klass, step)
|
|
43
45
|
raise StepConversionError.new(klass, step)
|
|
44
46
|
end
|
|
@@ -57,6 +59,7 @@ module Onboardable
|
|
|
57
59
|
#
|
|
58
60
|
# @param name [String] The name of the step.
|
|
59
61
|
# @param data [Hash] The custom data associated with the step.
|
|
62
|
+
# @return [void]
|
|
60
63
|
def initialize(name, data = {})
|
|
61
64
|
self.name = name
|
|
62
65
|
self.data = data
|
|
@@ -86,7 +89,7 @@ module Onboardable
|
|
|
86
89
|
|
|
87
90
|
# Compares this step to another to determine if they are equivalent, based on the step name.
|
|
88
91
|
#
|
|
89
|
-
# @param other [Step] The step to compare with.
|
|
92
|
+
# @param other [Onboardable::Step] The step to compare with.
|
|
90
93
|
# @return [Boolean] True if both steps have the same name, false otherwise.
|
|
91
94
|
def ==(other)
|
|
92
95
|
to_str == other.to_str
|
|
@@ -117,6 +120,7 @@ module Onboardable
|
|
|
117
120
|
# Sets the name of the step, ensuring it is a valid String.
|
|
118
121
|
#
|
|
119
122
|
# @param name [String] The raw name of the step.
|
|
123
|
+
# @return [String] The frozen name.
|
|
120
124
|
def name=(name)
|
|
121
125
|
@name = String.new(name).freeze
|
|
122
126
|
end
|
|
@@ -124,6 +128,7 @@ module Onboardable
|
|
|
124
128
|
# Sets the status of the step.
|
|
125
129
|
#
|
|
126
130
|
# @param status [Symbol] The new status of the step.
|
|
131
|
+
# @return [Symbol] The new status.
|
|
127
132
|
def status=(status)
|
|
128
133
|
STATUSES.include?(status) || raise(StepStatusError.new(status, STATUSES))
|
|
129
134
|
|
|
@@ -133,6 +138,7 @@ module Onboardable
|
|
|
133
138
|
# Sets the custom data for the step, ensuring it is a valid Hash.
|
|
134
139
|
#
|
|
135
140
|
# @param data [Hash] The raw custom data.
|
|
141
|
+
# @return [Hash] The frozen custom data.
|
|
136
142
|
def data=(data)
|
|
137
143
|
@data = Hash(data).freeze
|
|
138
144
|
end
|
|
@@ -140,7 +146,8 @@ module Onboardable
|
|
|
140
146
|
# Raises an error for an invalid comparison result.
|
|
141
147
|
#
|
|
142
148
|
# @param comparison_result [Integer] The invalid comparison result.
|
|
143
|
-
# @
|
|
149
|
+
# @return [void]
|
|
150
|
+
# @raise [Onboardable::ComparisonResultError] Raises an error for an invalid comparison result.
|
|
144
151
|
def comparison_result_error!(comparison_result)
|
|
145
152
|
raise ComparisonResultError.new(comparison_result, (-1..1).to_a)
|
|
146
153
|
end
|
data/lib/onboardable/version.rb
CHANGED
data/lib/onboardable.rb
CHANGED
|
@@ -21,7 +21,7 @@ module Onboardable
|
|
|
21
21
|
|
|
22
22
|
# Class methods for managing the onboarding process, added to the class that includes the Onboardable module.
|
|
23
23
|
module ClassMethods
|
|
24
|
-
# @return [List::Builder] The ListBuilder for configuring onboarding steps.
|
|
24
|
+
# @return [Onboardable::List::Builder] The ListBuilder for configuring onboarding steps.
|
|
25
25
|
attr_accessor :list_builder
|
|
26
26
|
|
|
27
27
|
# Configures onboarding steps via a ListBuilder with a provided block.
|
|
@@ -29,8 +29,8 @@ module Onboardable
|
|
|
29
29
|
# @param options [Hash] Optional configuration options for the ListBuilder.
|
|
30
30
|
# @option options [Proc] :progress_calculation A custom calculation for progress percentage.
|
|
31
31
|
# Receives step_index and steps_size as arguments and returns a Float.
|
|
32
|
-
# @yield [List::Builder] Executes block in the context of List::Builder.
|
|
33
|
-
# @return [Step] The current step in the building process.
|
|
32
|
+
# @yield [Onboardable::List::Builder] Executes block in the context of List::Builder.
|
|
33
|
+
# @return [Onboardable::Step] The current step in the building process.
|
|
34
34
|
def onboarding=(options = {}, &)
|
|
35
35
|
self.list_builder = List::Builder.new(options)
|
|
36
36
|
list_builder.instance_eval(&)
|
|
@@ -40,7 +40,7 @@ module Onboardable
|
|
|
40
40
|
# Builds the onboarding list and optionally sets the current step.
|
|
41
41
|
#
|
|
42
42
|
# @param current_step_name [String, nil] The name of the current step, if specified.
|
|
43
|
-
# @return [List::Base] The List built from the class's ListBuilder.
|
|
43
|
+
# @return [Onboardable::List::Base] The List built from the class's ListBuilder.
|
|
44
44
|
def onboarding(current_step_name = nil)
|
|
45
45
|
list_builder.build(current_step_name)
|
|
46
46
|
end
|
|
@@ -51,7 +51,7 @@ module Onboardable
|
|
|
51
51
|
# Builds the onboarding list and optionally sets the current step.
|
|
52
52
|
#
|
|
53
53
|
# @param current_step_name [String, nil] The name of the current step, if specified.
|
|
54
|
-
# @return [List::Base] The List built from the class's ListBuilder.
|
|
54
|
+
# @return [Onboardable::List::Base] The List built from the class's ListBuilder.
|
|
55
55
|
def onboarding(current_step_name = nil)
|
|
56
56
|
self.class.onboarding(current_step_name)
|
|
57
57
|
end
|
|
@@ -3,7 +3,7 @@ module Onboardable
|
|
|
3
3
|
class Base
|
|
4
4
|
include Navigation
|
|
5
5
|
|
|
6
|
-
PROGRESS_CALCULATION:
|
|
6
|
+
PROGRESS_CALCULATION: ^(Integer, Integer) -> Float
|
|
7
7
|
|
|
8
8
|
attr_reader steps: Array[Step]
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ module Onboardable
|
|
|
11
11
|
|
|
12
12
|
def initialize: (Array[Step] steps, Step current_step, ?Hash[Symbol, untyped] options) -> untyped
|
|
13
13
|
|
|
14
|
-
def progress: (?
|
|
14
|
+
def progress: (?(^(Integer, Integer) -> Numeric)? progress_calculation) -> Float
|
|
15
15
|
|
|
16
16
|
private
|
|
17
17
|
|
|
@@ -27,7 +27,7 @@ module Onboardable
|
|
|
27
27
|
|
|
28
28
|
def update_each_step_status: (Integer current_step_index) -> Array[Step]
|
|
29
29
|
|
|
30
|
-
def step_error!: (Step step) ->
|
|
30
|
+
def step_error!: (Step step) -> bot
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -5,7 +5,7 @@ module Onboardable
|
|
|
5
5
|
|
|
6
6
|
STEP_KEY: Symbol
|
|
7
7
|
|
|
8
|
-
def steps: () -> Hash[String,
|
|
8
|
+
def steps: () -> Hash[String, Step]
|
|
9
9
|
|
|
10
10
|
attr_accessor current_step: Step
|
|
11
11
|
|
|
@@ -31,7 +31,7 @@ module Onboardable
|
|
|
31
31
|
|
|
32
32
|
def convert_to_step!: (String name) -> Step
|
|
33
33
|
|
|
34
|
-
def undefined_method_error!: (Class klass) ->
|
|
34
|
+
def undefined_method_error!: (Class klass) -> bot
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
module Onboardable
|
|
2
2
|
module List
|
|
3
3
|
module Navigation
|
|
4
|
+
def steps: () -> Array[Step]
|
|
5
|
+
|
|
6
|
+
def current_step: () -> Step
|
|
7
|
+
|
|
4
8
|
def next_step: () -> (Step | nil)
|
|
5
9
|
|
|
6
10
|
def next_step?: (Step step) -> bool
|
|
@@ -25,9 +29,13 @@ module Onboardable
|
|
|
25
29
|
|
|
26
30
|
private
|
|
27
31
|
|
|
28
|
-
def
|
|
32
|
+
def current_step=: (Step current_step) -> Step
|
|
33
|
+
|
|
34
|
+
def step_index: (Step step) -> Integer
|
|
35
|
+
|
|
36
|
+
def first_step_error!: () -> bot
|
|
29
37
|
|
|
30
|
-
def last_step_error!: () ->
|
|
38
|
+
def last_step_error!: () -> bot
|
|
31
39
|
end
|
|
32
40
|
end
|
|
33
41
|
end
|
data/sig/onboardable/step.rbs
CHANGED
|
@@ -14,11 +14,7 @@ module Onboardable
|
|
|
14
14
|
|
|
15
15
|
def self.try_convert: (Class klass) -> (Step | nil)
|
|
16
16
|
|
|
17
|
-
private
|
|
18
|
-
|
|
19
|
-
def self.conversion_error!: (Class klass, Step step) -> void
|
|
20
|
-
|
|
21
|
-
public
|
|
17
|
+
private def self.conversion_error!: (Class klass, untyped step) -> bot
|
|
22
18
|
|
|
23
19
|
attr_reader name: String
|
|
24
20
|
|
|
@@ -34,7 +30,7 @@ module Onboardable
|
|
|
34
30
|
|
|
35
31
|
def completed?: () -> bool
|
|
36
32
|
|
|
37
|
-
def ==: (
|
|
33
|
+
def ==: (untyped other) -> bool
|
|
38
34
|
|
|
39
35
|
def to_str: () -> String
|
|
40
36
|
|
|
@@ -48,6 +44,6 @@ module Onboardable
|
|
|
48
44
|
|
|
49
45
|
attr_writer data: Hash[Symbol, untyped]
|
|
50
46
|
|
|
51
|
-
def comparison_result_error!: (Integer comparison_result) ->
|
|
47
|
+
def comparison_result_error!: (Integer comparison_result) -> bot
|
|
52
48
|
end
|
|
53
49
|
end
|
data/sig/onboardable.rbs
CHANGED
|
@@ -6,14 +6,18 @@ module Onboardable
|
|
|
6
6
|
module ClassMethods
|
|
7
7
|
attr_accessor list_builder: List::Builder
|
|
8
8
|
|
|
9
|
-
def onboarding=: (?Hash[Symbol, untyped] options) { ()
|
|
9
|
+
def onboarding=: (?Hash[Symbol, untyped] options) { (List::Builder) [self: List::Builder] -> untyped } -> untyped
|
|
10
10
|
|
|
11
11
|
alias has_onboarding onboarding=
|
|
12
12
|
|
|
13
13
|
def onboarding: (?String? current_step_name) -> List::Base
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
interface _OnboardableClass
|
|
17
|
+
def class: () -> ClassMethods
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
module InstanceMethods : _OnboardableClass
|
|
17
21
|
def onboarding: (?String? current_step_name) -> List::Base
|
|
18
22
|
end
|
|
19
23
|
end
|
metadata
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: onboardable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Artem Skrynnyk
|
|
8
|
-
bindir:
|
|
8
|
+
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
@@ -15,20 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '13.
|
|
19
|
-
- - ">="
|
|
20
|
-
- !ruby/object:Gem::Version
|
|
21
|
-
version: 13.2.1
|
|
18
|
+
version: '13.4'
|
|
22
19
|
type: :development
|
|
23
20
|
prerelease: false
|
|
24
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
22
|
requirements:
|
|
26
23
|
- - "~>"
|
|
27
24
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: '13.
|
|
29
|
-
- - ">="
|
|
30
|
-
- !ruby/object:Gem::Version
|
|
31
|
-
version: 13.2.1
|
|
25
|
+
version: '13.4'
|
|
32
26
|
- !ruby/object:Gem::Dependency
|
|
33
27
|
name: rspec
|
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -49,108 +43,98 @@ dependencies:
|
|
|
49
43
|
requirements:
|
|
50
44
|
- - "~>"
|
|
51
45
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: '1.
|
|
53
|
-
- - ">="
|
|
54
|
-
- !ruby/object:Gem::Version
|
|
55
|
-
version: 1.65.1
|
|
46
|
+
version: '1.91'
|
|
56
47
|
type: :development
|
|
57
48
|
prerelease: false
|
|
58
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
59
50
|
requirements:
|
|
60
51
|
- - "~>"
|
|
61
52
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '1.
|
|
63
|
-
- - ">="
|
|
64
|
-
- !ruby/object:Gem::Version
|
|
65
|
-
version: 1.65.1
|
|
53
|
+
version: '1.91'
|
|
66
54
|
- !ruby/object:Gem::Dependency
|
|
67
55
|
name: rubocop-performance
|
|
68
56
|
requirement: !ruby/object:Gem::Requirement
|
|
69
57
|
requirements:
|
|
70
58
|
- - "~>"
|
|
71
59
|
- !ruby/object:Gem::Version
|
|
72
|
-
version: '1.
|
|
73
|
-
- - ">="
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: 1.21.1
|
|
60
|
+
version: '1.27'
|
|
76
61
|
type: :development
|
|
77
62
|
prerelease: false
|
|
78
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
64
|
requirements:
|
|
80
65
|
- - "~>"
|
|
81
66
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '1.
|
|
83
|
-
- - ">="
|
|
84
|
-
- !ruby/object:Gem::Version
|
|
85
|
-
version: 1.21.1
|
|
67
|
+
version: '1.27'
|
|
86
68
|
- !ruby/object:Gem::Dependency
|
|
87
69
|
name: rubocop-rake
|
|
88
70
|
requirement: !ruby/object:Gem::Requirement
|
|
89
71
|
requirements:
|
|
90
72
|
- - "~>"
|
|
91
73
|
- !ruby/object:Gem::Version
|
|
92
|
-
version: 0.7
|
|
74
|
+
version: '0.7'
|
|
93
75
|
type: :development
|
|
94
76
|
prerelease: false
|
|
95
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
96
78
|
requirements:
|
|
97
79
|
- - "~>"
|
|
98
80
|
- !ruby/object:Gem::Version
|
|
99
|
-
version: 0.7
|
|
81
|
+
version: '0.7'
|
|
100
82
|
- !ruby/object:Gem::Dependency
|
|
101
83
|
name: rubocop-rspec
|
|
102
84
|
requirement: !ruby/object:Gem::Requirement
|
|
103
85
|
requirements:
|
|
104
86
|
- - "~>"
|
|
105
87
|
- !ruby/object:Gem::Version
|
|
106
|
-
version: '3.
|
|
107
|
-
- - ">="
|
|
108
|
-
- !ruby/object:Gem::Version
|
|
109
|
-
version: 3.0.4
|
|
88
|
+
version: '3.10'
|
|
110
89
|
type: :development
|
|
111
90
|
prerelease: false
|
|
112
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
113
92
|
requirements:
|
|
114
93
|
- - "~>"
|
|
115
94
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: '3.
|
|
117
|
-
- - ">="
|
|
118
|
-
- !ruby/object:Gem::Version
|
|
119
|
-
version: 3.0.4
|
|
95
|
+
version: '3.10'
|
|
120
96
|
- !ruby/object:Gem::Dependency
|
|
121
97
|
name: simplecov
|
|
122
98
|
requirement: !ruby/object:Gem::Requirement
|
|
123
99
|
requirements:
|
|
124
100
|
- - "~>"
|
|
125
101
|
- !ruby/object:Gem::Version
|
|
126
|
-
version:
|
|
102
|
+
version: '1.3'
|
|
127
103
|
type: :development
|
|
128
104
|
prerelease: false
|
|
129
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
130
106
|
requirements:
|
|
131
107
|
- - "~>"
|
|
132
108
|
- !ruby/object:Gem::Version
|
|
133
|
-
version:
|
|
109
|
+
version: '1.3'
|
|
134
110
|
- !ruby/object:Gem::Dependency
|
|
135
|
-
name:
|
|
111
|
+
name: steep
|
|
136
112
|
requirement: !ruby/object:Gem::Requirement
|
|
137
113
|
requirements:
|
|
138
114
|
- - "~>"
|
|
139
115
|
- !ruby/object:Gem::Version
|
|
140
|
-
version: '1
|
|
141
|
-
- - ">="
|
|
142
|
-
- !ruby/object:Gem::Version
|
|
143
|
-
version: 1.2.3
|
|
116
|
+
version: '2.1'
|
|
144
117
|
type: :development
|
|
145
118
|
prerelease: false
|
|
146
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
147
120
|
requirements:
|
|
148
121
|
- - "~>"
|
|
149
122
|
- !ruby/object:Gem::Version
|
|
150
|
-
version: '1
|
|
151
|
-
|
|
123
|
+
version: '2.1'
|
|
124
|
+
- !ruby/object:Gem::Dependency
|
|
125
|
+
name: yard-lint
|
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - "~>"
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '1.12'
|
|
131
|
+
type: :development
|
|
132
|
+
prerelease: false
|
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - "~>"
|
|
152
136
|
- !ruby/object:Gem::Version
|
|
153
|
-
version: 1.
|
|
137
|
+
version: '1.12'
|
|
154
138
|
description: Provides tools for easy setup of custom onboarding to boost engagement.
|
|
155
139
|
email:
|
|
156
140
|
- skrynnyk.artem@coaxsoft.com
|
|
@@ -159,12 +143,8 @@ extensions: []
|
|
|
159
143
|
extra_rdoc_files: []
|
|
160
144
|
files:
|
|
161
145
|
- CHANGELOG.md
|
|
162
|
-
- CODE_OF_CONDUCT.md
|
|
163
|
-
- Gemfile
|
|
164
|
-
- Gemfile.lock
|
|
165
146
|
- LICENSE.txt
|
|
166
147
|
- README.md
|
|
167
|
-
- Rakefile
|
|
168
148
|
- lib/onboardable.rb
|
|
169
149
|
- lib/onboardable/errors.rb
|
|
170
150
|
- lib/onboardable/list/base.rb
|
|
@@ -173,7 +153,6 @@ files:
|
|
|
173
153
|
- lib/onboardable/step.rb
|
|
174
154
|
- lib/onboardable/utils/warnings.rb
|
|
175
155
|
- lib/onboardable/version.rb
|
|
176
|
-
- onboardable.gemspec
|
|
177
156
|
- sig/onboardable.rbs
|
|
178
157
|
- sig/onboardable/errors.rbs
|
|
179
158
|
- sig/onboardable/list/base.rbs
|
|
@@ -186,6 +165,7 @@ licenses:
|
|
|
186
165
|
- MIT
|
|
187
166
|
metadata:
|
|
188
167
|
homepage_uri: https://github.com/dmrAnderson/onboardable
|
|
168
|
+
source_code_uri: https://github.com/dmrAnderson/onboardable
|
|
189
169
|
changelog_uri: https://github.com/dmrAnderson/onboardable/blob/main/CHANGELOG.md
|
|
190
170
|
bug_tracker_uri: https://github.com/dmrAnderson/onboardable/issues
|
|
191
171
|
documentation_uri: https://rubydoc.info/gems/onboardable
|
|
@@ -197,14 +177,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
197
177
|
requirements:
|
|
198
178
|
- - ">="
|
|
199
179
|
- !ruby/object:Gem::Version
|
|
200
|
-
version: 3.
|
|
180
|
+
version: 3.3.0
|
|
201
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
182
|
requirements:
|
|
203
183
|
- - ">="
|
|
204
184
|
- !ruby/object:Gem::Version
|
|
205
185
|
version: '0'
|
|
206
186
|
requirements: []
|
|
207
|
-
rubygems_version: 4.0.
|
|
187
|
+
rubygems_version: 4.0.20
|
|
208
188
|
specification_version: 4
|
|
209
189
|
summary: Streamlines onboarding process integration
|
|
210
190
|
test_files: []
|
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to participate in our
|
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
10
|
-
|
|
11
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
12
|
-
diverse, inclusive, and healthy community.
|
|
13
|
-
|
|
14
|
-
## Our Standards
|
|
15
|
-
|
|
16
|
-
Examples of behavior that contributes to a positive environment for
|
|
17
|
-
our community includes:
|
|
18
|
-
|
|
19
|
-
* Demonstrating empathy and kindness toward other people
|
|
20
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
21
|
-
* Giving and gracefully accepting constructive feedback
|
|
22
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
23
|
-
and learning from the experience
|
|
24
|
-
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
25
|
-
|
|
26
|
-
Examples of unacceptable behavior include:
|
|
27
|
-
|
|
28
|
-
* The use of sexualized language or imagery, and sexual attention or
|
|
29
|
-
advances of any kind
|
|
30
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
31
|
-
* Public or private harassment
|
|
32
|
-
* Publishing others' private information, such as a physical or email
|
|
33
|
-
address, without their explicit permission
|
|
34
|
-
* Other conduct that could reasonably be considered inappropriate in a
|
|
35
|
-
professional setting
|
|
36
|
-
|
|
37
|
-
## Enforcement Responsibilities
|
|
38
|
-
|
|
39
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
|
40
|
-
acceptable behavior and will take appropriate and fair corrective action in response
|
|
41
|
-
to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
42
|
-
|
|
43
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
|
44
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
45
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
46
|
-
decisions when appropriate.
|
|
47
|
-
|
|
48
|
-
## Scope
|
|
49
|
-
|
|
50
|
-
This Code of Conduct applies within all community spaces and also applies when an
|
|
51
|
-
individual is officially representing the community in public spaces. Examples of
|
|
52
|
-
representing our community includes using an official e-mail address, posting via
|
|
53
|
-
an official social media account, or acting as an appointed representative at an
|
|
54
|
-
online or offline event.
|
|
55
|
-
|
|
56
|
-
## Enforcement
|
|
57
|
-
|
|
58
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported
|
|
59
|
-
to the community leaders responsible for enforcement at skrynnyk.artem@coaxsoft.com.
|
|
60
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
|
61
|
-
|
|
62
|
-
All community leaders are obligated to respect the privacy and
|
|
63
|
-
security of the reporter of any incident.
|
|
64
|
-
|
|
65
|
-
## Enforcement Guidelines
|
|
66
|
-
|
|
67
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
|
68
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
|
69
|
-
|
|
70
|
-
### 1. Correction
|
|
71
|
-
|
|
72
|
-
**Community Impact**: Use of inappropriate language or other behavior
|
|
73
|
-
deemed unprofessional or unwelcome in the community.
|
|
74
|
-
|
|
75
|
-
**Consequence**: A private, written warning from community leaders,
|
|
76
|
-
providing clarity around the nature of the violation and an explanation
|
|
77
|
-
of why the behavior was inappropriate. A public apology may be requested.
|
|
78
|
-
|
|
79
|
-
### 2. Warning
|
|
80
|
-
|
|
81
|
-
**Community Impact**: A violation through a single incident or series of actions.
|
|
82
|
-
|
|
83
|
-
**Consequence**: A warning with consequences for continued behavior.
|
|
84
|
-
No interaction with the people involved, including unsolicited interaction
|
|
85
|
-
with those enforcing the Code of Conduct, for a specified period of time.
|
|
86
|
-
This includes avoiding interactions in community spaces as well as external
|
|
87
|
-
channels like social media. Violating these terms may lead to a temporary or
|
|
88
|
-
permanent ban.
|
|
89
|
-
|
|
90
|
-
### 3. Temporary Ban
|
|
91
|
-
|
|
92
|
-
**Community Impact**: A serious violation of community standards,
|
|
93
|
-
including sustained inappropriate behavior.
|
|
94
|
-
|
|
95
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
96
|
-
communication with the community for a specified period of time.
|
|
97
|
-
No public or private interaction with the people involved, including
|
|
98
|
-
unsolicited interaction with those enforcing the Code of Conduct, is
|
|
99
|
-
allowed during this period. Violating these terms may lead to a permanent ban.
|
|
100
|
-
|
|
101
|
-
### 4. Permanent Ban
|
|
102
|
-
|
|
103
|
-
**Community Impact**: Demonstrating a pattern of violation of community standards,
|
|
104
|
-
including sustained inappropriate behavior, harassment of an individual, or
|
|
105
|
-
aggression toward or disparagement of classes of individuals.
|
|
106
|
-
|
|
107
|
-
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
108
|
-
|
|
109
|
-
## Attribution
|
|
110
|
-
|
|
111
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
112
|
-
version 2.0, available at <https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
|
|
113
|
-
|
|
114
|
-
Community Impact Guidelines were inspired
|
|
115
|
-
by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
|
116
|
-
|
|
117
|
-
[homepage]: https://www.contributor-covenant.org
|
|
118
|
-
|
|
119
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
120
|
-
<https://www.contributor-covenant.org/faq>. Translations are available at <https://www.contributor-covenant.org/translations>.
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
onboardable (1.6.0)
|
|
5
|
-
|
|
6
|
-
GEM
|
|
7
|
-
remote: https://rubygems.org/
|
|
8
|
-
specs:
|
|
9
|
-
ast (2.4.3)
|
|
10
|
-
diff-lcs (1.6.2)
|
|
11
|
-
docile (1.4.1)
|
|
12
|
-
json (2.18.0)
|
|
13
|
-
language_server-protocol (3.17.0.5)
|
|
14
|
-
lint_roller (1.1.0)
|
|
15
|
-
parallel (1.27.0)
|
|
16
|
-
parser (3.3.10.0)
|
|
17
|
-
ast (~> 2.4.1)
|
|
18
|
-
racc
|
|
19
|
-
prism (1.7.0)
|
|
20
|
-
racc (1.8.1)
|
|
21
|
-
rainbow (3.1.1)
|
|
22
|
-
rake (13.3.1)
|
|
23
|
-
regexp_parser (2.11.3)
|
|
24
|
-
rspec (3.13.2)
|
|
25
|
-
rspec-core (~> 3.13.0)
|
|
26
|
-
rspec-expectations (~> 3.13.0)
|
|
27
|
-
rspec-mocks (~> 3.13.0)
|
|
28
|
-
rspec-core (3.13.6)
|
|
29
|
-
rspec-support (~> 3.13.0)
|
|
30
|
-
rspec-expectations (3.13.5)
|
|
31
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
32
|
-
rspec-support (~> 3.13.0)
|
|
33
|
-
rspec-mocks (3.13.6)
|
|
34
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
35
|
-
rspec-support (~> 3.13.0)
|
|
36
|
-
rspec-support (3.13.6)
|
|
37
|
-
rubocop (1.82.1)
|
|
38
|
-
json (~> 2.3)
|
|
39
|
-
language_server-protocol (~> 3.17.0.2)
|
|
40
|
-
lint_roller (~> 1.1.0)
|
|
41
|
-
parallel (~> 1.10)
|
|
42
|
-
parser (>= 3.3.0.2)
|
|
43
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
44
|
-
regexp_parser (>= 2.9.3, < 3.0)
|
|
45
|
-
rubocop-ast (>= 1.48.0, < 2.0)
|
|
46
|
-
ruby-progressbar (~> 1.7)
|
|
47
|
-
unicode-display_width (>= 2.4.0, < 4.0)
|
|
48
|
-
rubocop-ast (1.48.0)
|
|
49
|
-
parser (>= 3.3.7.2)
|
|
50
|
-
prism (~> 1.4)
|
|
51
|
-
rubocop-performance (1.26.1)
|
|
52
|
-
lint_roller (~> 1.1)
|
|
53
|
-
rubocop (>= 1.75.0, < 2.0)
|
|
54
|
-
rubocop-ast (>= 1.47.1, < 2.0)
|
|
55
|
-
rubocop-rake (0.7.1)
|
|
56
|
-
lint_roller (~> 1.1)
|
|
57
|
-
rubocop (>= 1.72.1)
|
|
58
|
-
rubocop-rspec (3.8.0)
|
|
59
|
-
lint_roller (~> 1.1)
|
|
60
|
-
rubocop (~> 1.81)
|
|
61
|
-
ruby-progressbar (1.13.0)
|
|
62
|
-
simplecov (0.22.0)
|
|
63
|
-
docile (~> 1.1)
|
|
64
|
-
simplecov-html (~> 0.11)
|
|
65
|
-
simplecov_json_formatter (~> 0.1)
|
|
66
|
-
simplecov-html (0.13.1)
|
|
67
|
-
simplecov_json_formatter (0.1.4)
|
|
68
|
-
unicode-display_width (3.2.0)
|
|
69
|
-
unicode-emoji (~> 4.1)
|
|
70
|
-
unicode-emoji (4.2.0)
|
|
71
|
-
yard (0.9.38)
|
|
72
|
-
yard-lint (1.3.0)
|
|
73
|
-
yard (~> 0.9)
|
|
74
|
-
zeitwerk (~> 2.6)
|
|
75
|
-
zeitwerk (2.7.4)
|
|
76
|
-
|
|
77
|
-
PLATFORMS
|
|
78
|
-
x86_64-darwin-25
|
|
79
|
-
x86_64-linux
|
|
80
|
-
|
|
81
|
-
DEPENDENCIES
|
|
82
|
-
onboardable!
|
|
83
|
-
rake (~> 13.2, >= 13.2.1)
|
|
84
|
-
rspec (~> 3.13)
|
|
85
|
-
rubocop (~> 1.65, >= 1.65.1)
|
|
86
|
-
rubocop-performance (~> 1.21, >= 1.21.1)
|
|
87
|
-
rubocop-rake (~> 0.7.1)
|
|
88
|
-
rubocop-rspec (~> 3.0, >= 3.0.4)
|
|
89
|
-
simplecov (~> 0.22.0)
|
|
90
|
-
yard-lint (~> 1.2, >= 1.2.3)
|
|
91
|
-
|
|
92
|
-
BUNDLED WITH
|
|
93
|
-
4.0.3
|
data/Rakefile
DELETED
data/onboardable.gemspec
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative 'lib/onboardable/version'
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = 'onboardable'
|
|
7
|
-
spec.version = Onboardable::VERSION
|
|
8
|
-
spec.authors = ['Artem Skrynnyk']
|
|
9
|
-
spec.email = ['skrynnyk.artem@coaxsoft.com']
|
|
10
|
-
|
|
11
|
-
spec.summary = 'Streamlines onboarding process integration'
|
|
12
|
-
spec.description = 'Provides tools for easy setup of custom onboarding to boost engagement.'
|
|
13
|
-
spec.homepage = 'https://github.com/dmrAnderson/onboardable'
|
|
14
|
-
spec.license = 'MIT'
|
|
15
|
-
spec.required_ruby_version = '>= 3.2.0'
|
|
16
|
-
|
|
17
|
-
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
|
18
|
-
|
|
19
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
|
20
|
-
# spec.metadata['source_code_uri'] = "TODO: Put your gem's public repo URL here."
|
|
21
|
-
spec.metadata['changelog_uri'] = 'https://github.com/dmrAnderson/onboardable/blob/main/CHANGELOG.md'
|
|
22
|
-
spec.metadata['bug_tracker_uri'] = 'https://github.com/dmrAnderson/onboardable/issues'
|
|
23
|
-
spec.metadata['documentation_uri'] = 'https://rubydoc.info/gems/onboardable'
|
|
24
|
-
|
|
25
|
-
# Specify which files should be added to the gem when it is released.
|
|
26
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
27
|
-
spec.files = Dir.chdir(__dir__) do
|
|
28
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
|
29
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:bin|spec)/|\.(?:git|rspec|rubocop|yard))})
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
spec.bindir = 'exe'
|
|
34
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
35
|
-
spec.require_paths = ['lib']
|
|
36
|
-
|
|
37
|
-
# Uncomment to register a new dependency of your gem
|
|
38
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
|
39
|
-
|
|
40
|
-
# For more information and examples about making a new gem, check out our
|
|
41
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
|
42
|
-
spec.add_development_dependency 'rake', '~> 13.2', '>= 13.2.1'
|
|
43
|
-
spec.add_development_dependency 'rspec', '~> 3.13'
|
|
44
|
-
spec.add_development_dependency 'rubocop', '~> 1.65', '~> 1.65', '>= 1.65.1'
|
|
45
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.21', '>= 1.21.1'
|
|
46
|
-
spec.add_development_dependency 'rubocop-rake', '~> 0.7.1'
|
|
47
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 3.0', '>= 3.0.4'
|
|
48
|
-
spec.add_development_dependency 'simplecov', '~> 0.22.0'
|
|
49
|
-
spec.add_development_dependency 'yard-lint', '~> 1.2', '>= 1.2.3'
|
|
50
|
-
|
|
51
|
-
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
52
|
-
end
|