Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reload! method to bin/console #49

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

ENV['RACK_ENV'] ||= ENV['RAILS_ENV'] || 'development'

require "bundler/setup"
require "stretchy"
require "irb"

banner = <<~BANNER

d8b
d8P d8P ?88
d888888P d888888P 88b
.d888b, ?88' 88bd88b d8888b ?88' d8888b 888888b ?88 d8P
?8b, 88P 88P' `d8b_,dP 88P d8P' `P 88P `?8bd88 88
`?8b 88b d88 88b 88b 88b d88 88P?8( d88
`?888P' `?8b d88' `?888P' `?8b `?888P'd88' 88b`?88P'?8b
)88
,d8P
`?888P'
BANNER
include Stretchy::Utils::ConsoleMethods

print Rainbow(banner).red
print "\t " * 7
Expand Down
21 changes: 21 additions & 0 deletions lib/stretchy/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@ module Stretchy
module Utils
extend ActiveSupport::Concern

concerning :ConsoleMethods do
def reload!
Stretchy.loader.reload
end

def banner
banner = <<~BANNER

d8b
d8P d8P ?88
d888888P d888888P 88b
.d888b, ?88' 88bd88b d8888b ?88' d8888b 888888b ?88 d8P
?8b, 88P 88P' `d8b_,dP 88P d8P' `P 88P `?8bd88 88
`?8b 88b d88 88b 88b 88b d88 88P?8( d88
`?888P' `?8b d88' `?888P' `?8b `?888P'd88' 88b`?88P'?8b
)88
,d8P
`?888P'
BANNER
end
end

def self.to_curl(klass, arguments = {}, end_point = "_search")
host = klass.gateway.client.transport.transport.hosts&.first || klass.gateway.client.transport.transport.options[:url]
Expand Down
Loading