eac_rails_base0 0.45.0 → 0.49.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/eac_rails_base0/application_controller.rb +2 -0
- data/app/controllers/eac_rails_base0/mailer_controller.rb +32 -0
- data/app/helpers/eac_rails_base0/layout_helper.rb +0 -54
- data/app/helpers/eac_rails_base0/main_menu_helper.rb +63 -0
- data/app/helpers/eac_rails_base0/user_menu_helper.rb +18 -0
- data/app/mailers/eac_rails_base0/application_mailer.rb +12 -0
- data/app/mailers/eac_rails_base0/send_test_mailer.rb +10 -0
- data/app/tableless_models/eac_rails_base0/email_send_test.rb +32 -0
- data/app/views/eac_rails_base0/mailer/info.html.erb +17 -0
- data/app/views/eac_rails_base0/mailer/send_test.html.erb +5 -0
- data/app/views/eac_rails_base0/send_test_mailer/main.html.erb +1 -0
- data/app/views/layouts/eac_rails_base0/_navbar_user.html.erb +1 -10
- data/config/initializers/action_mailer.rb +21 -19
- data/config/locales/en.yml +10 -0
- data/config/locales/pt-BR.yml +6 -0
- data/config/routes.rb +11 -0
- data/lib/eac_rails_base0/app_base/ability.rb +1 -0
- data/lib/eac_rails_base0/app_base/ability_mapping.rb +5 -0
- data/lib/eac_rails_base0/app_base/application.rb +6 -0
- data/lib/eac_rails_base0/app_base/application/all.rb +1 -8
- data/lib/eac_rails_base0/app_base/application/development.rb +1 -1
- data/lib/eac_rails_base0/app_base/application/envvars.rb +44 -0
- data/lib/eac_rails_base0/app_base/application/production.rb +1 -5
- data/lib/eac_rails_base0/app_base/application/test.rb +13 -2
- data/lib/eac_rails_base0/app_generator/templates/gitignore +2 -1
- data/lib/eac_rails_base0/version.rb +1 -1
- data/lib/eac_rails_base0/x_engine.rb +4 -0
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6af95bb6d865ba96bce913db79e8de93b2ec99edb2b0b89377e212f6bc596524
|
4
|
+
data.tar.gz: a482b176d1508063b16bc6c6feab3c927bc3637dacb5c7332f3bf04ab56b619b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3afaf64af256027d1a6f97e48563b33918faf9b67466f2a10a6dca55c061d8ffe9d596bdbd370700b485b1dfb4d6a84ee4e5fec6815a36767bae7501dc92957a
|
7
|
+
data.tar.gz: 3e2872006a5a534968958c2955a34531596d673d7a455a5461486d61c60e46d021e8021aa8969321fb751fa77b4c938aa4ecbb8e5dc37e3b957fa3e388d5d271
|
@@ -7,9 +7,11 @@ module EacRailsBase0
|
|
7
7
|
layout 'eac_rails_base0/application'
|
8
8
|
helper ::EacRailsBase0::AppVersionHelper
|
9
9
|
helper ::EacRailsBase0::LayoutHelper
|
10
|
+
helper ::EacRailsBase0::MainMenuHelper
|
10
11
|
helper ::EacRailsUtils::FormatterHelper
|
11
12
|
helper ::EacRailsUtils::LinksHelper
|
12
13
|
helper ::EacRailsUtils::OpenGraphProtocolHelper
|
14
|
+
helper ::EacRailsBase0::UserMenuHelper
|
13
15
|
|
14
16
|
# Prevent CSRF attacks by raising an exception.
|
15
17
|
# For APIs, you may want to use :null_session instead.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRailsBase0
|
4
|
+
class MailerController < ::EacRailsBase0::ApplicationController
|
5
|
+
def info
|
6
|
+
klass = ::ActionMailer::Base
|
7
|
+
@sections = %w[default_params default_url_options smtp_settings].map do |section|
|
8
|
+
["#{klass}.#{section}", klass.send(section)]
|
9
|
+
end.to_h
|
10
|
+
end
|
11
|
+
|
12
|
+
def send_test
|
13
|
+
@record = ::EacRailsBase0::EmailSendTest.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def send_test_submit
|
17
|
+
@record = ::EacRailsBase0::EmailSendTest.new(send_test_submit_params)
|
18
|
+
if @record.save
|
19
|
+
flash[:success] = t('eac_rails_base0.mailer.send_test_successful', address: @record.address)
|
20
|
+
redirect_to action: :send_test
|
21
|
+
else
|
22
|
+
render :send_test
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def send_test_submit_params
|
29
|
+
params[::EacRailsBase0::EmailSendTest.model_name.param_key].permit(:alternative_address)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
module EacRailsBase0
|
4
4
|
module LayoutHelper
|
5
5
|
APP_TITLE_METHOD = 'app_title'
|
6
|
-
APP_MAIN_MENU_ENTRIES_METHOD = 'app_main_menu_entries'
|
7
6
|
|
8
7
|
def base0_app_title
|
9
8
|
if respond_to?(APP_TITLE_METHOD)
|
@@ -12,58 +11,5 @@ module EacRailsBase0
|
|
12
11
|
"Implement the helper method \"#{APP_TITLE_METHOD}\""
|
13
12
|
end
|
14
13
|
end
|
15
|
-
|
16
|
-
def base0_app_main_menu_entries
|
17
|
-
if respond_to?(APP_MAIN_MENU_ENTRIES_METHOD)
|
18
|
-
send(APP_MAIN_MENU_ENTRIES_METHOD, base0_app_main_menu_default_entries)
|
19
|
-
else
|
20
|
-
base0_app_main_menu_default_entries
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def base0_app_main_menu_default_entries
|
25
|
-
{
|
26
|
-
'Administração' => base0_app_main_menu_admin_entries
|
27
|
-
}
|
28
|
-
end
|
29
|
-
|
30
|
-
def base0_app_main_menu_admin_entries
|
31
|
-
h = {}
|
32
|
-
base0_app_main_menu_admin_gems.each do |gem_module|
|
33
|
-
identifier = gem_module.name.underscore
|
34
|
-
h[::I18n.t("eac_rails_base0.main_menu.admin.#{identifier}")] =
|
35
|
-
send("#{identifier}_main_menu_admin_entries")
|
36
|
-
end
|
37
|
-
h
|
38
|
-
end
|
39
|
-
|
40
|
-
def base0_app_main_menu_admin_gems
|
41
|
-
[::EacUsersSupport, ::TasksScheduler, ::Aranha, ::BrRailties]
|
42
|
-
end
|
43
|
-
|
44
|
-
def eac_users_support_main_menu_admin_entries
|
45
|
-
{
|
46
|
-
::EacUsersSupport::User.model_name.human(count: 2) => [eac_users_support.admin_users_path]
|
47
|
-
}
|
48
|
-
end
|
49
|
-
|
50
|
-
def tasks_scheduler_main_menu_admin_entries
|
51
|
-
{
|
52
|
-
t('activerecord.models.scheduled_task.other') => [main_app.status_scheduled_tasks_path]
|
53
|
-
}
|
54
|
-
end
|
55
|
-
|
56
|
-
def aranha_main_menu_admin_entries
|
57
|
-
{
|
58
|
-
::Aranha::Address.model_name.human(count: 2) => [aranha.addresses_path]
|
59
|
-
}
|
60
|
-
end
|
61
|
-
|
62
|
-
def br_railties_main_menu_admin_entries
|
63
|
-
{
|
64
|
-
::BrRailties::FederalUnit.model_name.human(count: 2) => [br_railties.federal_units_path],
|
65
|
-
::BrRailties::Municipality.model_name.human(count: 2) => [br_railties.municipalities_path]
|
66
|
-
}
|
67
|
-
end
|
68
14
|
end
|
69
15
|
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRailsBase0
|
4
|
+
module MainMenuHelper
|
5
|
+
APP_MAIN_MENU_ENTRIES_METHOD = 'app_main_menu_entries'
|
6
|
+
ADMIN_ENTRIES = %w[eac_users_support tasks_scheduler aranha br_railties mailer].freeze
|
7
|
+
|
8
|
+
def base0_app_main_menu_entries
|
9
|
+
if respond_to?(APP_MAIN_MENU_ENTRIES_METHOD)
|
10
|
+
send(APP_MAIN_MENU_ENTRIES_METHOD, base0_app_main_menu_default_entries)
|
11
|
+
else
|
12
|
+
base0_app_main_menu_default_entries
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def base0_app_main_menu_default_entries
|
17
|
+
{
|
18
|
+
'Administração' => base0_app_main_menu_admin_entries
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
def base0_app_main_menu_admin_entries
|
23
|
+
ADMIN_ENTRIES.map do |identifier|
|
24
|
+
[::I18n.t("eac_rails_base0.main_menu.admin.#{identifier}"),
|
25
|
+
send("#{identifier}_main_menu_admin_entries")]
|
26
|
+
end.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
def mailer_main_menu_admin_entries
|
30
|
+
%w[info send_test].map do |action|
|
31
|
+
[
|
32
|
+
t("eac_rails_base0.mailer.#{action}"),
|
33
|
+
main_app.send("#{action}_eac_rails_base0_mailer_index_path")
|
34
|
+
]
|
35
|
+
end.to_h
|
36
|
+
end
|
37
|
+
|
38
|
+
def eac_users_support_main_menu_admin_entries
|
39
|
+
{
|
40
|
+
::EacUsersSupport::User.model_name.human(count: 2) => [eac_users_support.admin_users_path]
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
def tasks_scheduler_main_menu_admin_entries
|
45
|
+
{
|
46
|
+
t('activerecord.models.scheduled_task.other') => [main_app.status_scheduled_tasks_path]
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
def aranha_main_menu_admin_entries
|
51
|
+
{
|
52
|
+
::Aranha::Address.model_name.human(count: 2) => [aranha.addresses_path]
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
def br_railties_main_menu_admin_entries
|
57
|
+
{
|
58
|
+
::BrRailties::FederalUnit.model_name.human(count: 2) => [br_railties.federal_units_path],
|
59
|
+
::BrRailties::Municipality.model_name.human(count: 2) => [br_railties.municipalities_path]
|
60
|
+
}
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRailsBase0
|
4
|
+
module UserMenuHelper
|
5
|
+
def base0_user_menu_entries
|
6
|
+
r = {}
|
7
|
+
if current_user
|
8
|
+
r[current_user.to_s] = {
|
9
|
+
'Alterar senha' => [eac_users_support.edit_user_registration_path]
|
10
|
+
}
|
11
|
+
r['Sair'] = [eac_users_support.destroy_user_session_path, link_method: :delete]
|
12
|
+
else
|
13
|
+
r['Entrar'] = [eac_users_support.new_user_session_path]
|
14
|
+
end
|
15
|
+
r
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRailsBase0
|
4
|
+
class SendTestMailer < ::EacRailsBase0::ApplicationMailer
|
5
|
+
def main
|
6
|
+
@subject = "#{t('eac_rails_base0.mailer.send_test')} [#{::Time.zone.now}]"
|
7
|
+
mail(to: params.fetch(:address), subject: @subject)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module EacRailsBase0
|
6
|
+
class EmailSendTest < ::EacRailsUtils::Models::Tableless
|
7
|
+
attribute :alternative_address, ::String
|
8
|
+
|
9
|
+
validates :alternative_address, allow_blank: true, format: { with: URI::MailTo::EMAIL_REGEXP }
|
10
|
+
validates :logged_user_address, allow_blank: true, format: { with: URI::MailTo::EMAIL_REGEXP }
|
11
|
+
validates :address, presence: true, format: { with: URI::MailTo::EMAIL_REGEXP }
|
12
|
+
|
13
|
+
def save
|
14
|
+
return false unless valid?
|
15
|
+
|
16
|
+
send_mail
|
17
|
+
true
|
18
|
+
end
|
19
|
+
|
20
|
+
def address
|
21
|
+
alternative_address.presence || logged_user_address.presence
|
22
|
+
end
|
23
|
+
|
24
|
+
def logged_user_address
|
25
|
+
::EacUsersSupport::User.current_user.if_present(&:email)
|
26
|
+
end
|
27
|
+
|
28
|
+
def send_mail
|
29
|
+
::EacRailsBase0::SendTestMailer.with(address: address).main.deliver_later
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<h2><%= t('eac_rails_base0.mailer.info') %></h2>
|
2
|
+
<% @sections.each do |section_title, section_data| %>
|
3
|
+
<h3><%= section_title %></h3>
|
4
|
+
<dl>
|
5
|
+
<% section_data.each do |key, value| %>
|
6
|
+
<dt><%= key %></dt>
|
7
|
+
<dd>
|
8
|
+
<% if key.to_s.downcase.include?('password') %>
|
9
|
+
<em><%= value.present? ? 'Present' : 'Blank' %></em>
|
10
|
+
<% else %>
|
11
|
+
<%= value %>
|
12
|
+
<% end %>
|
13
|
+
(<%= value.class %>)
|
14
|
+
</dd>
|
15
|
+
<% end %>
|
16
|
+
</dl>
|
17
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h2><%= @subject %></h2>
|
@@ -1,10 +1 @@
|
|
1
|
-
|
2
|
-
user_menu = {}
|
3
|
-
if current_user
|
4
|
-
user_menu[current_user.to_s] = [main_app.root_path]
|
5
|
-
user_menu['Sair'] = [eac_users_support.destroy_user_session_path, link_method: :delete]
|
6
|
-
else
|
7
|
-
user_menu['Entrar'] = [eac_users_support.new_user_session_path]
|
8
|
-
end
|
9
|
-
%>
|
10
|
-
<%= bootstrap_dropdown_menu(user_menu, class: 'navbar-right') %>
|
1
|
+
<%= bootstrap_dropdown_menu(base0_user_menu_entries, class: 'navbar-right') %>
|
@@ -1,24 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
Rails.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
unless ::Rails.env.test?
|
4
|
+
Rails.application.configure do
|
5
|
+
config.action_mailer.smtp_settings = {
|
6
|
+
address: ENV['action_mailer_smtp_address'],
|
7
|
+
port: ENV['action_mailer_smtp_port'],
|
8
|
+
domain: ENV['action_mailer_smtp_domain'],
|
9
|
+
user_name: ENV['action_mailer_smtp_username'],
|
10
|
+
password: ENV['action_mailer_smtp_password'],
|
11
|
+
authentication: ENV['action_mailer_smtp_authentication'],
|
12
|
+
enable_starttls_auto:
|
13
|
+
::EacRailsBase0::BooleanValue.to_b(ENV['action_mailer_smtp_enable_starttls_auto'])
|
14
|
+
}
|
15
|
+
%i[host port].each do |option|
|
16
|
+
value = ENV["action_mailer_default_url_#{option}"]
|
17
|
+
if value.present?
|
18
|
+
config.action_mailer.default_url_options ||= {}
|
19
|
+
config.action_mailer.default_url_options[option] = value
|
20
|
+
end
|
19
21
|
end
|
22
|
+
config.action_mailer.default_options ||= {}
|
23
|
+
config.action_mailer.default_options[:from] = ENV['action_mailer_default_options_from']
|
24
|
+
config.action_mailer.default_options[:reply_to] = ENV['action_mailer_default_options_reply_to']
|
20
25
|
end
|
21
|
-
config.action_mailer.default_options ||= {}
|
22
|
-
config.action_mailer.default_options[:from] = ENV['action_mailer_default_options_from']
|
23
|
-
config.action_mailer.default_options[:reply_to] = ENV['action_mailer_default_options_reply_to']
|
24
26
|
end
|
data/config/locales/pt-BR.yml
CHANGED
@@ -27,9 +27,15 @@ pt-BR:
|
|
27
27
|
eac_rails_base0:
|
28
28
|
app_version:
|
29
29
|
unsetted: Não especificada
|
30
|
+
mailer:
|
31
|
+
info: 'Informações de e-mail'
|
32
|
+
send_submit: 'Enviar'
|
33
|
+
send_test: 'Envio de e-mail de teste'
|
34
|
+
send_test_successful: 'E-mail enviado para %{address}'
|
30
35
|
main_menu:
|
31
36
|
admin:
|
32
37
|
aranha: Aranha
|
33
38
|
br_railties: BrRailties
|
39
|
+
mailer: E-mail
|
34
40
|
eac_users_support: Usuários
|
35
41
|
tasks_scheduler: Agendador
|
data/config/routes.rb
CHANGED
@@ -7,4 +7,15 @@ Rails.application.routes.draw do
|
|
7
7
|
mount ::EacUsersSupport::Engine => '/'
|
8
8
|
mount ::Aranha::Engine => '/aranha'
|
9
9
|
mount ::BrRailties::Engine => '/br_railties'
|
10
|
+
|
11
|
+
namespace(:eac_rails_base0) do
|
12
|
+
resources(:mailer, only: []) do
|
13
|
+
collection do
|
14
|
+
get :info
|
15
|
+
get :send_test
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
post '/eac_rails_base0/mailer/send_test', to: 'eac_rails_base0/mailer#send_test_submit'
|
10
21
|
end
|
@@ -17,6 +17,11 @@ module EacRailsBase0
|
|
17
17
|
map_controller 'BrRailties::Municipalities', :manage, ::BrRailties::Municipality
|
18
18
|
map_controller 'ScheduledTasks', :manage, ::ScheduledTask
|
19
19
|
map_controller 'TasksSchedulerDaemon', :manage, ::ScheduledTask
|
20
|
+
map_eac_rails_base0
|
21
|
+
end
|
22
|
+
|
23
|
+
def map_eac_rails_base0
|
24
|
+
map_controller 'EacRailsBase0::Mailer', :manage, :eac_rails_base0_mailer
|
20
25
|
end
|
21
26
|
end
|
22
27
|
end
|
@@ -10,6 +10,12 @@ Bundler.require(*Rails.groups)
|
|
10
10
|
module EacRailsBase0App
|
11
11
|
class Application < Rails::Application
|
12
12
|
class << self
|
13
|
+
def new_stdout_logger
|
14
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
15
|
+
logger.formatter = config.log_formatter
|
16
|
+
::ActiveSupport::TaggedLogging.new(logger)
|
17
|
+
end
|
18
|
+
|
13
19
|
def setup(*args)
|
14
20
|
args.each { |a| send("setup_#{a}") }
|
15
21
|
end
|
@@ -6,8 +6,7 @@ module EacRailsBase0App
|
|
6
6
|
class Application < Rails::Application
|
7
7
|
module All
|
8
8
|
common_concern do
|
9
|
-
setup('
|
10
|
-
'loggers')
|
9
|
+
setup('assets_cache', 'dependencies', 'localization', 'load_paths', 'loggers')
|
11
10
|
end
|
12
11
|
|
13
12
|
module ClassMethods
|
@@ -45,12 +44,6 @@ module EacRailsBase0App
|
|
45
44
|
config.autoload_paths << Rails.root.join('lib')
|
46
45
|
end
|
47
46
|
|
48
|
-
def setup_local_configuration
|
49
|
-
local_configuration = ::File.join(rails_root(APP_PATH), 'config',
|
50
|
-
'local_configuration.rb')
|
51
|
-
require local_configuration if File.exist?(local_configuration)
|
52
|
-
end
|
53
|
-
|
54
47
|
def setup_localization
|
55
48
|
config.i18n.default_locale = :'pt-BR'
|
56
49
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/yaml'
|
5
|
+
|
6
|
+
module EacRailsBase0App
|
7
|
+
class Application < Rails::Application
|
8
|
+
module Envvars
|
9
|
+
ENVVARS_FILE_BASENAME = 'envvars'
|
10
|
+
ENVVARS_DIRECTORY_NAME = "#{ENVVARS_FILE_BASENAME}.d"
|
11
|
+
ENVVARS_FILE_EXTENSIONS = %w[.yml .yaml].freeze
|
12
|
+
|
13
|
+
common_concern do
|
14
|
+
setup('envvars')
|
15
|
+
end
|
16
|
+
|
17
|
+
module ClassMethods
|
18
|
+
def config_root
|
19
|
+
::Rails.root.join('config')
|
20
|
+
end
|
21
|
+
|
22
|
+
def envvars_files
|
23
|
+
ENVVARS_FILE_EXTENSIONS.flat_map do |extension|
|
24
|
+
[config_root.join("#{ENVVARS_FILE_BASENAME}#{extension}")] +
|
25
|
+
config_root.join(ENVVARS_DIRECTORY_NAME).glob("*#{extension}")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def load_envvars_file(path)
|
30
|
+
return unless path.exist?
|
31
|
+
|
32
|
+
vars = ::EacRubyUtils::Yaml.load(path.read)
|
33
|
+
raise "\"#{path}\" does not contain a Hash" unless vars.is_a?(::Hash)
|
34
|
+
|
35
|
+
vars.each { |name, value| ENV[name.to_s] = value }
|
36
|
+
end
|
37
|
+
|
38
|
+
def setup_envvars
|
39
|
+
envvars_files.each { |path| load_envvars_file(path) }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -33,11 +33,7 @@ module EacRailsBase0App
|
|
33
33
|
config.log_tags = [:request_id]
|
34
34
|
config.active_support.deprecation = :notify
|
35
35
|
config.log_formatter = ::Logger::Formatter.new
|
36
|
-
|
37
|
-
|
38
|
-
logger = ActiveSupport::Logger.new(STDOUT)
|
39
|
-
logger.formatter = config.log_formatter
|
40
|
-
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
36
|
+
config.logger = new_stdout_logger if ENV['RAILS_LOG_TO_STDOUT'].blank?
|
41
37
|
end
|
42
38
|
|
43
39
|
def setup_public_file_server
|
@@ -5,10 +5,16 @@ require 'eac_ruby_utils/core_ext'
|
|
5
5
|
module EacRailsBase0App
|
6
6
|
class Application < Rails::Application
|
7
7
|
module Test
|
8
|
+
ACTION_MAILER_CONFIGS = {
|
9
|
+
delivery_method: :test,
|
10
|
+
default_url_options: { host: 'localhost', port: 3000 },
|
11
|
+
default_options: { from: 'myadddress@example.net', reply_to: '' }
|
12
|
+
}.freeze
|
13
|
+
|
8
14
|
common_concern do
|
9
15
|
next unless ::Rails.env.test?
|
10
16
|
|
11
|
-
setup('action_controller', 'general', 'log', 'public_file_server')
|
17
|
+
setup('action_controller', 'action_mailer', 'general', 'log', 'public_file_server')
|
12
18
|
end
|
13
19
|
|
14
20
|
module ClassMethods
|
@@ -17,6 +23,12 @@ module EacRailsBase0App
|
|
17
23
|
config.action_controller.allow_forgery_protection = false
|
18
24
|
end
|
19
25
|
|
26
|
+
def setup_action_mailer
|
27
|
+
ACTION_MAILER_CONFIGS.each do |key, value|
|
28
|
+
config.action_mailer.send("#{key}=", value)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
20
32
|
def setup_general
|
21
33
|
config.cache_classes = true
|
22
34
|
config.eager_load = false
|
@@ -24,7 +36,6 @@ module EacRailsBase0App
|
|
24
36
|
config.consider_all_requests_local = true
|
25
37
|
config.action_controller.perform_caching = false
|
26
38
|
config.action_dispatch.show_exceptions = false
|
27
|
-
config.action_mailer.delivery_method = :test
|
28
39
|
end
|
29
40
|
|
30
41
|
def setup_log
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_rails_base0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.49.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_scaffold
|
@@ -577,10 +577,16 @@ files:
|
|
577
577
|
- app/assets/stylesheets/eac_rails_base0/components.scss
|
578
578
|
- app/assets/stylesheets/eac_rails_base0/default_configuration.scss
|
579
579
|
- app/controllers/eac_rails_base0/application_controller.rb
|
580
|
+
- app/controllers/eac_rails_base0/mailer_controller.rb
|
580
581
|
- app/helpers/eac_rails_base0/app_version_helper.rb
|
581
582
|
- app/helpers/eac_rails_base0/layout_helper.rb
|
583
|
+
- app/helpers/eac_rails_base0/main_menu_helper.rb
|
582
584
|
- app/helpers/eac_rails_base0/panel_default_helper.rb
|
585
|
+
- app/helpers/eac_rails_base0/user_menu_helper.rb
|
586
|
+
- app/mailers/eac_rails_base0/application_mailer.rb
|
587
|
+
- app/mailers/eac_rails_base0/send_test_mailer.rb
|
583
588
|
- app/models/eac_rails_base0/application_record.rb
|
589
|
+
- app/tableless_models/eac_rails_base0/email_send_test.rb
|
584
590
|
- app/uploaders/eac_rails_base0/default_file_uploader.rb
|
585
591
|
- app/views/devise/confirmations/new.html.erb
|
586
592
|
- app/views/devise/mailer/confirmation_instructions.html.erb
|
@@ -591,6 +597,9 @@ files:
|
|
591
597
|
- app/views/devise/registrations/new.html.erb
|
592
598
|
- app/views/devise/sessions/new.html.erb
|
593
599
|
- app/views/devise/shared/_links.html.erb
|
600
|
+
- app/views/eac_rails_base0/mailer/info.html.erb
|
601
|
+
- app/views/eac_rails_base0/mailer/send_test.html.erb
|
602
|
+
- app/views/eac_rails_base0/send_test_mailer/main.html.erb
|
594
603
|
- app/views/layouts/eac_rails_base0/_flash.html.erb
|
595
604
|
- app/views/layouts/eac_rails_base0/_main_menu.html.erb
|
596
605
|
- app/views/layouts/eac_rails_base0/_navbar_user.html.erb
|
@@ -609,6 +618,7 @@ files:
|
|
609
618
|
- config/initializers/patches.rb
|
610
619
|
- config/initializers/session_store.rb
|
611
620
|
- config/initializers/wrap_parameters.rb
|
621
|
+
- config/locales/en.yml
|
612
622
|
- config/locales/pt-BR.yml
|
613
623
|
- config/routes.rb
|
614
624
|
- exe/eac_rails_base0_app
|
@@ -618,6 +628,7 @@ files:
|
|
618
628
|
- lib/eac_rails_base0/app_base/application.rb
|
619
629
|
- lib/eac_rails_base0/app_base/application/all.rb
|
620
630
|
- lib/eac_rails_base0/app_base/application/development.rb
|
631
|
+
- lib/eac_rails_base0/app_base/application/envvars.rb
|
621
632
|
- lib/eac_rails_base0/app_base/application/production.rb
|
622
633
|
- lib/eac_rails_base0/app_base/application/test.rb
|
623
634
|
- lib/eac_rails_base0/app_generator/builder.rb
|