depcheck 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/depcheck/command/graph_command.rb +2 -1
- data/lib/depcheck/output/graph_output.rb +6 -4
- data/lib/depcheck/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c387f537205b5615de2b49140a40c36612943a56
|
4
|
+
data.tar.gz: 1ba94f6285e6705da93dc38b2ed9d6d27a5d290e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbbae78fa7fa9d1d0769606cf10601f71d81806aef4beed4b10c7e4498bc36dc98d54f89af00a1d4d671afa13b4c37b6a14fb093df79b3a0cfea231037c7596d
|
7
|
+
data.tar.gz: eaaf27fb7ea04e25862019e6b44eae7b50490c128da4da991fbfa7ee8e02c5fe553e35790b00527bf28ae97da12bed60ddccca4b0bdb0c8d5d43510c48e1d7a0
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ gem install depcheck
|
|
30
30
|
|
31
31
|
`Analyze` command reports dependencies per classes. `Usage` command reports how many dependants a class have. `Graph` command generates dependency graph.
|
32
32
|
|
33
|
-
Build your project, and then run:
|
33
|
+
Build your project using Debug configuration, and then run:
|
34
34
|
|
35
35
|
```sh
|
36
36
|
$ depcheck analyze --project path/to/project.xcodeproj
|
@@ -2,6 +2,7 @@ class GraphCommand < Clamp::Command
|
|
2
2
|
option ['--project'], 'PROJECT', 'Path to the xcodeproj'
|
3
3
|
option ['--scheme'], 'SCHEME', 'The scheme that the project was built in'
|
4
4
|
option ['--workspace'], 'WORKSPACE', 'Path to the workspace'
|
5
|
+
option ["--include"], "INCLUDE", "Regexp of classes that will be shown on graph"
|
5
6
|
|
6
7
|
def execute
|
7
8
|
|
@@ -13,7 +14,7 @@ class GraphCommand < Clamp::Command
|
|
13
14
|
analyzer = Depcheck::Analyzer.new
|
14
15
|
results = analyzer.generate_dependencies(swiftdeps)
|
15
16
|
output = Depcheck::GraphOutput.new
|
16
|
-
output.post(results)
|
17
|
+
output.post(results, include)
|
17
18
|
end
|
18
19
|
|
19
20
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Depcheck
|
2
2
|
class GraphOutput
|
3
3
|
|
4
|
-
def post(objs)
|
4
|
+
def post(objs, include)
|
5
5
|
|
6
6
|
# installs graphviz if needed
|
7
7
|
system 'brew install graphviz' unless graphviz_installed?
|
@@ -12,7 +12,7 @@ module Depcheck
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# generate graph description
|
15
|
-
graph = generate_graph_description(objs)
|
15
|
+
graph = generate_graph_description(objs, include)
|
16
16
|
|
17
17
|
# create temporary graph dot file
|
18
18
|
file_name = 'graph'
|
@@ -27,11 +27,13 @@ module Depcheck
|
|
27
27
|
File.delete("#{file_name}.dot")
|
28
28
|
end
|
29
29
|
|
30
|
-
def generate_graph_description(objs)
|
30
|
+
def generate_graph_description(objs, include)
|
31
31
|
nodes = []
|
32
32
|
objs.each do |obj|
|
33
33
|
obj.dependencies.each do |dep|
|
34
|
-
|
34
|
+
if obj.name.match(/#{include}/) || dep.match(/#{include}/)
|
35
|
+
nodes << { source: obj.name, dep: dep }
|
36
|
+
end
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
data/lib/depcheck/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: depcheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wojciech Lukaszuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|