prompt-lists 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/prompt_lists.rb +23 -19
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12cf020db05a18abd78762cda6066f4b99220d20bfb0fe43c82f684523191436
|
4
|
+
data.tar.gz: 1bc63760c24188c261532c6a8f75a30a5d8d17a3918795a9b2b5d8bb82945f7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bf0c5c275c75c4b05cc452fa7609084ec030d312fd839a7713d6c623370ca78f4016e72c13c8734f4b6241328f546960baaedcb593ba11c1686e8287c420060
|
7
|
+
data.tar.gz: 45aaa46345e2c5214cce932450856eafb08f408b73f26e8313847bce6a0cd9c5998029166f695dd868833bc7c295a38321e93d32ac2f4415d01dee30dcc81331
|
data/README.md
CHANGED
data/lib/prompt_lists.rb
CHANGED
@@ -3,27 +3,26 @@
|
|
3
3
|
require 'yaml'
|
4
4
|
|
5
5
|
module PromptLists
|
6
|
-
VERSION = '0.0.
|
6
|
+
VERSION = '0.0.2'
|
7
7
|
|
8
8
|
class List
|
9
|
-
def initialize(
|
10
|
-
@
|
11
|
-
|
12
|
-
Hash[id, file_path]
|
13
|
-
end
|
9
|
+
def initialize(list_name, sublist_names)
|
10
|
+
@id = list_name.to_sym
|
11
|
+
@sublists = sublist_names
|
14
12
|
end
|
15
13
|
|
16
14
|
def method_missing(method_name, *args)
|
17
|
-
sublist = @sublists.find { |sublist| sublist
|
15
|
+
sublist = @sublists.find { |sublist| sublist == method_name }
|
18
16
|
if sublist
|
19
|
-
|
17
|
+
path = "lists/#{@id}/#{sublist}.yml"
|
18
|
+
Sublist.new(path)
|
20
19
|
else
|
21
20
|
super
|
22
21
|
end
|
23
22
|
end
|
24
23
|
|
25
24
|
def respond_to_missing?(method_name, include_private = false)
|
26
|
-
sublist = @sublists.find { |sublist| sublist
|
25
|
+
sublist = @sublists.find { |sublist| sublist == method_name }
|
27
26
|
sublist || super
|
28
27
|
end
|
29
28
|
end
|
@@ -42,24 +41,29 @@ module PromptLists
|
|
42
41
|
end
|
43
42
|
|
44
43
|
class << self
|
45
|
-
def
|
46
|
-
|
44
|
+
def all
|
45
|
+
Dir["lists/*"].map do |list|
|
46
|
+
list_name = File.basename(list)
|
47
|
+
List.new(list_name, load_sublists(list_name))
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def find(list_name)
|
47
52
|
if list_exists?(list_name)
|
48
|
-
|
49
|
-
List.new(result)
|
50
|
-
else
|
51
|
-
super
|
53
|
+
List.new(list_name, load_sublists(list_name))
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
55
|
-
def
|
56
|
-
|
57
|
+
def method_missing(method_name, *args)
|
58
|
+
find(method_name) || super
|
57
59
|
end
|
58
60
|
|
59
61
|
private
|
60
62
|
|
61
|
-
def
|
62
|
-
Dir["lists/#{list_name}/*.yml"]
|
63
|
+
def load_sublists(list_name)
|
64
|
+
Dir["lists/#{list_name}/*.yml"].map do |file_path|
|
65
|
+
File.basename(file_path, ".yml").gsub(/-/, "_").to_sym
|
66
|
+
end
|
63
67
|
end
|
64
68
|
|
65
69
|
def list_exists?(list_name)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prompt-lists
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dreaming Tulpa
|
@@ -270,11 +270,11 @@ files:
|
|
270
270
|
- lists/word/adverb.yml
|
271
271
|
- lists/word/noun.yml
|
272
272
|
- lists/word/verb.yml
|
273
|
-
homepage: https://
|
273
|
+
homepage: https://promptcache.com
|
274
274
|
licenses:
|
275
275
|
- MIT
|
276
276
|
metadata:
|
277
|
-
homepage_uri: https://
|
277
|
+
homepage_uri: https://promptcache.com
|
278
278
|
source_code_uri: https://github.com/dreamingtulpa/prompt-lists
|
279
279
|
changelog_uri: https://github.com/dreamingtulpa/prompt-lists/blob/master/CHANGELOG.md
|
280
280
|
post_install_message:
|
@@ -295,5 +295,5 @@ requirements: []
|
|
295
295
|
rubygems_version: 3.4.10
|
296
296
|
signing_key:
|
297
297
|
specification_version: 4
|
298
|
-
summary: Categorised lists of things for AI image and media generation.
|
298
|
+
summary: Categorised lists of things for AI image and media generation on promptcache.com.
|
299
299
|
test_files: []
|