mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
getway lib
This commit is contained in:
20
app/libs/getway.rb
Normal file
20
app/libs/getway.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
module Getway
|
||||
class << self
|
||||
def getway_config
|
||||
getway_config = {}
|
||||
|
||||
begin
|
||||
config = Rails.application.config_for(:configuration).symbolize_keys!
|
||||
getway_config = config[:getway].symbolize_keys!
|
||||
raise 'getway config missing' if getway_config.blank?
|
||||
rescue => ex
|
||||
raise ex if Rails.env.production?
|
||||
|
||||
puts %Q{\033[33m [warning] getway config or configuration.yml missing,
|
||||
please add it or execute 'cp config/configuration.yml.example config/configuration.yml' \033[0m}
|
||||
getway_config = {}
|
||||
end
|
||||
getway_config
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user