low_type 1.1.11 → 1.1.13

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: c82a177983dc14e1e81ca0a1c69116d0c93f833cfab0c1b5bbe33abd1af330f9
4
- data.tar.gz: 9313d43a504a3e9fd35f2e26b0e45f188507ae3d6565121569a22314af3e6a2d
3
+ metadata.gz: 6f0cac83a3d18258da13254f3d293d0630a718d7c2640bc56974d9973b78b330
4
+ data.tar.gz: b6c8fda73a3ca4d6c6d2a5aa91015cd162641f42edce4c3b901e1c481f2152af
5
5
  SHA512:
6
- metadata.gz: 02b10b638da5368d50a962644bf4bf4f1381b4ae705ca0aaa54fd207e70d49c3098d4cad3f4a42d0843ea0a7580cf8ea6c6992d105965d5f4165427955fbeb01
7
- data.tar.gz: 2fe096a5eb05a18abe85820d9a387758d2484a916e8434275256b3abc17772230489152f34245c7577ad2b721c2237b5e6c098759205cfbbb9328e2814af9b43
6
+ metadata.gz: b93f26a5ff5a22466aaa898201549205f3acef574488b887193a2c9fd0deef69894b679f4c966e01ac7fedc0326c69e694851bf0de9445f51922a7b6c12caa5f
7
+ data.tar.gz: f377e9f4f5bc85cb1e51e1a0cc3c36c0d6ac1b057da181341924377fb208208fa35bc27a1e5070ced94270fa46351c56c6d93dda9f08a21c69d913ae43d9b5b4
@@ -6,24 +6,12 @@ module Low
6
6
  class FileQuery
7
7
  class << self
8
8
  def file_path(klass:)
9
- includer_line = line_from_class(klass:) || line_from_include || ''
10
- file_path = includer_line.split(':').first || ''
9
+ file_path = Object.const_source_location(klass.name).first
11
10
 
12
11
  return file_path if File.exist?(file_path)
13
12
 
14
13
  raise MissingFileError, "No file found at path '#{file_path}'"
15
14
  end
16
-
17
- private
18
-
19
- def line_from_class(klass:)
20
- class_name = klass.to_s.split(':').last # Also remove the module namespaces from the class.
21
- caller.find { |callee| callee.end_with?("<class:#{class_name}>'") }
22
- end
23
-
24
- def line_from_include
25
- caller.find { |callee| callee.end_with?("include'") }
26
- end
27
15
  end
28
16
  end
29
17
  end
data/lib/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Low
4
4
  module Type
5
- VERSION = '1.1.11'
5
+ VERSION = '1.1.13'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: low_type
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - maedi