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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dbcdfe0c23335596eaad240b45fdb1451cab1be2569e511d21ddaf58ea986128
4
- data.tar.gz: ce09536239ef6d06c8e42a120d0fd6661f3e42b72a4e9bea6dc998be12024956
3
+ metadata.gz: 6c96927dad3be1d7e793e3edd5d3df3e3a12999fcec57ad01d3d773d9b40e674
4
+ data.tar.gz: 4aa47ce704540fa933dbdf30d3afddbb3704bd541b4dab1f7a751e0e461f3c1e
5
5
  SHA512:
6
- metadata.gz: 1a603d11d09c89ba70e4577db65e0feb31246406dadb0b118717a51b1b4831d54dde782e90511a4d2e44733dd255c501296c97639b446d8f458903d391e3aa0a
7
- data.tar.gz: bf48bf56a2e28ccde3ec5673ca9d54e5994ca4b7b71b35714177b2fcb8fbe07bf64521e5f4e9d8d1faf0ca4ec86f8ed98c5f879d532245e8978c200b319fee71
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 toe establish the configuration for the class.
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(for_what)
215
+ @search_proc.call(search_term)
213
216
  else
214
- search_prompts(for_what)
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PromptManager
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
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.0
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-22 00:00:00.000000000 Z
11
+ date: 2023-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print