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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12cf020db05a18abd78762cda6066f4b99220d20bfb0fe43c82f684523191436
4
- data.tar.gz: 1bc63760c24188c261532c6a8f75a30a5d8d17a3918795a9b2b5d8bb82945f7e
3
+ metadata.gz: 470a9a2e1784148f8e3f564e148858b5d6d2282ac0c5be577cdb82b142292f1c
4
+ data.tar.gz: 4a9cc2d872bd350372562a38722c51706be6600d3abc8ae01a92bf53709dd77d
5
5
  SHA512:
6
- metadata.gz: 6bf0c5c275c75c4b05cc452fa7609084ec030d312fd839a7713d6c623370ca78f4016e72c13c8734f4b6241328f546960baaedcb593ba11c1686e8287c420060
7
- data.tar.gz: 45aaa46345e2c5214cce932450856eafb08f408b73f26e8313847bce6a0cd9c5998029166f695dd868833bc7c295a38321e93d32ac2f4415d01dee30dcc81331
6
+ metadata.gz: b224390cb3c7acf9b0a925de3da24edb62842219e92a132369f67128da1dd71af2b7c6365e9ab4df4216e5c22a55c9a641068773e340fd63b1c2dedbf9bd2dee
7
+ data.tar.gz: e4b1ecd1cd6d03e3f6001837115c5946e008ec7231f822d82038e7978ac23d78c8cdee7d601e1fc5971b224f7390dffb0ce351ac666a2e8b2e537388c1b62f93
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.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
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dreaming Tulpa