prompt-lists 0.0.2 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12cf020db05a18abd78762cda6066f4b99220d20bfb0fe43c82f684523191436
4
- data.tar.gz: 1bc63760c24188c261532c6a8f75a30a5d8d17a3918795a9b2b5d8bb82945f7e
3
+ metadata.gz: 5a32d7160bd03ddb40bea30eaabeb90c2f4ba99e85c972c70fd26b43f6f33d19
4
+ data.tar.gz: 11e7d757572711d98ee978731ed99b81364d11e378f5f19f9b19ba3e1b539355
5
5
  SHA512:
6
- metadata.gz: 6bf0c5c275c75c4b05cc452fa7609084ec030d312fd839a7713d6c623370ca78f4016e72c13c8734f4b6241328f546960baaedcb593ba11c1686e8287c420060
7
- data.tar.gz: 45aaa46345e2c5214cce932450856eafb08f408b73f26e8313847bce6a0cd9c5998029166f695dd868833bc7c295a38321e93d32ac2f4415d01dee30dcc81331
6
+ metadata.gz: 5363c5c8edd63ea2c027b2f35b0284d9cf45c274bf9910eaf4328493aec16960690d52bbaac05b7d9aded9064cfc83e5cb1716d8f3caaeae21d002a23e2ca861
7
+ data.tar.gz: 18fc2b6cc2eebe17643c0f66e56af74dcb14987eb49771542518e0eee4bbd642c3a587570c588142a51eb832d23d27070ce593f6198b882885e329df0fbc843e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- prompt-lists (0.0.1)
4
+ prompt-lists (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -6,7 +6,7 @@ generation on [PROMPTCACHE](https://promptcache.com).
6
6
  ## Installation
7
7
 
8
8
  ```ruby
9
- gem "prompt-lists"
9
+ gem "prompt-lists", require: 'prompt_lists'
10
10
  ```
11
11
 
12
12
  ## Usage
data/lib/prompt_lists.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'yaml'
4
4
 
5
5
  module PromptLists
6
- VERSION = '0.0.2'
6
+ VERSION = '0.0.4'
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