prompt_manager 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/prompt_manager/storage/file_system_adapter.rb +8 -5
- data/lib/prompt_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c96927dad3be1d7e793e3edd5d3df3e3a12999fcec57ad01d3d773d9b40e674
|
4
|
+
data.tar.gz: 4aa47ce704540fa933dbdf30d3afddbb3704bd541b4dab1f7a751e0e461f3c1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0857d6d0532c0c1293799e760933e5bf2ee1a82f8cfdce6dd649b187f724e31935bf959b04c8058a90877525751cf99deaa4fd51a9cc64d0259a3d4b1e40de38'
|
7
|
+
data.tar.gz: 59d2e1cabed3a87766092f56eae6ed7e7d30a2c0d0b3e3dc2efd93fe9ce79d97ce7ee5af3d1beae6896aed3a1754649dc7a7f3bbdec1e0566015640d8f7f2128
|
data/README.md
CHANGED
@@ -73,7 +73,7 @@ The parameters for the `todo` prompt ID are saved in the same directory as `todo
|
|
73
73
|
|
74
74
|
##### Configuration
|
75
75
|
|
76
|
-
Use a `config` block
|
76
|
+
Use a `config` block to establish the configuration for the class.
|
77
77
|
|
78
78
|
```ruby
|
79
79
|
PromptManager::Storage::FileSystemAdapter.config do |o|
|
@@ -151,6 +151,7 @@ class PromptManager::Storage::FileSystemAdapter
|
|
151
151
|
|
152
152
|
def get(id:)
|
153
153
|
validate_id(id)
|
154
|
+
verify_id(id)
|
154
155
|
|
155
156
|
{
|
156
157
|
id: id,
|
@@ -208,10 +209,12 @@ class PromptManager::Storage::FileSystemAdapter
|
|
208
209
|
|
209
210
|
|
210
211
|
def search(for_what)
|
212
|
+
search_term = for_what.downcase
|
213
|
+
|
211
214
|
if @search_proc
|
212
|
-
@search_proc.call(
|
215
|
+
@search_proc.call(search_term)
|
213
216
|
else
|
214
|
-
search_prompts(
|
217
|
+
search_prompts(search_term)
|
215
218
|
end
|
216
219
|
end
|
217
220
|
|
@@ -245,9 +248,10 @@ class PromptManager::Storage::FileSystemAdapter
|
|
245
248
|
end
|
246
249
|
|
247
250
|
|
248
|
-
# Verify that the ID actually exists
|
249
251
|
def verify_id(id)
|
250
|
-
file_path(id, prompt_extension).exist?
|
252
|
+
unless file_path(id, prompt_extension).exist?
|
253
|
+
raise ArgumentError, "Invalid prompt_id: #{id}"
|
254
|
+
end
|
251
255
|
end
|
252
256
|
|
253
257
|
|
@@ -292,7 +296,6 @@ class PromptManager::Storage::FileSystemAdapter
|
|
292
296
|
end
|
293
297
|
|
294
298
|
prompt_ids
|
295
|
-
|
296
299
|
end
|
297
300
|
|
298
301
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prompt_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dewayne VanHoozer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|