inch 0.5.0.rc9 → 0.5.0.rc10

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: 307bb0b28d76ee1c7f05a226cfaf421ba6620077
4
- data.tar.gz: 4e9b727f8db07d2da162538d0db12eb143aa3d43
3
+ metadata.gz: 638174e9554e3e2939318497da1bc383117b4da2
4
+ data.tar.gz: 5d8da01335c3b3aa85c32206f17e6be9467cc438
5
5
  SHA512:
6
- metadata.gz: b5540bb674d846f63d1a41f530d2bdb9ad4b93555b3f837c728d0f2e082ecb1bf87615d0416d849a6ca7c05d77cb4c1588f09c8f4f630722648ab96e68e9e626
7
- data.tar.gz: ffa06231bf7c91dc536ec131e3c0e9b2993207b7b022e3852db3304bb378f0eab3214f844dd2e98f3860126769eef50f959b6165adb2f9a831a09b7745879bbf
6
+ metadata.gz: 860ec137656d65114b760e311573ce6b00321f9a490a763cc5aa9e1830d920e4172808bf14abbbce52953632a41ad7a026d7953140a55d7fdef9067f27cb37d3
7
+ data.tar.gz: 4b471c480d52ba2724b34edc1d96f36f1929b1bcebcc6a3609524a03f511d195cb6df12c59b9b2f9459e7a0f7173ea3c792696e24edbd9a883dfe1db16c2a411
@@ -21,7 +21,7 @@ module Inch
21
21
  end
22
22
 
23
23
  def parameters
24
- names = FunctionSignature.new(name, @hash['signature']).parameter_names
24
+ names = FunctionSignature.new(@hash['signature']).parameter_names
25
25
  names.map do |name|
26
26
  FunctionParameterObject.new(self, name)
27
27
  end
@@ -29,18 +29,28 @@ module Inch
29
29
 
30
30
  private
31
31
 
32
- class FunctionSignature < Struct.new(:fun_name, :signature)
32
+ class FunctionSignature < Struct.new(:signature)
33
33
  def parameter_names
34
- base_name = fun_name.split('/').first
35
- signature.gsub(/^(#{base_name}\()/, '').gsub(/(\))$/, '')
36
- .gsub( /\([^\)]+\)/, '' )
37
- .split(',')
38
- .map do |param|
39
- name = param.split("\\\\").first
40
- name && name.strip
41
- end.compact
34
+ names = []
35
+ signature.each do |tuple|
36
+ if name = name_from_tuple(*tuple)
37
+ names << name
38
+ end
39
+ end
40
+ names
41
+ end
42
+
43
+ def name_from_tuple(a, _, b)
44
+ if b.nil?
45
+ a
46
+ else
47
+ if a == "\\\\"
48
+ b.first.first
49
+ end
50
+ end
42
51
  end
43
52
  end
53
+
44
54
  end
45
55
  end
46
56
  end
@@ -1,3 +1,3 @@
1
1
  module Inch
2
- VERSION = '0.5.0.rc9'
2
+ VERSION = '0.5.0.rc10'
3
3
  end
@@ -1,4 +1,6 @@
1
1
  {
2
+ "args": [],
3
+ "language": "elixir",
2
4
  "objects": [
3
5
  {
4
6
  "id": "InchEx",
@@ -100,25 +102,62 @@
100
102
  "typespecs": []
101
103
  },
102
104
  {
103
- "arity": 3,
105
+ "arity": 4,
104
106
  "doc": false,
105
- "id": "generate_docs/3",
107
+ "id": "generate_docs/4",
106
108
  "module_id": "InchEx",
107
109
  "name": "generate_docs",
108
110
  "object_type": "FunctionObject",
109
- "signature": "generate_docs(project, version, options)",
111
+ "signature": [
112
+ [
113
+ "project",
114
+ [],
115
+ null
116
+ ],
117
+ [
118
+ "version",
119
+ [],
120
+ null
121
+ ],
122
+ [
123
+ "args",
124
+ [],
125
+ null
126
+ ],
127
+ [
128
+ "options",
129
+ [],
130
+ null
131
+ ]
132
+ ],
110
133
  "source": null,
111
134
  "specs": [],
112
135
  "type": "def"
113
136
  },
114
137
  {
115
- "arity": 2,
138
+ "arity": 3,
116
139
  "doc": "Generate JSON documentation for the given modules\n",
117
- "id": "run/2",
140
+ "id": "run/3",
118
141
  "module_id": "InchEx.Docs.Formatter",
119
142
  "name": "run",
120
143
  "object_type": "FunctionObject",
121
- "signature": "run(modules, config)",
144
+ "signature": [
145
+ [
146
+ "modules",
147
+ [],
148
+ null
149
+ ],
150
+ [
151
+ "args",
152
+ [],
153
+ null
154
+ ],
155
+ [
156
+ "config",
157
+ [],
158
+ null
159
+ ]
160
+ ],
122
161
  "source": null,
123
162
  "specs": [],
124
163
  "type": "def"
@@ -130,7 +169,18 @@
130
169
  "module_id": "InchEx.Docs.Retriever",
131
170
  "name": "docs_from_dir",
132
171
  "object_type": "FunctionObject",
133
- "signature": "docs_from_dir(dir, config)",
172
+ "signature": [
173
+ [
174
+ "dir",
175
+ [],
176
+ null
177
+ ],
178
+ [
179
+ "config",
180
+ [],
181
+ null
182
+ ]
183
+ ],
134
184
  "source": null,
135
185
  "specs": [],
136
186
  "type": "def"
@@ -142,7 +192,18 @@
142
192
  "module_id": "InchEx.Docs.Retriever",
143
193
  "name": "docs_from_files",
144
194
  "object_type": "FunctionObject",
145
- "signature": "docs_from_files(files, config)",
195
+ "signature": [
196
+ [
197
+ "files",
198
+ [],
199
+ null
200
+ ],
201
+ [
202
+ "config",
203
+ [],
204
+ null
205
+ ]
206
+ ],
146
207
  "source": null,
147
208
  "specs": [],
148
209
  "type": "def"
@@ -154,7 +215,18 @@
154
215
  "module_id": "InchEx.Docs.Retriever",
155
216
  "name": "docs_from_modules",
156
217
  "object_type": "FunctionObject",
157
- "signature": "docs_from_modules(modules, config)",
218
+ "signature": [
219
+ [
220
+ "modules",
221
+ [],
222
+ null
223
+ ],
224
+ [
225
+ "config",
226
+ [],
227
+ null
228
+ ]
229
+ ],
158
230
  "source": null,
159
231
  "specs": [],
160
232
  "type": "def"
@@ -166,7 +238,13 @@
166
238
  "module_id": "InchEx.Docs.Retriever.Error",
167
239
  "name": "exception",
168
240
  "object_type": "FunctionObject",
169
- "signature": "exception(args)",
241
+ "signature": [
242
+ [
243
+ "args",
244
+ [],
245
+ null
246
+ ]
247
+ ],
170
248
  "source": null,
171
249
  "specs": [
172
250
  [
@@ -227,7 +305,13 @@
227
305
  "module_id": "InchEx.Docs.Retriever.Error",
228
306
  "name": "message",
229
307
  "object_type": "FunctionObject",
230
- "signature": "message(exception)",
308
+ "signature": [
309
+ [
310
+ "exception",
311
+ [],
312
+ null
313
+ ]
314
+ ],
231
315
  "source": null,
232
316
  "specs": [
233
317
  [
@@ -282,13 +366,31 @@
282
366
  "type": "def"
283
367
  },
284
368
  {
285
- "arity": 1,
286
- "doc": " Runs inch locally, if installed. If you want to force usage of a particular\n inch installation, set INCH_PATH environment variable to it.\n\n export INCH_PATH=/home/rrrene/projects/inch\n",
287
- "id": "run/1",
369
+ "arity": 2,
370
+ "doc": " Runs inch locally, if installed. If you want to force usage of a particular\n inch installation, set INCH_PATH environment variable:\n\n export INCH_PATH=/home/rrrene/projects/inch\n\n Otherwise, InchEx will take whatever `inch` command it finds. If it does\n not find any, it sends the data to the open API at inch-ci.org to perform\n the analysis and reports the findings back.\n",
371
+ "id": "run/2",
288
372
  "module_id": "InchEx.Reporter.Local",
289
373
  "name": "run",
290
374
  "object_type": "FunctionObject",
291
- "signature": "run(filename)",
375
+ "signature": [
376
+ [
377
+ "filename",
378
+ [],
379
+ null
380
+ ],
381
+ [
382
+ "\\\\",
383
+ [],
384
+ [
385
+ [
386
+ "args",
387
+ [],
388
+ null
389
+ ],
390
+ []
391
+ ]
392
+ ]
393
+ ],
292
394
  "source": null,
293
395
  "specs": [],
294
396
  "type": "def"
@@ -300,7 +402,40 @@
300
402
  "module_id": "InchEx.Reporter.Remote",
301
403
  "name": "run",
302
404
  "object_type": "FunctionObject",
303
- "signature": "run(filename, config \\\\ Mix.Project.config())",
405
+ "signature": [
406
+ [
407
+ "filename",
408
+ [],
409
+ null
410
+ ],
411
+ [
412
+ "\\\\",
413
+ [],
414
+ [
415
+ [
416
+ "config",
417
+ [],
418
+ null
419
+ ],
420
+ [
421
+ [
422
+ ".",
423
+ {
424
+ "line": 7
425
+ },
426
+ [
427
+ "Elixir.Mix.Project",
428
+ "config"
429
+ ]
430
+ ],
431
+ {
432
+ "line": 7
433
+ },
434
+ []
435
+ ]
436
+ ]
437
+ ]
438
+ ],
304
439
  "source": null,
305
440
  "specs": [],
306
441
  "type": "def"
@@ -312,7 +447,81 @@
312
447
  "module_id": "Mix.Tasks.Inch",
313
448
  "name": "run",
314
449
  "object_type": "FunctionObject",
315
- "signature": "run(args, config \\\\ Mix.Project.config(), generator \\\\ :erlang.make_fun(InchEx, :generate_docs, 3), reporter \\\\ InchEx.Reporter.Local)",
450
+ "signature": [
451
+ [
452
+ "args",
453
+ [],
454
+ null
455
+ ],
456
+ [
457
+ "\\\\",
458
+ [],
459
+ [
460
+ [
461
+ "config",
462
+ [],
463
+ null
464
+ ],
465
+ [
466
+ [
467
+ ".",
468
+ {
469
+ "line": 10
470
+ },
471
+ [
472
+ "Elixir.Mix.Project",
473
+ "config"
474
+ ]
475
+ ],
476
+ {
477
+ "line": 10
478
+ },
479
+ []
480
+ ]
481
+ ]
482
+ ],
483
+ [
484
+ "\\\\",
485
+ [],
486
+ [
487
+ [
488
+ "generator",
489
+ [],
490
+ null
491
+ ],
492
+ [
493
+ [
494
+ ".",
495
+ [],
496
+ [
497
+ "erlang",
498
+ "make_fun"
499
+ ]
500
+ ],
501
+ {
502
+ "line": 10
503
+ },
504
+ [
505
+ "Elixir.InchEx",
506
+ "generate_docs",
507
+ 4
508
+ ]
509
+ ]
510
+ ]
511
+ ],
512
+ [
513
+ "\\\\",
514
+ [],
515
+ [
516
+ [
517
+ "reporter",
518
+ [],
519
+ null
520
+ ],
521
+ "Elixir.InchEx.Reporter.Local"
522
+ ]
523
+ ]
524
+ ],
316
525
  "source": null,
317
526
  "specs": [],
318
527
  "type": "def"
@@ -9,7 +9,7 @@ describe ::Inch::Language::Elixir::CodeObject::FunctionObject do
9
9
  describe 'Scores' do
10
10
  #
11
11
  it 'should not' do
12
- m = @objects.find('InchEx.generate_docs/3')
12
+ m = @objects.find('InchEx.generate_docs/4')
13
13
  assert m.score >= 50
14
14
  end
15
15
  end
@@ -18,7 +18,7 @@ describe ::Inch::Language::Elixir::CodeObject::FunctionObject do
18
18
  mod = @objects.find('InchEx')
19
19
  assert mod.has_children?
20
20
  assert mod.children.size > 1
21
- fun = @objects.find('InchEx.generate_docs/3')
21
+ fun = @objects.find('InchEx.generate_docs/4')
22
22
  assert_equal mod, fun.parent
23
23
  end
24
24
 
@@ -29,19 +29,19 @@ describe ::Inch::Language::Elixir::CodeObject::FunctionObject do
29
29
  assert_equal 2, m.depth
30
30
  m = @objects.find('InchEx.Docs.Formatter')
31
31
  assert_equal 3, m.depth
32
- m = @objects.find('InchEx.Docs.Formatter.run/2')
32
+ m = @objects.find('InchEx.Docs.Formatter.run/3')
33
33
  assert_equal 4, m.depth
34
34
  end
35
35
 
36
36
  it "should parse parameters correctly" do
37
37
  m = @objects.find("Mix.Tasks.Inch.run/4")
38
- #assert_equal 4, m.parameters.size
38
+ assert_equal 4, m.parameters.size
39
39
  end
40
40
 
41
41
  # TODO: move to own test file
42
42
  it "should parse parameters correctly 1" do
43
43
  klass = ::Inch::Language::Elixir::Provider::Reader::Object::FunctionObject::FunctionSignature
44
- fn = klass.new('run/4', "run(args, config \\\\ Mix.Project.config(), generator \\\\ :erlang.make_fun(InchEx, :generate_docs, 3), reporter \\\\ InchEx.Reporter.Local)")
44
+ fn = klass.new([["args", [], nil ], ["\\\\", [], [["config", [], nil ], [[".", {line: 10 }, ["Elixir.Mix.Project", "config"] ], {line: 10 }, [] ] ] ], ["\\\\", [], [["generator", [], nil ], [[".", [], ["erlang", "make_fun"] ], {line: 10 }, ["Elixir.InchEx", "generate_docs", 4 ] ] ] ], ["\\\\", [], [["reporter", [], nil ], "Elixir.InchEx.Reporter.Local"] ] ])
45
45
  assert_equal %w(args config generator reporter), fn.parameter_names
46
46
  end
47
47
  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.0.rc9
4
+ version: 0.5.0.rc10
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-09-28 00:00:00.000000000 Z
11
+ date: 2014-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler