cs_sln_graph 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +15 -13
- data/VERSION +1 -1
- data/cs_sln_graph.gemspec +1 -1
- data/lib/cs_sln_graph.rb +17 -5
- data/lib/vsfile_reader.rb +12 -2
- metadata +10 -10
data/README.rdoc
CHANGED
@@ -1,19 +1,21 @@
|
|
1
1
|
= cs_sln_graph
|
2
2
|
|
3
|
-
|
3
|
+
cs_sln_graph is a small utility gem I wrote to generate dependency graphs for C# solution files using GraphViz.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
-
* Fork the project
|
10
|
-
* Start a feature/bugfix branch
|
11
|
-
* Commit and push until you are happy with your contribution
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
5
|
+
You will need to install GraphViz before using this gem.
|
14
6
|
|
15
|
-
==
|
7
|
+
== Usage
|
16
8
|
|
17
|
-
|
18
|
-
|
9
|
+
To install, use gem
|
10
|
+
|
11
|
+
% gem install cs_sln_graph
|
12
|
+
|
13
|
+
The -i argument specifies the path to your solution.
|
19
14
|
|
15
|
+
The -o argument specifies the path to your output file (it will default to the directory your solution is in).
|
16
|
+
|
17
|
+
-f specifies the format the output file should be in (default is png).
|
18
|
+
|
19
|
+
== History
|
20
|
+
* 0.0.2 - Don't display System libraries, color external dependencies as green.
|
21
|
+
* 0.0.1 - Initial version
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/cs_sln_graph.gemspec
CHANGED
data/lib/cs_sln_graph.rb
CHANGED
@@ -23,7 +23,7 @@ class Cs_Sln_Graph
|
|
23
23
|
@graph.node[:fontname] = "Trebuchet MS"
|
24
24
|
@graph.node[:fontsize] = "8"
|
25
25
|
@graph.node[:fillcolor]= "#ffeecc"
|
26
|
-
@graph.node[:fontcolor]= "#
|
26
|
+
@graph.node[:fontcolor]= "#666666"
|
27
27
|
@graph.node[:margin] = "0.0"
|
28
28
|
|
29
29
|
# set global edge options
|
@@ -43,11 +43,23 @@ class Cs_Sln_Graph
|
|
43
43
|
path = File.join(File.dirname(@input_path), project.path)
|
44
44
|
dependencies = VSFile_Reader.read_proj(path)
|
45
45
|
dependencies.each do |dep|
|
46
|
-
|
47
|
-
|
48
|
-
d_node
|
46
|
+
if dep.class == Project
|
47
|
+
d_node = @graph.get_node(dep.name)
|
48
|
+
if d_node.nil?
|
49
|
+
d_node = @graph.add_node(dep.name)
|
50
|
+
end
|
51
|
+
@graph.add_edge(d_node, p_node)
|
52
|
+
else
|
53
|
+
if not dep.start_with?("System")
|
54
|
+
d_node = @graph.get_node(dep)
|
55
|
+
if d_node.nil?
|
56
|
+
d_node = @graph.add_node(dep)
|
57
|
+
d_node[:color] = "#66ddaa"
|
58
|
+
d_node[:fillcolor] = "#ccffee"
|
59
|
+
end
|
60
|
+
@graph.add_edge(d_node, p_node)
|
61
|
+
end
|
49
62
|
end
|
50
|
-
@graph.add_edge(d_node, p_node)
|
51
63
|
end
|
52
64
|
end
|
53
65
|
@graph.output(@format => @output_path)
|
data/lib/vsfile_reader.rb
CHANGED
@@ -30,8 +30,18 @@ class VSFile_Reader
|
|
30
30
|
dependencies << items[0]
|
31
31
|
end
|
32
32
|
# find project dependencies
|
33
|
-
document.elements.each('//Project/ItemGroup/ProjectReference
|
34
|
-
|
33
|
+
document.elements.each('//Project/ItemGroup/ProjectReference') do |element|
|
34
|
+
path = element.attributes["Include"]
|
35
|
+
name = ""
|
36
|
+
element.elements.each('Name') do |e|
|
37
|
+
name = e.text
|
38
|
+
end
|
39
|
+
id = ""
|
40
|
+
element.elements.each('Project') do |e|
|
41
|
+
id = e.text
|
42
|
+
end
|
43
|
+
proj = Project.new(id, name, path)
|
44
|
+
dependencies << proj
|
35
45
|
end
|
36
46
|
return dependencies
|
37
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cs_sln_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable: cs_sln_graph
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: shoulda
|
17
|
-
requirement: &
|
17
|
+
requirement: &7341120 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *7341120
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: bundler
|
28
|
-
requirement: &
|
28
|
+
requirement: &7340172 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 1.0.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *7340172
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: jeweler
|
39
|
-
requirement: &
|
39
|
+
requirement: &7339092 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 1.5.2
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *7339092
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rcov
|
50
|
-
requirement: &
|
50
|
+
requirement: &7338084 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *7338084
|
59
59
|
description: Generates dependency graphs using GraphViz from C# solution files
|
60
60
|
email: ctoneal@gmail.com
|
61
61
|
executables:
|
@@ -95,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
segments:
|
97
97
|
- 0
|
98
|
-
hash:
|
98
|
+
hash: 130173715
|
99
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
100
|
none: false
|
101
101
|
requirements:
|