eac_rails_base0 0.43.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 498eff900a0951c0c73c628587259bf44efce02c0ceb06674cfac71d0ee85edd
4
- data.tar.gz: bdc5d5287a5ac57b5d3333132d86d27c0544a60cd53ec3817c554a6c0d242ed1
3
+ metadata.gz: dccf7c6042fface06b7406b0e890d50ceaac2e19283e6c99b1e2a7e5c7f26f62
4
+ data.tar.gz: 7ff5888516a0df463b8f7fe0f329913b4e7d18d6632ee707ccfcf243a35c8416
5
5
  SHA512:
6
- metadata.gz: a86077e990517c0bf8d270e64698208684cbd1b7c6236e671e8ad5e91925b9492124e307c0b0c0a1a66a0be41d5f8c9af88b2de47e3b7f62e0bb767390e0abc6
7
- data.tar.gz: 2bf780632d6c81d556c3ab76f4b1c1aa82d9545015e393c6e5dc21b20dfbcbc660be3225f12be641704484c4aa6b11fa9db5e251273cf58c04c986ee7e01a7f5
6
+ metadata.gz: 919b3dc8fbbf60f1b267bfbbe1a0080f5aa0ebc9b71e33400f3cf7d313e99be99ebd224ff098f9db58e9be4f81069683cd0ed4673b98774628c3730799cddf33
7
+ data.tar.gz: 2d8dda5b4f8a53d586f8e7d4659586a8b01a47fce86d8fcf6c58cab20acf0461f861e168444d19ee7ba885272dedb2462cc5b101ff1e62fdc25ecfb8ce0011c6
@@ -1,65 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_ruby_utils/core_ext'
3
4
  require 'rails/all'
4
5
 
5
6
  # Require the gems listed in Gemfile, including any gems
6
7
  # you've limited to :test, :development, or :production.
7
8
  Bundler.require(*Rails.groups)
8
9
 
9
- def rails_root(dir)
10
- return dir if ::File.exist?(::File.join(dir, 'config.ru'))
11
- raise 'config.ru not found in ascendent path' if dir == '/'
12
-
13
- rails_root(::File.dirname(dir))
14
- end
15
-
16
- local_configuration = ::File.join(rails_root(APP_PATH), 'config', 'local_configuration.rb')
17
- require local_configuration if File.exist?(local_configuration)
18
-
19
10
  module EacRailsBase0App
20
11
  class Application < Rails::Application
21
- # Settings in config/environments/* take precedence over those specified here.
22
- # Application configuration should go into files in config/initializers
23
- # -- all .rb files in that directory are automatically loaded.
24
-
25
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
- # config.time_zone = 'Central Time (US & Canada)'
28
-
29
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
- # config.i18n.default_locale = :de
32
- config.i18n.default_locale = :'pt-BR'
33
-
34
- # Do not swallow errors in after_commit/after_rollback callbacks.
35
- config.active_record.raise_in_transactional_callbacks = true if ::Rails.version < '5'
36
-
37
- # Autoload do código em /lib.
38
- config.autoload_paths << Rails.root.join('lib')
39
-
40
- config.after_initialize do
41
- ActiveRecord::Base.logger = nil
42
- end
43
-
44
- app_tmpdir = ::File.join(::Dir.tmpdir, ::Rails.root.to_path.parameterize, 'tmp')
45
-
46
- config.assets.configure do |env|
47
- env.cache = Sprockets::Cache::FileStore.new(
48
- ::File.join(app_tmpdir, 'cache', 'assets'),
49
- config.assets.cache_limit,
50
- env.logger
51
- )
12
+ class << self
13
+ def setup(*args)
14
+ args.each { |a| send("setup_#{a}") }
15
+ end
52
16
  end
53
17
 
54
- migrate_deprecated_dir = ::Rails.root.join('db', 'migrate_deprecated')
55
- config.paths['db/migrate'] << migrate_deprecated_dir if migrate_deprecated_dir.directory?
56
-
57
- if ::Rails.env.development?
58
- require 'letter_opener'
59
- config.action_mailer.delivery_method = :letter_opener
60
- config.action_mailer.perform_deliveries = true
61
- end
18
+ require_sub __FILE__, include_modules: true
62
19
  end
63
20
  end
64
-
65
- require 'carrierwave'
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacRailsBase0App
6
+ class Application < Rails::Application
7
+ module All
8
+ common_concern do
9
+ setup('local_configuration', 'assets_cache', 'dependencies', 'localization', 'load_paths',
10
+ 'loggers')
11
+ end
12
+
13
+ module ClassMethods
14
+ def app_temporary_directory
15
+ ::File.join(::Dir.tmpdir, ::Rails.root.to_path.parameterize, 'tmp')
16
+ end
17
+
18
+ def rails_root(dir)
19
+ return dir if ::File.exist?(::File.join(dir, 'config.ru'))
20
+ raise 'config.ru not found in ascendent path' if dir == '/'
21
+
22
+ rails_root(::File.dirname(dir))
23
+ end
24
+
25
+ def setup_assets_cache
26
+ config.assets.configure do |env|
27
+ env.cache = Sprockets::Cache::FileStore.new(
28
+ ::File.join(app_temporary_directory, 'cache', 'assets'),
29
+ config.assets.cache_limit,
30
+ env.logger
31
+ )
32
+ end
33
+ end
34
+
35
+ def setup_dependencies
36
+ require 'carrierwave'
37
+ end
38
+
39
+ def setup_deprecated_migrations
40
+ path = ::Rails.root.join('db', 'migrate_deprecated')
41
+ config.paths['db/migrate'] << path if path.directory?
42
+ end
43
+
44
+ def setup_load_paths
45
+ config.autoload_paths << Rails.root.join('lib')
46
+ end
47
+
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
+ def setup_localization
55
+ config.i18n.default_locale = :'pt-BR'
56
+ end
57
+
58
+ def setup_loggers
59
+ config.after_initialize do
60
+ ActiveRecord::Base.logger = nil
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacRailsBase0App
6
+ class Application < Rails::Application
7
+ module Development
8
+ common_concern do
9
+ next unless ::Rails.env.development?
10
+
11
+ setup('assets', 'general', 'log', 'letter_opener')
12
+ end
13
+
14
+ module ClassMethods
15
+ def setup_assets
16
+ config.assets.debug = true
17
+ config.assets.digest = true
18
+ config.assets.raise_runtime_errors = true
19
+ end
20
+
21
+ def setup_general
22
+ config.cache_classes = false
23
+ config.eager_load = false
24
+ config.consider_all_requests_local = true
25
+ config.action_controller.perform_caching = false
26
+ config.action_mailer.raise_delivery_errors = false
27
+
28
+ config.active_record.migration_error = :page_load
29
+ end
30
+
31
+ def setup_letter_opener
32
+ require 'letter_opener'
33
+ config.action_mailer.delivery_method = :letter_opener
34
+ config.action_mailer.perform_deliveries = true
35
+ end
36
+
37
+ def setup_log
38
+ config.active_support.deprecation = :log
39
+ config.logger = Logger.new(STDOUT)
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacRailsBase0App
6
+ class Application < Rails::Application
7
+ module Production
8
+ common_concern do
9
+ next unless ::Rails.env.production?
10
+
11
+ setup('assets', 'general', 'log')
12
+ end
13
+
14
+ module ClassMethods
15
+ def setup_assets
16
+ config.assets.js_compressor = :uglifier
17
+ config.assets.compile = false
18
+ config.assets.digest = true
19
+ end
20
+
21
+ def setup_general
22
+ config.cache_classes = true
23
+ config.eager_load = true
24
+ config.consider_all_requests_local = false
25
+ config.action_controller.perform_caching = true
26
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
27
+ config.i18n.fallbacks = true
28
+ config.active_record.dump_schema_after_migration = false
29
+ end
30
+
31
+ def setup_log
32
+ config.active_support.deprecation = :notify
33
+ config.log_level = :debug
34
+ config.log_formatter = ::Logger::Formatter.new
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacRailsBase0App
6
+ class Application < Rails::Application
7
+ module RailsBefore5
8
+ common_concern do
9
+ next unless ::Rails.version < '5'
10
+
11
+ config.active_record.raise_in_transactional_callbacks = true
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacRailsBase0App
6
+ class Application < Rails::Application
7
+ module Test
8
+ common_concern do
9
+ next unless ::Rails.env.test?
10
+
11
+ setup('action_controller', 'general', 'log')
12
+ end
13
+
14
+ module ClassMethods
15
+ def setup_action_controller
16
+ config.action_controller.perform_caching = false
17
+ config.action_controller.allow_forgery_protection = false
18
+ end
19
+
20
+ def setup_general
21
+ config.cache_classes = true
22
+ config.eager_load = false
23
+ config.serve_static_files = true
24
+ config.static_cache_control = 'public, max-age=3600'
25
+ config.consider_all_requests_local = true
26
+ config.action_dispatch.show_exceptions = false
27
+ config.action_mailer.delivery_method = :test
28
+ config.active_support.test_order = :random
29
+ end
30
+
31
+ def setup_log
32
+ config.active_support.deprecation = :stderr
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -26,7 +26,7 @@ module EacRailsBase0
26
26
  end
27
27
 
28
28
  def db
29
- # Do nothing
29
+ directory 'db'
30
30
  end
31
31
 
32
32
  def lib
@@ -0,0 +1,23 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ <% if sqlite3? -%>
11
+ # Ignore the default SQLite database.
12
+ /db/*.sqlite3
13
+ /db/*.sqlite3-journal
14
+
15
+ <% end -%>
16
+ # Ignore all logfiles and tempfiles.
17
+ /log/*
18
+ !/log/.keep
19
+ /tmp
20
+
21
+ # Configuration files
22
+ config/database.y*ml
23
+ config/local_configuration.rb
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsBase0
4
- VERSION = '0.43.0'
4
+ VERSION = '0.44.0'
5
5
  end
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.43.0
4
+ version: 0.44.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-03 00:00:00.000000000 Z
11
+ date: 2020-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_scaffold
@@ -603,6 +603,11 @@ files:
603
603
  - lib/eac_rails_base0/app_base/ability.rb
604
604
  - lib/eac_rails_base0/app_base/ability_mapping.rb
605
605
  - lib/eac_rails_base0/app_base/application.rb
606
+ - lib/eac_rails_base0/app_base/application/all.rb
607
+ - lib/eac_rails_base0/app_base/application/development.rb
608
+ - lib/eac_rails_base0/app_base/application/production.rb
609
+ - lib/eac_rails_base0/app_base/application/rails_before_5.rb
610
+ - lib/eac_rails_base0/app_base/application/test.rb
606
611
  - lib/eac_rails_base0/app_generator/builder.rb
607
612
  - lib/eac_rails_base0/app_generator/generator.rb
608
613
  - lib/eac_rails_base0/app_generator/templates/Gemfile
@@ -625,6 +630,7 @@ files:
625
630
  - lib/eac_rails_base0/app_generator/templates/config/environments/production.rb
626
631
  - lib/eac_rails_base0/app_generator/templates/config/environments/test.rb
627
632
  - lib/eac_rails_base0/app_generator/templates/config/routes.rb
633
+ - lib/eac_rails_base0/app_generator/templates/gitignore
628
634
  - lib/eac_rails_base0/app_generator/templates/lib/local_plugins.rb
629
635
  - lib/eac_rails_base0/boolean_value.rb
630
636
  - lib/eac_rails_base0/engine.rb