console_buddy 0.1.4 → 0.1.7

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: 0e75b7c226fbd998a755de1b2aae689f803e2d8a763d8f5bec5e960ea4d861be
4
- data.tar.gz: f743de5e2757ab1957089687587a74decdddea8ac423ba0f8bf2586286e8c3d8
3
+ metadata.gz: f1e406a859233d5cdbad0f209d2920194f845210b8362eb34a1e9e80506847e0
4
+ data.tar.gz: 8c412f227c4b96c87e1f2b7ff3d5dc27ba6a308bc89f2e886925b04185add0c7
5
5
  SHA512:
6
- metadata.gz: 43ed9456043bfbc5ef45cff2f1815e9d6becec1915691b0f5def7b248f5c1eb888108036f34935ec33965263b8e6df2a60fd0e7fa9e418882ee5099c0d60be5a
7
- data.tar.gz: debbb0f400ecdc58dd3c6c076f70f49213e97d0aa4619410919cdc81b2d5b9c0c20bb0b2e15ae83746b6459d166bbb889e7e31ff4fcb8362ccb44f7758b757cf
6
+ metadata.gz: 795674e62d2ba1252846e07c52523e57c5497a0ec2768a14b9cefd9ece962c5bac95c63d2ca12b6cb85234c6f94033578f355740d56492b9b6be326e001e3b5f
7
+ data.tar.gz: 5fdee70a3ba51e3d5267f434ec72dd669fd5a0c6d0c03a207b983e0f4f95836265349a27ecdbf2f6eb729083fa7af4ed13fe5b306a0f4cc146b9c95e493fdc48
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConsoleBuddy
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.7"
5
5
  end
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
 
@@ -14,6 +25,7 @@ require_relative "console_buddy/version"
14
25
  require_relative "console_buddy/one_off_job"
15
26
  require_relative "console_buddy/job"
16
27
 
28
+ rspec_present = false
17
29
  # Only load the one-off job classes if the gems are installed
18
30
  #
19
31
  begin
@@ -37,6 +49,14 @@ rescue LoadError
37
49
  # puts "ActiveJob gem not installed, skipping active job integration."
38
50
  end
39
51
 
52
+ begin
53
+ require 'rspec'
54
+ rspec_present = true
55
+ rescue LoadError
56
+ rspec_present = false
57
+ # puts "RSpec gem not installed, skipping rspec integration."
58
+ end
59
+
40
60
  module ConsoleBuddy
41
61
  class << self
42
62
  attr_accessor :verbose_console, :allowed_envs, :use_in_debuggers, :ignore_startup_errors, :use_in_tests, :one_off_job_service_type
@@ -121,9 +141,10 @@ module ConsoleBuddy
121
141
  def load_console_buddy_files
122
142
  console_buddy_path = Pathname.new(File.join(Dir.pwd, '.console_buddy'))
123
143
  if console_buddy_path.exist? && console_buddy_path.directory?
124
- console_buddy_path.each_child do |file|
125
- next unless file.file?
126
- require file.to_s
144
+ console_buddy_path.find do |path|
145
+ next unless path.file?
146
+ next if path.basename.to_s == 'config.rb' # Skip config.rb as it's loaded separately
147
+ require path.to_s
127
148
  end
128
149
  else
129
150
  puts ".console_buddy folder not found in the root of the project."
@@ -213,4 +234,7 @@ end
213
234
 
214
235
  require_relative "console_buddy/initializers/byebug"
215
236
  require_relative "console_buddy/initializers/rails"
216
- require_relative "console_buddy/initializers/rspec"
237
+
238
+ if rspec_present
239
+ require_relative "console_buddy/initializers/rspec"
240
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console_buddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Bowie
8
- - Code Cowboy
8
+ - Good For Nothing
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-12-27 00:00:00.000000000 Z
12
+ date: 2025-06-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails