prompt-lists 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/prompt_lists.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 470a9a2e1784148f8e3f564e148858b5d6d2282ac0c5be577cdb82b142292f1c
|
4
|
+
data.tar.gz: 4a9cc2d872bd350372562a38722c51706be6600d3abc8ae01a92bf53709dd77d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b224390cb3c7acf9b0a925de3da24edb62842219e92a132369f67128da1dd71af2b7c6365e9ab4df4216e5c22a55c9a641068773e340fd63b1c2dedbf9bd2dee
|
7
|
+
data.tar.gz: e4b1ecd1cd6d03e3f6001837115c5946e008ec7231f822d82038e7978ac23d78c8cdee7d601e1fc5971b224f7390dffb0ce351ac666a2e8b2e537388c1b62f93
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/prompt_lists.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'yaml'
|
4
4
|
|
5
5
|
module PromptLists
|
6
|
-
VERSION = '0.0.
|
6
|
+
VERSION = '0.0.3'
|
7
7
|
|
8
8
|
class List
|
9
9
|
def initialize(list_name, sublist_names)
|
@@ -14,7 +14,7 @@ module PromptLists
|
|
14
14
|
def method_missing(method_name, *args)
|
15
15
|
sublist = @sublists.find { |sublist| sublist == method_name }
|
16
16
|
if sublist
|
17
|
-
path = "lists/#{@id}/#{sublist}.yml"
|
17
|
+
path = File.expand_path("../lists/#{@id}/#{sublist}.yml", __dir__)
|
18
18
|
Sublist.new(path)
|
19
19
|
else
|
20
20
|
super
|
@@ -42,7 +42,7 @@ module PromptLists
|
|
42
42
|
|
43
43
|
class << self
|
44
44
|
def all
|
45
|
-
Dir["lists/*"].map do |list|
|
45
|
+
Dir[File.expand_path("../lists/*", __dir__)].map do |list|
|
46
46
|
list_name = File.basename(list)
|
47
47
|
List.new(list_name, load_sublists(list_name))
|
48
48
|
end
|
@@ -61,13 +61,13 @@ module PromptLists
|
|
61
61
|
private
|
62
62
|
|
63
63
|
def load_sublists(list_name)
|
64
|
-
Dir["lists/#{list_name}/*.yml"].map do |file_path|
|
64
|
+
Dir[File.expand_path("../lists/#{list_name}/*.yml", __dir__)].map do |file_path|
|
65
65
|
File.basename(file_path, ".yml").gsub(/-/, "_").to_sym
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
69
|
def list_exists?(list_name)
|
70
|
-
Dir.exist?("lists/#{list_name}")
|
70
|
+
Dir.exist?(File.expand_path("../lists/#{list_name}", __dir__))
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|