console_buddy 0.1.5 → 0.1.8
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 +4 -4
- data/lib/console_buddy/version.rb +1 -1
- data/lib/console_buddy.rb +17 -3
- 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: d35fbaa7b27ba6c31c7d4e42ca6755c26acf262087e6e30ab6621f34d13b3353
|
4
|
+
data.tar.gz: 0f83b27f617bf7240e804efff72696ec3d1cc760adfd1ddb2ad22a64e4f0175d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22b7a2954f507a6b734591822d64f105f1e263a976bb9a3c2c1657adf5dd70f81646baa68fb3b3c195977c5bad38f2f72a3750fdfe8ee5842c6bf395a44c873a
|
7
|
+
data.tar.gz: 2bfea75dc6096159a1f7352796be9892052794382ed03bdea7acf8689548771db41ba7ae6ae371474e377658dff4134615b1cb20729e45d75bce631752892a23
|
data/lib/console_buddy.rb
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'pathname'
|
4
|
+
|
5
|
+
# Check if .console_buddy directory exists
|
6
|
+
def console_buddy_directory_exists?
|
7
|
+
console_buddy_path = Pathname.new(File.join(Dir.pwd, '.console_buddy'))
|
8
|
+
console_buddy_path.exist? && console_buddy_path.directory?
|
9
|
+
end
|
10
|
+
|
11
|
+
if !console_buddy_directory_exists?
|
12
|
+
return
|
13
|
+
end
|
14
|
+
|
4
15
|
require 'active_support'
|
5
16
|
require 'active_support/all'
|
6
17
|
|
@@ -55,6 +66,8 @@ module ConsoleBuddy
|
|
55
66
|
end
|
56
67
|
|
57
68
|
def start!
|
69
|
+
return if !console_buddy_directory_exists?
|
70
|
+
|
58
71
|
# Initialize the default values
|
59
72
|
set_config_defaults
|
60
73
|
# Check if there is a .console_buddy/config file
|
@@ -130,9 +143,10 @@ module ConsoleBuddy
|
|
130
143
|
def load_console_buddy_files
|
131
144
|
console_buddy_path = Pathname.new(File.join(Dir.pwd, '.console_buddy'))
|
132
145
|
if console_buddy_path.exist? && console_buddy_path.directory?
|
133
|
-
console_buddy_path.
|
134
|
-
next unless
|
135
|
-
|
146
|
+
console_buddy_path.find do |path|
|
147
|
+
next unless path.file?
|
148
|
+
next if path.basename.to_s == 'config.rb' # Skip config.rb as it's loaded separately
|
149
|
+
require path.to_s
|
136
150
|
end
|
137
151
|
else
|
138
152
|
puts ".console_buddy folder not found in the root of the project."
|