eac_rails_base0 0.27.0 → 0.28.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: 9b04562087cf17fd2fbadacf3072f473ca4581afbb266e32c6b2d3ddbffd10f5
4
- data.tar.gz: 67fea7db74cab7512d577a33ef558306c51fba7df4bff6abce7d230858e3ba57
3
+ metadata.gz: f2acf7ad0d84b117972598b3b27b5c3342e4f8e3d60c2b0f550bb8abbb11ee45
4
+ data.tar.gz: 4f5998bde902fc4b6c7e72e81b6ca34874bb090bb5c6e6474431d41b0a449bf5
5
5
  SHA512:
6
- metadata.gz: 8863e1a271ed526f86c6851c9a73bc9478c8ae6381daba4632d2b5a4da2dff5a9f01d391dbce5aae230c89beff83a8717f9377257c6b841df3e0886f6549ec48
7
- data.tar.gz: ac15db8daaaa56f7be9224ed251271a2f89013c4d836be4f6d10b6f735c3f61c926199ea8599102be862ad1c1bb226cc34df065bf4559386c2fd0bf125d85d3a
6
+ metadata.gz: 4fd63ff500a31045c81d606773b12e652965f0e367f4d17c4e6d2ba03cc2b6e93d1a70e8306c8a21b146a6d106bc3051a010b5a1ab3157a345dd8622c87bb805
7
+ data.tar.gz: 032e13d0dd88eaf17c563251b20773c9183ae7a783763f6604d8e59a32347fa579c8210f8c289425f003a86a1e1bdd7917689172c1de4b29d32a6c2079f761dd
@@ -5,8 +5,9 @@ module EacRailsBase0
5
5
  include ::CanCanDry::ControllerAuthorization
6
6
 
7
7
  layout 'eac_rails_base0/application'
8
- helper ::EacRailsBase0::LinksHelper
9
8
  helper ::EacRailsBase0::LayoutHelper
9
+ helper ::EacRailsUtils::FormatterHelper
10
+ helper ::EacRailsUtils::LinksHelper
10
11
  helper ::EacRailsUtils::OpenGraphProtocolHelper
11
12
 
12
13
  # Prevent CSRF attacks by raising an exception.
@@ -0,0 +1,2 @@
1
+ # frozen_string_literal: true
2
+ require_dependency 'eac_rails_base0/patches/eac_rails_utils_links_helper_patch'
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacRailsBase0
4
+ module Patches
5
+ module EacRailsUtilsLinksHelper
6
+ class << self
7
+ def included(base)
8
+ base.include(InstanceMethods)
9
+ base.alias_method_chain :short_object_link, :base0
10
+ base.alias_method_chain :object_path_by_class, :base0
11
+ end
12
+ end
13
+
14
+ module InstanceMethods
15
+ def short_object_link_with_base0(object, action = nil, options = {})
16
+ value_or_sign(object, '') do |value|
17
+ path = object_path(value, action)
18
+ if can_by_path?(path, options[:method])
19
+ link_to '', url_for(path), options
20
+ end
21
+ end
22
+ end
23
+
24
+ def object_path_by_class_with_base0(*args)
25
+ object_path_by_class_without_base0(*args).gsub(/_url\z/, '_path')
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+
32
+ require_dependency 'eac_rails_utils/links_helper'
33
+ patch = ::EacRailsBase0::Patches::EacRailsUtilsLinksHelper
34
+ target = ::EacRailsUtils::LinksHelper
35
+ target.send(:include, patch) unless target.included_modules.include?(patch)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsBase0
4
- VERSION = '0.27.0'
4
+ VERSION = '0.28.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.27.0
4
+ version: 0.28.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: 2019-12-09 00:00:00.000000000 Z
11
+ date: 2019-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.12'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.12.1
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.12'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.12.1
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bootstrap-sass
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -140,14 +146,14 @@ dependencies:
140
146
  requirements:
141
147
  - - "~>"
142
148
  - !ruby/object:Gem::Version
143
- version: '0.6'
149
+ version: '0.7'
144
150
  type: :runtime
145
151
  prerelease: false
146
152
  version_requirements: !ruby/object:Gem::Requirement
147
153
  requirements:
148
154
  - - "~>"
149
155
  - !ruby/object:Gem::Version
150
- version: '0.6'
156
+ version: '0.7'
151
157
  - !ruby/object:Gem::Dependency
152
158
  name: eac_users_support
153
159
  requirement: !ruby/object:Gem::Requirement
@@ -448,7 +454,6 @@ files:
448
454
  - app/assets/stylesheets/eac_rails_base0/default_configuration.scss
449
455
  - app/controllers/eac_rails_base0/application_controller.rb
450
456
  - app/helpers/eac_rails_base0/layout_helper.rb
451
- - app/helpers/eac_rails_base0/links_helper.rb
452
457
  - app/uploaders/eac_rails_base0/default_file_uploader.rb
453
458
  - app/views/layouts/eac_rails_base0/_flash.html.erb
454
459
  - app/views/layouts/eac_rails_base0/_main_menu.html.erb
@@ -464,6 +469,7 @@ files:
464
469
  - config/initializers/cookies_serializer.rb
465
470
  - config/initializers/filter_parameter_logging.rb
466
471
  - config/initializers/mime_types.rb
472
+ - config/initializers/patches.rb
467
473
  - config/initializers/pg_deprecated_constants.rb
468
474
  - config/initializers/session_store.rb
469
475
  - config/initializers/wrap_parameters.rb
@@ -499,6 +505,7 @@ files:
499
505
  - lib/eac_rails_base0/app_generator/templates/lib/local_plugins.rb
500
506
  - lib/eac_rails_base0/boolean_value.rb
501
507
  - lib/eac_rails_base0/engine.rb
508
+ - lib/eac_rails_base0/patches/eac_rails_utils_links_helper_patch.rb
502
509
  - lib/eac_rails_base0/patches/url_for_patch.rb
503
510
  - lib/eac_rails_base0/spec_helper.rb
504
511
  - lib/eac_rails_base0/spec_helper/capybara.rb
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
- module EacRailsBase0
3
- module LinksHelper
4
- def short_delete_link(object)
5
- value_or_sign(object, '') do |value|
6
- link_to '', object_path(value),
7
- class: 'delete_link', method: :delete, target: '_blank',
8
- title: ::I18n.t('eac_rails_base0.links.delete_object', label: value.to_s),
9
- data: {
10
- confirm: ::I18n.t('eac_rails_base0.links.delete_confirm', label: value.to_s)
11
- }
12
- end
13
- end
14
-
15
- def short_edit_link(object)
16
- value_or_sign(object, '') do |value|
17
- link_to '', object_path(value, 'edit'),
18
- class: 'edit_link', target: '_blank',
19
- title: ::I18n.t('eac_rails_base0.links.edit_object', label: value.to_s)
20
- end
21
- end
22
-
23
- def short_goto_link(url)
24
- value_or_sign(url, '') do |value|
25
- link_to '', value, class: 'goto_link', target: '_blank',
26
- title: ::I18n.t('eac_rails_base0.links.goto_url', url: value.to_s)
27
- end
28
- end
29
-
30
- def short_show_link(object)
31
- short_detail_show_link(object, false)
32
- end
33
-
34
- def short_detail_link(object)
35
- short_detail_show_link(object, true)
36
- end
37
-
38
- def object_path(object, action = nil)
39
- path = "#{object.class.name.underscore.tr('/', '_')}_url"
40
- path = "#{action}_#{path}" if action.present?
41
- send(path, object)
42
- end
43
-
44
- private
45
-
46
- def short_detail_show_link(object, detail)
47
- value_or_sign(object, detail ? 'detail' : nil) do |value|
48
- link_to '', object_path(value),
49
- class: 'show_link', target: '_blank',
50
- title: ::I18n.t('eac_rails_base0.links.show_object', label: value.to_s)
51
- end
52
- end
53
- end
54
- end