eac_rails_base0 0.55.1 → 0.57.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad9290b446a74d62472aaf6d448743c9de7c1743f3157c1a9a7e2319fdd46aab
4
- data.tar.gz: 00a14db5781301dcfc9f3f3eada9b9039bbc46f85692f0b8900869fd60bdaae2
3
+ metadata.gz: 61f213dfc10aec44404ae01fc154094fa40c97ec416a13031e868108c2bd8233
4
+ data.tar.gz: acb891c064862f4f8f23056c122c5549ed63e1cca1e58249f2dd901b99f75cc1
5
5
  SHA512:
6
- metadata.gz: bafd77b3e09259c80e1bdc7a9c96a6abe733aff1213b51542355bd5ef90afb1a6843863b186b47931b19fa9e3cbe3ea794825f3f853623140982f780b2dcfb6f
7
- data.tar.gz: af1b3da3b781ec17b939494ba1215e4f2aaad0f869d826373e0b71d33cbb5b8d2a9d103e47b558be51185f3851e3e3d2140a90733e77d6aa5f3fc0cd9f0b7425
6
+ metadata.gz: 20f971988df3294600fbdf6af5a9338171373f2e756645b0e19f3e9fdcd98106584a1f035860333dd99734d2f62b51b4b51e7b3feba3751a3471c5a063d5525f
7
+ data.tar.gz: 56bfc744890711f33c22b9b66e7ad41ba644b7f3a35e0406b5a8afa666264deea1babf8d86724079d87a7b574ffffbaf7f858adc71845ccfb1b8756af9723296
@@ -8,3 +8,4 @@
8
8
  //= require aranha/application
9
9
  //= require tasks_scheduler
10
10
  //= require br_railties
11
+ //= require eac_active_scaffold
@@ -4,6 +4,7 @@
4
4
  @import "aranha/application";
5
5
  @import "tasks_scheduler";
6
6
  @import 'br_railties';
7
+ @import 'eac_active_scaffold';
7
8
  @import 'jquery-ui';
8
9
  @import 'eac_rails_base0/default_configuration';
9
10
  @import 'eac_rails_base0/components';
@@ -11,6 +11,7 @@ module EacRailsBase0
11
11
  helper ::EacRailsUtils::FormatterHelper
12
12
  helper ::EacRailsUtils::LinksHelper
13
13
  helper ::EacRailsUtils::OpenGraphProtocolHelper
14
+ helper ::EacRailsBase0::PanelDefaultHelper
14
15
  helper ::EacRailsBase0::UserMenuHelper
15
16
 
16
17
  # Prevent CSRF attacks by raising an exception.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ActiveScaffold.set_defaults do |conf|
3
+ ::ActiveScaffold.defaults do |conf|
4
4
  conf.list.per_page = 100
5
5
  conf.security.default_permission = false
6
6
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'devise'
4
+
5
+ # Use this hook to configure devise mailer, warden hooks and so forth.
6
+ # Many of these configuration options can be set straight in your model.
7
+ Devise.setup do |config|
8
+ #
9
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
10
+ # so you need to do it manually. For the users scope, it would be:
11
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
12
+
13
+ # config.parent_controller = 'EacRailsBase0::ApplicationController'
14
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'premailer'
4
+
5
+ class Premailer
6
+ class << self
7
+ alias old_is_media_query? is_media_query?
8
+
9
+ def is_media_query?(media_types) # rubocop:disable Naming/PredicateName
10
+ media_types.include?(:print) || old_is_media_query?(media_types)
11
+ end
12
+ end
13
+ end
14
+
15
+ require 'premailer/rails'
16
+ ::Premailer::Rails.config.merge!(remove_classes: true, remove_ids: true,
17
+ drop_unmergeable_css_rules: true)
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_active_scaffold'
3
4
  require 'active_scaffold/bridges/cancan/cancan_bridge'
4
5
 
5
6
  module EacRailsBase0
@@ -6,8 +6,8 @@ module EacRailsBase0App
6
6
  class Application < Rails::Application
7
7
  module All
8
8
  common_concern do
9
- setup('app_root', 'assets_cache', 'dependencies', 'defaults', 'localization', 'load_paths',
10
- 'loggers')
9
+ setup('app_root', 'active_record', 'assets_cache', 'dependencies', 'defaults',
10
+ 'localization', 'load_paths', 'loggers')
11
11
  end
12
12
 
13
13
  module ClassMethods
@@ -21,6 +21,10 @@ module EacRailsBase0App
21
21
  config.root = find_root(APP_PATH)
22
22
  end
23
23
 
24
+ def setup_active_record
25
+ config.active_record.sqlite3.represent_boolean_as_integer = true
26
+ end
27
+
24
28
  def setup_assets_cache
25
29
  config.assets.configure do |env|
26
30
  env.cache = Sprockets::Cache::FileStore.new(
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'aranha/rails/engine'
4
4
  require 'br_railties/engine'
5
+ require 'eac_active_scaffold/engine'
5
6
  require 'eac_rails_utils/engine'
6
7
  require 'eac_users_support/engine'
7
8
 
@@ -46,68 +46,16 @@ module EacRailsBase0
46
46
  end
47
47
  end
48
48
 
49
- def setup_admin_example # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
50
- ::RSpec.shared_context 'when user is admin', shared_context: :metadata do
51
- let(:user) { ::FactoryBot.create(:admin_user) }
52
-
53
- before do
54
- visit '/users/sign_in'
55
- fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
56
- with: user.email
57
- fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
58
- with: user.password
59
- click_button ::I18n.translate!('devise.log_in')
60
- end
61
-
62
- it 'user should be logged' do
63
- expect(page).to have_content user.email
64
- expect(::EacUsersSupport::User.current_user).not_to be_nil
65
- end
66
- end
49
+ def setup_admin_example
50
+ require 'eac_rails_base0/rspec/shared_contexts/when_user_is_admin'
67
51
  end
68
52
 
69
- def setup_non_admin_example # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
70
- ::RSpec.shared_context 'when user is non admin', shared_context: :metadata do
71
- let(:user) { ::FactoryBot.create(:non_admin_user) }
72
-
73
- before do
74
- visit '/users/sign_in'
75
- fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
76
- with: user.email
77
- fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
78
- with: user.password
79
- click_button ::I18n.translate!('devise.log_in')
80
- end
81
-
82
- it 'user should be logged' do
83
- expect(page).to have_content user.email
84
- expect(::EacUsersSupport::User.current_user).not_to be_nil
85
- end
86
- end
53
+ def setup_non_admin_example
54
+ require 'eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin'
87
55
  end
88
56
 
89
- def setup_anonymous_example # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
90
- ::RSpec.shared_context 'when user is anonymous', shared_context: :metadata do
91
- before do
92
- visit '/'
93
- if link_exist?(::I18n.translate!('devise.log_out'))
94
- click_link(::I18n.translate!('devise.log_out'))
95
- elsif !link_exist?(::I18n.translate!('devise.log_in'))
96
- raise 'login nor logout link found'
97
- end
98
- end
99
-
100
- it 'user should be not logged' do
101
- expect(::EacUsersSupport::User.current_user).to be_nil
102
- end
103
-
104
- def link_exist?(locator) # rubocop:disable Lint/NestedMethodDefinition
105
- find_link(locator)
106
- true
107
- rescue Capybara::ElementNotFound
108
- false
109
- end
110
- end
57
+ def setup_anonymous_example
58
+ require 'eac_rails_base0/rspec/shared_contexts/when_user_is_anonymous'
111
59
  end
112
60
  end
113
61
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::RSpec.shared_context 'when user is admin', shared_context: :metadata do
4
+ let(:user) { ::FactoryBot.create(:admin_user) }
5
+
6
+ before do
7
+ visit '/users/sign_in'
8
+ fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
9
+ with: user.email
10
+ fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
11
+ with: user.password
12
+ click_button ::I18n.translate!('devise.log_in')
13
+ end
14
+
15
+ it 'user should be logged' do
16
+ expect(page).to have_content user.email
17
+ end
18
+
19
+ it 'should be a link to logout' do
20
+ expect(page).to have_link(nil, href: '/users/sign_out')
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::RSpec.shared_context 'when user is anonymous', shared_context: :metadata do
4
+ before do
5
+ visit '/'
6
+ if link_exist?(::I18n.translate!('devise.log_out'))
7
+ click_link(::I18n.translate!('devise.log_out'))
8
+ elsif !link_exist?(::I18n.translate!('devise.log_in'))
9
+ raise 'login nor logout link found'
10
+ end
11
+ end
12
+
13
+ it 'should be a link to log in' do
14
+ expect(page).to have_link(nil, href: '/users/sign_in')
15
+ end
16
+
17
+ def link_exist?(locator)
18
+ find_link(locator)
19
+ true
20
+ rescue Capybara::ElementNotFound
21
+ false
22
+ end
23
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::RSpec.shared_context 'when user is non admin', shared_context: :metadata do
4
+ let(:user) { ::FactoryBot.create(:non_admin_user) }
5
+
6
+ before do
7
+ visit '/users/sign_in'
8
+ fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
9
+ with: user.email
10
+ fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
11
+ with: user.password
12
+ click_button ::I18n.translate!('devise.log_in')
13
+ end
14
+
15
+ it 'user should be logged' do
16
+ expect(page).to have_content user.email
17
+ end
18
+
19
+ it 'should be a link to logout' do
20
+ expect(page).to have_link(nil, href: '/users/sign_out')
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsBase0
4
- VERSION = '0.55.1'
4
+ VERSION = '0.57.0'
5
5
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.55.1
4
+ version: 0.57.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: 2021-09-01 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: active_scaffold
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 3.5.5
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 3.5.5
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: aranha-parsers
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -140,6 +126,20 @@ dependencies:
140
126
  - - ">="
141
127
  - !ruby/object:Gem::Version
142
128
  version: 4.2.2
129
+ - !ruby/object:Gem::Dependency
130
+ name: eac_active_scaffold
131
+ requirement: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - "~>"
134
+ - !ruby/object:Gem::Version
135
+ version: '0.2'
136
+ type: :runtime
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - "~>"
141
+ - !ruby/object:Gem::Version
142
+ version: '0.2'
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: eac_cli
145
145
  requirement: !ruby/object:Gem::Requirement
@@ -217,7 +217,7 @@ dependencies:
217
217
  version: '0.9'
218
218
  - - ">="
219
219
  - !ruby/object:Gem::Version
220
- version: 0.9.3
220
+ version: 0.9.6
221
221
  type: :runtime
222
222
  prerelease: false
223
223
  version_requirements: !ruby/object:Gem::Requirement
@@ -227,7 +227,7 @@ dependencies:
227
227
  version: '0.9'
228
228
  - - ">="
229
229
  - !ruby/object:Gem::Version
230
- version: 0.9.3
230
+ version: 0.9.6
231
231
  - !ruby/object:Gem::Dependency
232
232
  name: fog-aws
233
233
  requirement: !ruby/object:Gem::Requirement
@@ -332,6 +332,20 @@ dependencies:
332
332
  - - ">="
333
333
  - !ruby/object:Gem::Version
334
334
  version: '0'
335
+ - !ruby/object:Gem::Dependency
336
+ name: premailer-rails
337
+ requirement: !ruby/object:Gem::Requirement
338
+ requirements:
339
+ - - ">="
340
+ - !ruby/object:Gem::Version
341
+ version: '0'
342
+ type: :runtime
343
+ prerelease: false
344
+ version_requirements: !ruby/object:Gem::Requirement
345
+ requirements:
346
+ - - ">="
347
+ - !ruby/object:Gem::Version
348
+ version: '0'
335
349
  - !ruby/object:Gem::Dependency
336
350
  name: puma
337
351
  requirement: !ruby/object:Gem::Requirement
@@ -352,28 +366,28 @@ dependencies:
352
366
  requirements:
353
367
  - - "~>"
354
368
  - !ruby/object:Gem::Version
355
- version: 5.1.7
369
+ version: 5.2.6
356
370
  type: :runtime
357
371
  prerelease: false
358
372
  version_requirements: !ruby/object:Gem::Requirement
359
373
  requirements:
360
374
  - - "~>"
361
375
  - !ruby/object:Gem::Version
362
- version: 5.1.7
376
+ version: 5.2.6
363
377
  - !ruby/object:Gem::Dependency
364
378
  name: rails-i18n
365
379
  requirement: !ruby/object:Gem::Requirement
366
380
  requirements:
367
- - - "~>"
381
+ - - ">="
368
382
  - !ruby/object:Gem::Version
369
- version: '4.0'
383
+ version: '0'
370
384
  type: :runtime
371
385
  prerelease: false
372
386
  version_requirements: !ruby/object:Gem::Requirement
373
387
  requirements:
374
- - - "~>"
388
+ - - ">="
375
389
  - !ruby/object:Gem::Version
376
- version: '4.0'
390
+ version: '0'
377
391
  - !ruby/object:Gem::Dependency
378
392
  name: recordselect
379
393
  requirement: !ruby/object:Gem::Requirement
@@ -506,14 +520,14 @@ dependencies:
506
520
  requirements:
507
521
  - - "~>"
508
522
  - !ruby/object:Gem::Version
509
- version: '0.3'
523
+ version: '0.4'
510
524
  type: :development
511
525
  prerelease: false
512
526
  version_requirements: !ruby/object:Gem::Requirement
513
527
  requirements:
514
528
  - - "~>"
515
529
  - !ruby/object:Gem::Version
516
- version: '0.3'
530
+ version: '0.4'
517
531
  description:
518
532
  email:
519
533
  executables:
@@ -565,9 +579,11 @@ files:
565
579
  - config/initializers/backtrace_silencers.rb
566
580
  - config/initializers/carrier_wave.rb
567
581
  - config/initializers/cookies_serializer.rb
582
+ - config/initializers/devise.rb
568
583
  - config/initializers/filter_parameter_logging.rb
569
584
  - config/initializers/mime_types.rb
570
585
  - config/initializers/patches.rb
586
+ - config/initializers/premailer.rb
571
587
  - config/initializers/session_store.rb
572
588
  - config/initializers/speaker.rb
573
589
  - config/initializers/wrap_parameters.rb
@@ -614,6 +630,9 @@ files:
614
630
  - lib/eac_rails_base0/patches/url_for_patch.rb
615
631
  - lib/eac_rails_base0/rspec.rb
616
632
  - lib/eac_rails_base0/rspec/setup.rb
633
+ - lib/eac_rails_base0/rspec/shared_contexts/when_user_is_admin.rb
634
+ - lib/eac_rails_base0/rspec/shared_contexts/when_user_is_anonymous.rb
635
+ - lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
617
636
  - lib/eac_rails_base0/version.rb
618
637
  - lib/eac_rails_base0/x_engine.rb
619
638
  - lib/fog.rb