rails_console_pro 0.1.1 → 0.1.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 212f6c9da69da95f89adde09139086ead382077988260cf4c348a3e70e2aa27a
|
|
4
|
+
data.tar.gz: 4bc720a83588b51498f89986a6f5563a7a6da761e2060808048213081d678116
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6544050d3a2ac2ae62d763e7ba9747eb13fcb96119ed2c874c44b2749b5849c10b38e32fdfea1ca5411d04290b112cc6b110331408f1677ff9e7c390289f834
|
|
7
|
+
data.tar.gz: e9b7c36b8659b0e27a426a38157328e7c397aec326f84a2f7ae6caad584f4d56cdb8b31c53c8d8906bcbf84304840aa1b46d896d18ee88035c07f79b099931a5
|
|
@@ -8,6 +8,9 @@ module RailsConsolePro
|
|
|
8
8
|
|
|
9
9
|
# Singleton Pastel instance
|
|
10
10
|
PASTEL = Pastel.new(enabled: TTY::Color.color?)
|
|
11
|
+
|
|
12
|
+
# Require ColorHelper early since it's used throughout
|
|
13
|
+
require_relative 'color_helper'
|
|
11
14
|
|
|
12
15
|
# Configuration instance
|
|
13
16
|
def config
|
|
@@ -22,7 +25,6 @@ module RailsConsolePro
|
|
|
22
25
|
|
|
23
26
|
# Autoload all components
|
|
24
27
|
autoload :Configuration, "rails_console_pro/configuration"
|
|
25
|
-
autoload :ColorHelper, "rails_console_pro/color_helper"
|
|
26
28
|
autoload :BasePrinter, "rails_console_pro/base_printer"
|
|
27
29
|
autoload :ModelValidator, "rails_console_pro/model_validator"
|
|
28
30
|
autoload :SchemaInspectorResult, "rails_console_pro/schema_inspector_result"
|
|
@@ -57,7 +59,7 @@ module RailsConsolePro
|
|
|
57
59
|
rescue => e
|
|
58
60
|
# Show error in development to help debug
|
|
59
61
|
if Rails.env.development? || ENV['RAILS_CONSOLE_PRO_DEBUG']
|
|
60
|
-
pastel =
|
|
62
|
+
pastel = PASTEL
|
|
61
63
|
output.puts pastel.red.bold("💥 RailsConsolePro Error: #{e.class}: #{e.message}")
|
|
62
64
|
output.puts pastel.dim(e.backtrace.first(5).join("\n"))
|
|
63
65
|
end
|
|
@@ -105,7 +107,7 @@ module RailsConsolePro
|
|
|
105
107
|
end
|
|
106
108
|
|
|
107
109
|
def handle_error(output, error, value, pry_instance)
|
|
108
|
-
pastel =
|
|
110
|
+
pastel = PASTEL
|
|
109
111
|
output.puts pastel.red.bold("💥 #{error.class}: #{error.message}")
|
|
110
112
|
output.puts pastel.dim(error.backtrace.first(3).join("\n"))
|
|
111
113
|
default_print(output, value, pry_instance)
|
|
@@ -169,7 +171,7 @@ end
|
|
|
169
171
|
|
|
170
172
|
# Print welcome message if enabled (only for Pry)
|
|
171
173
|
if RailsConsolePro.config.show_welcome_message && defined?(Pry)
|
|
172
|
-
pastel =
|
|
174
|
+
pastel = RailsConsolePro::PASTEL
|
|
173
175
|
puts pastel.bright_green("🚀 Rails Console Pro Loaded!")
|
|
174
176
|
puts pastel.cyan("📊 Use `schema ModelName`, `explain Query`, `stats ModelName`, `diff obj1, obj2`, or `navigate ModelName`")
|
|
175
177
|
puts pastel.dim("💾 Export support: Use `.to_json`, `.to_yaml`, `.to_html`, or `.export_to_file` on any result")
|