From 64b2704b02991c5eed808360503c78222d610b89 Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Thu, 22 Feb 2024 22:39:20 +0000 Subject: [PATCH] refactor: move lib/postal/user_creator to app/util/user_creator --- {lib/postal => app/util}/user_creator.rb | 8 +++++--- script/make_user.rb | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) rename {lib/postal => app/util}/user_creator.rb (93%) diff --git a/lib/postal/user_creator.rb b/app/util/user_creator.rb similarity index 93% rename from lib/postal/user_creator.rb rename to app/util/user_creator.rb index 27bb973..49b5d70 100644 --- a/lib/postal/user_creator.rb +++ b/app/util/user_creator.rb @@ -2,10 +2,11 @@ require "highline" -module Postal - module UserCreator +module UserCreator - def self.start(&block) + class << self + + def start(&block) cli = HighLine.new puts "\e[32mPostal User Creator\e[0m" puts "Enter the information required to create a new Postal user." @@ -31,4 +32,5 @@ module Postal end end + end diff --git a/script/make_user.rb b/script/make_user.rb index f5986c7..c98e0d2 100755 --- a/script/make_user.rb +++ b/script/make_user.rb @@ -7,9 +7,8 @@ trap("INT") do end require_relative "../config/environment" -require "postal/user_creator" -Postal::UserCreator.start do |u| +UserCreator.start do |u| u.admin = true u.email_verified_at = Time.now end