cxxproject_stats 0.0.8 → 0.0.9
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 +7 -0
- data/lib/cxxproject_stats/plugin.rb +76 -4
- data/lib/cxxproject_stats/version.rb +1 -1
- metadata +12 -22
- data/.gitignore +0 -17
- data/Gemfile +0 -4
- data/Rakefile +0 -9
- data/cxxproject_stats.gemspec +0 -22
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a239e2180112703eb40f1750dd948d14b4dad99b
|
4
|
+
data.tar.gz: 2bab311e33818c95630bb40b105b52d882472d87
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9890d1a3aa5598e0a00781a1c268538be3c40b729884963b272e3f9c5bbab1faf3481e2b728c1422740db4cc894343024c0aa055af31e695568a74697f1a1801
|
7
|
+
data.tar.gz: a38d07f2e4c9900c016e27fae797804ee59a93a8dbab8dc79239d7925f16b7cf26423d413806f7d7afa0804c696b54c6b4a2147afcef90f364999b6de5bc6e98
|
@@ -12,10 +12,14 @@ cxx_plugin do |ruby_dsl, building_blocks, log|
|
|
12
12
|
io.puts(indent + '%div.details')
|
13
13
|
bbs.each do |bb|
|
14
14
|
if bb.kind_of?(Cxxproject::HasSources)
|
15
|
-
io.puts(indent +
|
16
|
-
io.puts(indent + '
|
15
|
+
io.puts(indent + ' %table')
|
16
|
+
io.puts(indent + ' %tr')
|
17
|
+
io.puts(indent + ' %td')
|
18
|
+
io.puts(indent + " %img{:src=>\"#{bb.name}.svg\"}")
|
19
|
+
io.puts(indent + ' %td')
|
20
|
+
io.puts(indent + ' %ul')
|
17
21
|
bb.sources.each do |s|
|
18
|
-
io.puts(indent + "
|
22
|
+
io.puts(indent + " %li #{s}")
|
19
23
|
end
|
20
24
|
end
|
21
25
|
end
|
@@ -32,8 +36,76 @@ cxx_plugin do |ruby_dsl, building_blocks, log|
|
|
32
36
|
|
33
37
|
directory ruby_dsl.build_dir
|
34
38
|
|
39
|
+
def dot_for_exe
|
40
|
+
"tab"
|
41
|
+
end
|
42
|
+
def dot_for_static
|
43
|
+
"folder"
|
44
|
+
end
|
45
|
+
def dot_for_shared
|
46
|
+
"component"
|
47
|
+
end
|
48
|
+
def dot_for_binary
|
49
|
+
"box"
|
50
|
+
end
|
51
|
+
def building_block_to_shape(bb, log)
|
52
|
+
if bb.is_a?(Cxxproject::Executable)
|
53
|
+
return dot_for_exe
|
54
|
+
elsif bb.is_a?(Cxxproject::StaticLibrary)
|
55
|
+
return dot_for_static
|
56
|
+
elsif bb.is_a?(Cxxproject::SharedLibrary)
|
57
|
+
return dot_for_shared
|
58
|
+
elsif bb.is_a?(Cxxproject::BinaryLibrary)
|
59
|
+
return dot_for_binary
|
60
|
+
else
|
61
|
+
log.error "unknown building block: #{bb}"
|
62
|
+
return "plaintext"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def write_svg(name, ruby_dsl, &block)
|
67
|
+
dot_file = File.join(ruby_dsl.build_dir, "#{name}.dot")
|
68
|
+
svg_file = File.join(ruby_dsl.build_dir, "#{name}.svg")
|
69
|
+
File.open(dot_file, 'w') do |out|
|
70
|
+
block.call(out)
|
71
|
+
end
|
72
|
+
sh "dot -Tsvg #{dot_file} -o#{svg_file}"
|
73
|
+
end
|
74
|
+
|
35
75
|
desc 'print building block stats'
|
36
76
|
task :stats => ruby_dsl.build_dir do
|
77
|
+
write_svg('dependencies', ruby_dsl) do |out|
|
78
|
+
out.puts("digraph DependencyTree {")
|
79
|
+
building_blocks.each do |name, bb|
|
80
|
+
out.puts("\"#{name}\" [shape=\"#{building_block_to_shape(bb, log)}\"];")
|
81
|
+
bb.dependencies.each do |d|
|
82
|
+
out.puts("\"#{name}\" -> \"#{d}\"")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
out.puts(" subgraph cluster_legend {")
|
86
|
+
out.puts(" label = \"Legend\";")
|
87
|
+
out.puts(" edge [style=invis];")
|
88
|
+
out.puts(" graph[style=dotted];")
|
89
|
+
out.puts(" \"executables\" [shape=\"#{dot_for_exe}\"];")
|
90
|
+
out.puts(" \"static libraries\" [shape=\"#{dot_for_static}\"];")
|
91
|
+
out.puts(" \"shared libraries\" [shape=\"#{dot_for_shared}\"];")
|
92
|
+
out.puts(" \"binary libraries\" [shape=\"#{dot_for_binary}\"];")
|
93
|
+
out.puts(" \"executables\" -> \"static libraries\" -> \"shared libraries\" -> \"binary libraries\";")
|
94
|
+
out.puts(" }")
|
95
|
+
out.puts("}")
|
96
|
+
end
|
97
|
+
|
98
|
+
building_blocks.each do |name, bb|
|
99
|
+
if bb.kind_of?(Cxxproject::HasSources)
|
100
|
+
template = "digraph DependencyTree { \"#{name}\" [shape=\"#{building_block_to_shape(bb, log)}\", label=\<\<table border=\"0\"><tr><td align=\"left\">Name:</td><td align=\"left\">#{name}</td></tr><tr><td align=\"left\">Sources:</td><td align=\"left\">#{bb.sources.size}</td></tr></table>> ];}"
|
101
|
+
dot_file = File.join(ruby_dsl.build_dir, "#{name}.dot")
|
102
|
+
svg_file = File.join(ruby_dsl.build_dir, "#{name}.svg")
|
103
|
+
write_svg(name, ruby_dsl) do |io|
|
104
|
+
io.puts(template)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
37
109
|
io = StringIO.new
|
38
110
|
io.puts('%html')
|
39
111
|
io.puts(' %head')
|
@@ -44,10 +116,10 @@ cxx_plugin do |ruby_dsl, building_blocks, log|
|
|
44
116
|
io.puts(' %body')
|
45
117
|
res = building_blocks.inject(io) do |memo, pair|
|
46
118
|
key, bb = pair
|
47
|
-
log.error building_blocks.size
|
48
119
|
handle_exe(memo, building_blocks, bb, ' '*4, log)
|
49
120
|
memo
|
50
121
|
end
|
122
|
+
io.puts(' %img{:src=>"dependencies.svg"}')
|
51
123
|
engine = Haml::Engine.new(io.string)
|
52
124
|
File.open(File.join(ruby_dsl.build_dir, 'stats.out.html'), 'w') do |out|
|
53
125
|
out.puts(engine.render)
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cxxproject_stats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.9
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Christian Köstlin
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: cxx
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: haml
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: creates some stats for cxx-projects
|
@@ -50,37 +45,32 @@ executables: []
|
|
50
45
|
extensions: []
|
51
46
|
extra_rdoc_files: []
|
52
47
|
files:
|
53
|
-
- .gitignore
|
54
|
-
- Gemfile
|
55
48
|
- LICENSE
|
56
49
|
- README.md
|
57
|
-
- Rakefile
|
58
|
-
- cxxproject_stats.gemspec
|
59
50
|
- lib/cxxproject_stats.rb
|
60
51
|
- lib/cxxproject_stats/plugin.rb
|
61
52
|
- lib/cxxproject_stats/version.rb
|
62
53
|
homepage: http://marcmo.github.com/cxxproject/
|
63
54
|
licenses: []
|
55
|
+
metadata: {}
|
64
56
|
post_install_message:
|
65
57
|
rdoc_options: []
|
66
58
|
require_paths:
|
67
59
|
- lib
|
68
60
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
-
none: false
|
70
61
|
requirements:
|
71
|
-
- -
|
62
|
+
- - ">="
|
72
63
|
- !ruby/object:Gem::Version
|
73
64
|
version: '0'
|
74
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
-
none: false
|
76
66
|
requirements:
|
77
|
-
- -
|
67
|
+
- - ">="
|
78
68
|
- !ruby/object:Gem::Version
|
79
69
|
version: '0'
|
80
70
|
requirements: []
|
81
71
|
rubyforge_project:
|
82
|
-
rubygems_version:
|
72
|
+
rubygems_version: 2.5.1
|
83
73
|
signing_key:
|
84
|
-
specification_version:
|
85
|
-
summary:
|
74
|
+
specification_version: 4
|
75
|
+
summary: "..."
|
86
76
|
test_files: []
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/cxxproject_stats.gemspec
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
gem_name = 'cxxproject_stats'
|
3
|
-
require File.expand_path("lib/#{gem_name}/version")
|
4
|
-
|
5
|
-
Gem::Specification.new do |gem|
|
6
|
-
gem.name = gem_name
|
7
|
-
gem.version = CxxprojectStats::VERSION
|
8
|
-
|
9
|
-
gem.authors = ["Christian Köstlin"]
|
10
|
-
gem.email = ["christian.koestlin@esrlabs.com"]
|
11
|
-
gem.description = %q{creates some stats for cxx-projects}
|
12
|
-
gem.summary = %q{...}
|
13
|
-
gem.homepage = "http://marcmo.github.com/cxxproject/"
|
14
|
-
|
15
|
-
gem.files = `git ls-files`.split($\)
|
16
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
-
gem.require_paths = ["lib"]
|
19
|
-
|
20
|
-
gem.add_dependency 'cxx'
|
21
|
-
gem.add_dependency 'haml'
|
22
|
-
end
|