eac_rails_base0 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eac_rails_base0.rb +1 -0
- data/lib/eac_rails_base0/patches/url_for_patch.rb +42 -0
- data/lib/eac_rails_base0/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61de5368e79c0b904b83f5b55905d0e94ff98399cc85bcb0794b2397aef7638d
|
4
|
+
data.tar.gz: c78e218f39fa33d7de14ef012b4dc2531565eea46083aad83bf5207e4ae5b9b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a6b8f468093d3fc72eea043ffb1d7e9f647be9b2cfa008a638e88c7b5952903f2bbc185cd701c718a1e315071fe2d233dd3c3b369eccf8eb3a19396270411ac
|
7
|
+
data.tar.gz: 9df63e9f26ef72c82d73fab21e4fc5dafe9d701662b0d17f5aa82b09f018b4418771852ca14dd40c093e4d11c08f585dfba619f79c17d2ba00901f1136e93bb2
|
data/lib/eac_rails_base0.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRailsBase0
|
4
|
+
module Patches
|
5
|
+
module UrlForPatch
|
6
|
+
class << self
|
7
|
+
def included(base)
|
8
|
+
base.include(InstanceMethods)
|
9
|
+
base.alias_method_chain :url_for, :engines
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
module InstanceMethods
|
14
|
+
def url_for_with_engines(options = nil)
|
15
|
+
url_for_without_engines(options)
|
16
|
+
rescue ActionController::UrlGenerationError
|
17
|
+
engines_url_for(options)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def engines_url_for(options)
|
23
|
+
::Rails::Engine.subclasses.each do |engine|
|
24
|
+
url = engine_url_for(engine, options)
|
25
|
+
return url if url
|
26
|
+
end
|
27
|
+
raise ActionController::UrlGenerationError, "Options: #{options}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def engine_url_for(engine, options)
|
31
|
+
engine.routes.url_for(options)
|
32
|
+
rescue ActionController::UrlGenerationError
|
33
|
+
nil
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
patch = ::EacRailsBase0::Patches::UrlForPatch
|
41
|
+
target = ::ActionDispatch::Routing::UrlFor
|
42
|
+
target.send(:include, patch) unless target.included_modules.include?(patch)
|
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.13.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-
|
11
|
+
date: 2019-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.4'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '0.
|
60
|
+
version: '0.4'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: byebug
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -414,6 +414,7 @@ files:
|
|
414
414
|
- lib/eac_rails_base0/app_generator/templates/config/routes.rb
|
415
415
|
- lib/eac_rails_base0/app_generator/templates/lib/local_plugins.rb
|
416
416
|
- lib/eac_rails_base0/engine.rb
|
417
|
+
- lib/eac_rails_base0/patches/url_for_patch.rb
|
417
418
|
- lib/eac_rails_base0/spec_helper.rb
|
418
419
|
- lib/eac_rails_base0/spec_helper/capybara.rb
|
419
420
|
- lib/eac_rails_base0/spec_helper/eac_users_support.rb
|