mj 0.4.0 → 0.4.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mj/alternative_file/resolvers/ruby/view_component_resolver.rb +10 -4
- data/lib/mj/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ff905fc5978244944098033bf6ecfb671f1130c336e2f77c19beefab3c927dfe
|
|
4
|
+
data.tar.gz: 0560a8a156cb45bc2e8c459b021e721118e304abf55e92d25039cd9c9277ee24
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b20134878fb83b50a0d9dda518dfc81500af893f522616605835e1ee2f6d78bbe824a9302d07131926d799bf308ee463efbfa9a0b4d37dce793fd2ab614c91d8
|
|
7
|
+
data.tar.gz: 30f12048aa54fa5070895859a99f0ffdd66bf35962d82e98952fc889b8a23afd9f4b650a89bea6645f28434210b173d90460196ab20a72f93fe68368cc50d87d
|
data/Gemfile.lock
CHANGED
|
@@ -8,11 +8,16 @@ module Mj
|
|
|
8
8
|
private
|
|
9
9
|
|
|
10
10
|
def apply_to?(file)
|
|
11
|
-
file.end_with?(
|
|
11
|
+
file.end_with?(
|
|
12
|
+
"component.rb",
|
|
13
|
+
"component.html.erb",
|
|
14
|
+
"component_test.rb",
|
|
15
|
+
"component_spec.rb"
|
|
16
|
+
)
|
|
12
17
|
end
|
|
13
18
|
|
|
14
19
|
def add_candidates(file, candidates)
|
|
15
|
-
if file.
|
|
20
|
+
if file.extension == "rb"
|
|
16
21
|
return resolve_template(file, candidates)
|
|
17
22
|
end
|
|
18
23
|
|
|
@@ -20,8 +25,9 @@ module Mj
|
|
|
20
25
|
end
|
|
21
26
|
|
|
22
27
|
def resolve_template(file, candidates)
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
file = file.sub(/_component(_test|_spec)?.rb$/, "_component.html.erb")
|
|
29
|
+
file = file.sub(/^(spec|test)/, "app")
|
|
30
|
+
add_candidate(file, "component_template", to: candidates)
|
|
25
31
|
end
|
|
26
32
|
|
|
27
33
|
def resolve_component_class(file, candidates)
|
data/lib/mj/version.rb
CHANGED