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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69dc7451d088acc2d1a698e89db77361de5cdf2bb07bb137b8e63ddc224f6fc2
4
- data.tar.gz: 7f1ac63a2d0b9e44845242bbf77f1154a0f14da3ba2a2a361b9dc90015a67904
3
+ metadata.gz: ff905fc5978244944098033bf6ecfb671f1130c336e2f77c19beefab3c927dfe
4
+ data.tar.gz: 0560a8a156cb45bc2e8c459b021e721118e304abf55e92d25039cd9c9277ee24
5
5
  SHA512:
6
- metadata.gz: 34c4108ff9d1bb29b9efa6051c5bf7399ac93fa7bb543cb3fcddfbbeabbd7be27fc19c8b66e088a56be329fd1291893c5a768699e74aaaa4d0c16ccdf4a9ac66
7
- data.tar.gz: cc60732174983f0616a47a7735ab34229234676fea0a6e472adc639bfad107823c95b0f3498e2246ec7dccb2a3e40d23a290fd430ec417db5e98f3e7e0c6482f
6
+ metadata.gz: b20134878fb83b50a0d9dda518dfc81500af893f522616605835e1ee2f6d78bbe824a9302d07131926d799bf308ee463efbfa9a0b4d37dce793fd2ab614c91d8
7
+ data.tar.gz: 30f12048aa54fa5070895859a99f0ffdd66bf35962d82e98952fc889b8a23afd9f4b650a89bea6645f28434210b173d90460196ab20a72f93fe68368cc50d87d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mj (0.4.0)
4
+ mj (0.4.1)
5
5
  thor (~> 1.2.1)
6
6
 
7
7
  GEM
@@ -8,11 +8,16 @@ module Mj
8
8
  private
9
9
 
10
10
  def apply_to?(file)
11
- file.end_with?("component.rb", "component.html.erb")
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.end_with?("component.rb")
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
- file_name = file.sub(/_component.rb$/, "_component.html.erb")
24
- add_candidate(file_name, "component_template", to: candidates)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mj
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Jacobus