inch 0.5.7 → 0.5.8
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd1b6ae7ca5ae4764816a45ac8aada91b776c622
|
4
|
+
data.tar.gz: b2f8b8c690f3ea84826bbfd45215542087ca545a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 511398f40a05ecf0f0ba776f81be7196ee28ada965b9a797f4c21c3a3a97cb16ba801de89c0de324d4f11974aadbd72897757c7c800e182ca5c87f470c8ed18a
|
7
|
+
data.tar.gz: 6e7273b119fe56d0e883cb11edf25a023677e95f6f73489c76341bea1d1bb1aa9f222374adb4fa14dfe6607b5c9ff13fb041884110fc73eac60dc7dca140c010
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'inch/language/elixir/provider/reader/docstring'
|
2
|
+
require 'inch/utils/code_location'
|
2
3
|
|
3
4
|
module Inch
|
4
5
|
module Language
|
@@ -22,11 +23,13 @@ module Inch
|
|
22
23
|
end
|
23
24
|
|
24
25
|
def files
|
25
|
-
[]
|
26
|
+
return [] if location.empty?
|
27
|
+
file, line_no = location[0], location[1]
|
28
|
+
[Inch::Utils::CodeLocation.new('', file, line_no)]
|
26
29
|
end
|
27
30
|
|
28
31
|
def filename
|
29
|
-
|
32
|
+
location[0]
|
30
33
|
end
|
31
34
|
|
32
35
|
attr_writer :children_fullnames
|
@@ -193,6 +196,12 @@ module Inch
|
|
193
196
|
:public
|
194
197
|
end
|
195
198
|
|
199
|
+
private
|
200
|
+
|
201
|
+
def location
|
202
|
+
@hash['source'].to_s.split(':')
|
203
|
+
end
|
204
|
+
|
196
205
|
end
|
197
206
|
end
|
198
207
|
end
|
data/lib/inch/version.rb
CHANGED
@@ -71,7 +71,7 @@
|
|
71
71
|
"module": "Elixir.InchTest.Functions",
|
72
72
|
"moduledoc": " In this module we define funs that are \"cases\" for our test suite.\n",
|
73
73
|
"object_type": "ModuleObject",
|
74
|
-
"source":
|
74
|
+
"source": "lib/inch_test/functions.ex:9",
|
75
75
|
"type": null,
|
76
76
|
"typespecs": []
|
77
77
|
},
|
@@ -40,4 +40,17 @@ describe ::Inch::Language::Elixir::CodeObject::ModuleObject do
|
|
40
40
|
assert m.nodoc?
|
41
41
|
assert m.priority < 0
|
42
42
|
end
|
43
|
+
|
44
|
+
it 'should recognize code location' do
|
45
|
+
m = @objects.find('InchTest.Functions')
|
46
|
+
file = m.filename
|
47
|
+
refute_nil file
|
48
|
+
assert_equal 'lib/inch_test/functions.ex', file.relative_path
|
49
|
+
assert_equal 9, file.line_no.to_i
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'should recognize missing code location' do
|
53
|
+
m = @objects.find('InchTest.FunctionObject')
|
54
|
+
assert_nil m.filename
|
55
|
+
end
|
43
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- René Föhring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|