onboardable 1.0.0 → 1.0.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 +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +41 -3
- data/lib/onboardable/list.rb +4 -0
- data/lib/onboardable/utils/navigation.rb +10 -2
- data/lib/onboardable/version.rb +1 -1
- data/sig/onboardable/list.rbs +2 -0
- data/sig/onboardable/utils/navigation.rbs +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cc331c83492d5c21563a91644b3f2441b38d561ebde4d0690ba68813fadeb60
|
4
|
+
data.tar.gz: 1e55f9c4913a17385c6e2ebe4c7d1dd58921a35b72d786171aa8a28efae09306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0456826a6d0b6bea084f95191240ea28776be3b4d8106a2f8055b259d24524055248143e01050be87e6c512084e9ddf7c576c594327ae9b617eb1db5e7068973'
|
7
|
+
data.tar.gz: 2e35337681b26a2c09fa7ba1e7e8b5c505747a5c0144f3116214241c06aca3b04d76b72ce439d14ca717090caa01e95f7f219543784dcdbc07b354b66984686f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## [Unreleased]
|
4
|
+
|
5
|
+
- Added `first_step` and `last_step` methods to easily access
|
6
|
+
the boundaries of step lists.
|
7
|
+
- Added `progress` method for calculating onboarding completion percentage.
|
8
|
+
|
3
9
|
## [1.0.0] - 2024-05-08
|
4
10
|
|
5
11
|
- Enhanced `first_step?` and `last_step?` methods to accept an optional argument,
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -78,14 +78,15 @@ that allow step navigation and state verification:
|
|
78
78
|
This sets up the initial step based on the defined onboarding flow.
|
79
79
|
|
80
80
|
```ruby
|
81
|
-
User.new.onboarding
|
81
|
+
onboarding = User.new.onboarding
|
82
82
|
# Initializes the onboarding process for a new user instance
|
83
83
|
```
|
84
84
|
|
85
85
|
1. **Navigating Through Steps**
|
86
86
|
|
87
87
|
Navigate through the onboarding steps using the navigation methods provided.
|
88
|
-
These methods help in moving forward and backward through the onboarding process
|
88
|
+
These methods help in moving forward and backward through the onboarding process.
|
89
|
+
|
89
90
|
- **Next Step**
|
90
91
|
|
91
92
|
Access the next step without changing the current step to preview
|
@@ -125,6 +126,16 @@ that allow step navigation and state verification:
|
|
125
126
|
# Returns true if the current step is the last
|
126
127
|
```
|
127
128
|
|
129
|
+
1. **Monitor Progress**
|
130
|
+
|
131
|
+
Calculate the progress or completion percentage of the onboarding process
|
132
|
+
to provide users with an indication of how far they have progressed.
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
onboarding.progress
|
136
|
+
# Returns the percentage of onboarding completion
|
137
|
+
```
|
138
|
+
|
128
139
|
1. **Access Current Step Details**
|
129
140
|
|
130
141
|
Retrieve details about the current step, which can include the name,
|
@@ -152,8 +163,35 @@ that allow step navigation and state verification:
|
|
152
163
|
indicate completion or triggering other application logic.
|
153
164
|
|
154
165
|
```ruby
|
166
|
+
# Direct Check Approach
|
155
167
|
if onboarding.last_step?
|
156
|
-
#
|
168
|
+
# Implement finalization processes like updating user attributes
|
169
|
+
end
|
170
|
+
|
171
|
+
# Exception Handling Approach
|
172
|
+
begin
|
173
|
+
onboarding.next_step!
|
174
|
+
rescue LastStepError
|
175
|
+
# Implement finalization processes like updating user attributes
|
176
|
+
end
|
177
|
+
```
|
178
|
+
|
179
|
+
1. **Exit the Onboarding Process Early**
|
180
|
+
|
181
|
+
Handle cases where a user decides to discontinue the onboarding
|
182
|
+
by attempting to navigate back from the initial step.
|
183
|
+
|
184
|
+
```ruby
|
185
|
+
# Direct Check Approach
|
186
|
+
if onboarding.first_step?
|
187
|
+
# Implement cleanup or final actions for an orderly exit
|
188
|
+
end
|
189
|
+
|
190
|
+
# Exception Handling Approach
|
191
|
+
begin
|
192
|
+
onboarding.prev_step!
|
193
|
+
rescue FirstStepError
|
194
|
+
# Implement cleanup or final actions for an orderly exit
|
157
195
|
end
|
158
196
|
```
|
159
197
|
|
data/lib/onboardable/list.rb
CHANGED
@@ -24,11 +24,19 @@ module Onboardable
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def first_step?(step = current_step)
|
27
|
-
step ==
|
27
|
+
step == first_step
|
28
28
|
end
|
29
29
|
|
30
30
|
def last_step?(step = current_step)
|
31
|
-
step ==
|
31
|
+
step == last_step
|
32
|
+
end
|
33
|
+
|
34
|
+
def first_step
|
35
|
+
steps.fetch(0)
|
36
|
+
end
|
37
|
+
|
38
|
+
def last_step
|
39
|
+
steps.fetch(-1)
|
32
40
|
end
|
33
41
|
end
|
34
42
|
end
|
data/lib/onboardable/version.rb
CHANGED
data/sig/onboardable/list.rbs
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onboardable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Skrynnyk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -158,6 +158,7 @@ homepage: https://github.com/dmrAnderson/onboardable
|
|
158
158
|
licenses:
|
159
159
|
- MIT
|
160
160
|
metadata:
|
161
|
+
homepage_uri: https://github.com/dmrAnderson/onboardable
|
161
162
|
changelog_uri: https://github.com/dmrAnderson/onboardable/blob/main/CHANGELOG.md
|
162
163
|
bug_tracker_uri: https://github.com/dmrAnderson/onboardable/issues
|
163
164
|
documentation_uri: https://github.com/dmrAnderson/onboardable/blob/main/README.md
|