ubicloud/bin/pry
Daniel Farina 4a707900ac Add warning emoji to production prompt.
This can render in some situations where colors cannot.

I also removed a trailing red-colored spac: I thought it looked a
(just a bit) weird.
2023-08-23 08:46:38 +03:00

27 lines
560 B
Ruby
Executable file
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env ruby
# frozen_string_literal: true
REPL = true
require_relative "../loader"
require "pry"
def dev_project
return unless Config.development?
ac = Account[email: "dev@ubicloud.com"] || Account.create_with_id(email: "dev@ubicloud.com")
ac.projects.first || ac.create_project_with_default_policy("default")
end
def udec(*)
UBID.decode(*)
end
opts = Pry::CLI.parse_options
Pry.config.prompt_name = if Config.production?
"\e[41m⚠ %s\e[0m" % "clover-#{Config.rack_env}"
else
"clover-#{Config.rack_env}"
end
Pry::CLI.start(opts)