copy_tuner_client 0.15.1 → 0.16.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d026c94fe7b434afec7fa13369e91ddd784ed649336de71bb5d2d0a373201e0f
|
4
|
+
data.tar.gz: f882fbc15358fb560d5ba695e138f2ca904ed3f1e4e5b29ccac1a4c3d7e9fe06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc0818f17179df0462efa7a739edbd1126d4b0170d550e15834980eeaf15c61197345b2a82dc2affc911d7914a82abbb5c5a70ff71b9e8d418425841f2f51bf8
|
7
|
+
data.tar.gz: ac73b7c43742c17061f318c32ff2f642d53afaa9dad02703a5e166181ac2027312a8a4f5c70626fb77923e29410c026f834db7b4ba1948fe306b6384396fc6d5
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ module CopyTunerClient
|
|
6
6
|
def translate_with_copyray_comment(key, **options)
|
7
7
|
source = translate_without_copyray_comment(key, **options)
|
8
8
|
|
9
|
+
if controller && CopyTunerClient::Rails.controller_of_rails_engine?(controller)
|
10
|
+
return source
|
11
|
+
end
|
12
|
+
|
9
13
|
# TODO: test
|
10
14
|
# NOTE: default引数が設定されている場合は、copytunerキャッシュの値をI18n.t呼び出しにより上書きしている
|
11
15
|
# SEE: https://github.com/rails/rails/blob/6c43ebc220428ce9fc9569c2e5df90a38a4fc4e4/actionview/lib/action_view/helpers/translation_helper.rb#L82
|
@@ -17,11 +17,16 @@ module CopyTunerClient
|
|
17
17
|
config.middleware = ::Rails.configuration.middleware
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
def self.controller_of_rails_engine?(controller)
|
22
|
+
# SEE: https://github.com/rails/rails/blob/539144d2d61770dab66c8643e744441e52538e09/activesupport/lib/active_support/core_ext/module/introspection.rb#L39-L63
|
23
|
+
engine_namespaces.include?(controller.class.module_parents[-2])
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.engine_namespaces
|
27
|
+
@engine_namespaces ||= ::Rails::Engine.subclasses.filter_map { _1.instance.railtie_namespace }
|
28
|
+
end
|
20
29
|
end
|
21
30
|
end
|
22
31
|
|
23
|
-
|
24
|
-
require 'copy_tuner_client/engine'
|
25
|
-
else
|
26
|
-
CopyTunerClient::Rails.initialize
|
27
|
-
end
|
32
|
+
require 'copy_tuner_client/engine'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: copy_tuner_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SonicGarden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|