console_buddy 0.1.8 → 0.1.9

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: d35fbaa7b27ba6c31c7d4e42ca6755c26acf262087e6e30ab6621f34d13b3353
4
- data.tar.gz: 0f83b27f617bf7240e804efff72696ec3d1cc760adfd1ddb2ad22a64e4f0175d
3
+ metadata.gz: e3405d3e352a7082a232730e28352f8724badbbf069380fa80450c955997454f
4
+ data.tar.gz: 0cbc27a23dda483e14ce75818560b42dde9dc7ed034e870074d8d36b278eee1c
5
5
  SHA512:
6
- metadata.gz: 22b7a2954f507a6b734591822d64f105f1e263a976bb9a3c2c1657adf5dd70f81646baa68fb3b3c195977c5bad38f2f72a3750fdfe8ee5842c6bf395a44c873a
7
- data.tar.gz: 2bfea75dc6096159a1f7352796be9892052794382ed03bdea7acf8689548771db41ba7ae6ae371474e377658dff4134615b1cb20729e45d75bce631752892a23
6
+ metadata.gz: eafabb5a03cfe5a5229d3f5e1042f52592ecb6d324d940208918a5037695c9d5fdf381816648bf0ecb5df572bf45b32c21753f0953a67b7a198740164fe0e397
7
+ data.tar.gz: 48ba1b2de4bc2627a32a656f7edfb9191f1de62d5c165f61ebe34d2f8138aa5934dd93c59dd0c1ddcf86da6bfed5af847785bd81be7189ee25940380f169cd9c
@@ -8,7 +8,7 @@ require_relative "../one_off_job"
8
8
  module ConsoleBuddy
9
9
  module Jobs
10
10
  class Sidekiq
11
- include ::Sidekiq::Job
11
+ include(defined?(::Sidekiq::Job) ? ::Sidekiq::Job : ::Sidekiq::Worker)
12
12
 
13
13
  def perform(*args)
14
14
  ::ConsoleBuddy::OneOffJob.perform(*args)
@@ -6,9 +6,6 @@ require 'terminal-table'
6
6
  module ConsoleBuddy
7
7
  module Report
8
8
  # Example Usage:
9
- # ConsoleBuddy::Report.table_print(User.all, "username")
10
- #
11
- # Example 2:
12
9
  # table_print User.all, "username"
13
10
  def table_print(data, options = {})
14
11
  puts ::TablePrint::Printer.table_print(data, options)
@@ -16,9 +13,6 @@ module ConsoleBuddy
16
13
  alias print_data table_print
17
14
 
18
15
  # Example Usage:
19
- # ConsoleBuddy::Report.table_for([["foo", "bar"], ["baz", "qux"]], ["col1", "col2"])
20
- #
21
- # Example 2:
22
16
  # table_for([["foo", "bar"], ["baz", "qux"]], ["col1", "col2"])
23
17
  def table_for(rows, headers = [])
24
18
  table = ::Terminal::Table.new(headings: headers, rows: rows)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConsoleBuddy
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
data/lib/console_buddy.rb CHANGED
@@ -66,8 +66,6 @@ module ConsoleBuddy
66
66
  end
67
67
 
68
68
  def start!
69
- return if !console_buddy_directory_exists?
70
-
71
69
  # Initialize the default values
72
70
  set_config_defaults
73
71
  # Check if there is a .console_buddy/config file
@@ -88,7 +86,10 @@ module ConsoleBuddy
88
86
  start_buddy_in_byebug
89
87
  puts "ConsoleBuddy session started! Debugger: #{use_in_debuggers} | Test: #{current_env}" if verbose_console
90
88
  rescue ::StandardError => error
91
- puts "ConsoleBuddy encountered an during startup. [Error]: #{error.message}" unless ignore_startup_errors
89
+ unless ignore_startup_errors
90
+ puts "ConsoleBuddy encountered an error during startup. [Error]: #{error.message}"
91
+ puts error.backtrace.first(5).join("\n")
92
+ end
92
93
  end
93
94
  end
94
95
 
@@ -192,7 +193,7 @@ module ConsoleBuddy
192
193
  def start_buddy_in_irb
193
194
  if defined? IRB::ExtendCommandBundle
194
195
  IRB::ExtendCommandBundle.include(ConsoleBuddy::IRB)
195
- require 'progress_bar/core_ext/enumerable_with_progress'
196
+ load_progress_bar
196
197
  end
197
198
  end
198
199
 
@@ -201,10 +202,17 @@ module ConsoleBuddy
201
202
  def start_buddy_in_rails
202
203
  if defined? Rails::ConsoleMethods
203
204
  Rails::ConsoleMethods.include(ConsoleBuddy::IRB)
204
- require 'progress_bar/core_ext/enumerable_with_progress'
205
+ load_progress_bar
205
206
  end
206
207
  end
207
208
 
209
+ def load_progress_bar
210
+ require 'progress_bar/core_ext/enumerable_with_progress'
211
+ rescue StandardError
212
+ # progress_bar iterates all Enumerable-including modules via ObjectSpace
213
+ # and fails if any are frozen, which is common in Rails apps
214
+ end
215
+
208
216
  # This will add the buddy methods to the Byebug console
209
217
  # TODO: Add support for Pry
210
218
  def start_buddy_in_byebug
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console_buddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Bowie
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-06-24 00:00:00.000000000 Z
12
+ date: 2026-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -169,6 +169,7 @@ description: Define custom methods, helper, and aliases for your app and use the
169
169
  in your rails console or IRB session.
170
170
  email:
171
171
  - micahbowie20@gmail.com
172
+ - micah@goodfornothing.tech
172
173
  executables: []
173
174
  extensions: []
174
175
  extra_rdoc_files: []
@@ -206,10 +207,10 @@ files:
206
207
  homepage:
207
208
  licenses: []
208
209
  metadata:
209
- bug_tracker_uri: https://github.com/micahbowie/console_buddy/issues
210
- changelog_uri: https://github.com/micahbowie/console_buddy/CHANGELOG.md
211
- documentation_uri: https://github.com/micahbowie/console_buddy
212
- source_code_uri: https://github.com/micahbowie/console_buddy
210
+ bug_tracker_uri: https://github.com/GoodForNothingTech/console_buddy/issues
211
+ changelog_uri: https://github.com/GoodForNothingTech/console_buddy/CHANGELOG.md
212
+ documentation_uri: https://github.com/GoodForNothingTech/console_buddy
213
+ source_code_uri: https://github.com/GoodForNothingTech/console_buddy
213
214
  post_install_message:
214
215
  rdoc_options: []
215
216
  require_paths: