cpp_dependency_graph 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: feac9cd85c6b1df61ad89cb9b292d4fd927c2256a1b9cb42a816065b87c3012f
4
- data.tar.gz: c055532215dd55a1e04e5e27a679aa805797f714f5b697e23317729802b8740f
3
+ metadata.gz: f5439e5df96869f8e42239ae1dd7963b1c8f12bb72f66b9931e19ffa7ba8f48f
4
+ data.tar.gz: 7793b519e5fd0915479f6181b84954cd06525da8b59bc6e1e67d3bb8eb053c5e
5
5
  SHA512:
6
- metadata.gz: 381fef815402ed98ab960277a0ed0bfb06a52c89c8029696453940306e309356aab7867b6c20e8af7189e647203a3dc0e4721249ccf200acae8d7abecc56dc44
7
- data.tar.gz: 3354743837ae6ac501d7b5809c330fa2a9e3e0f9a1686f2409e8ac6f10bfba0de1abd7ef26a640b1986c79c3ddabb24fb251e38a11cf17650b178fa245348dfe
6
+ metadata.gz: 834d2e3aa16613a92bc308b726d32bed789fa770e0562cee8aee8ce308bbee69888698ebc276b315c74f62207c0bf7f66163f365eb407170044c865dadc60233
7
+ data.tar.gz: 0a83134a6ce392d0f582354f21c8a641e0d58fb70b810b136defb0e92236c68db4d4e46cbf12366f2ab07202784936a0750148a36e6c35cb77e1a117967863bf
data/README.md CHANGED
@@ -51,17 +51,17 @@ A huge shout out to the people behind these projects.
51
51
 
52
52
  ### Overall component dependency graph
53
53
 
54
- To generate the overall component depenency graph for a project, use it like so -
54
+ To generate the overall component dependency graph for a project, use it like so -
55
55
 
56
56
  `cpp_dependency_graph visualise -r spec\test\example_project\ -o deps.dot -f dot`
57
57
 
58
58
  Below is the overall `dot` and `d3` component dependency visualisations for [leveldb](https://github.com/google/leveldb)
59
59
 
60
- ![Dot](examples/leveldb_overall.svg)
60
+ ![Dot](docs/examples/leveldb_overall.svg)
61
61
 
62
- ![d3.js visualisation of leveldb](examples/leveldb_overall_d3.svg)
62
+ ![d3.js visualisation of leveldb](docs/examples/leveldb_overall_d3.svg)
63
63
 
64
- ![d3.js visualisation of rocksdb](examples/rocksdb_overall_d3.svg)
64
+ ![d3.js visualisation of rocksdb](docs/examples/rocksdb_overall_d3.svg)
65
65
 
66
66
  **NOTE** - If your project has a large number of components (> 100 and lots of connections between them), then generation (and subsequent rendering) may take some time.
67
67
 
@@ -73,9 +73,9 @@ This will highlight the dependencies coming in and going out of a specific compo
73
73
 
74
74
  Here's a component dependency visualisation generated for the `queue` component in [rethinkdb](https://github.com/rethinkdb/rethinkdb)
75
75
 
76
- ![Queue component dot visualisation](examples/rethinkdb_queue_component.svg)
76
+ ![Queue component dot visualisation](docs/examples/rethinkdb_queue_component.svg)
77
77
 
78
- ![Queue component d3 visualisation](examples/rethinkdb_queue_component_d3.svg)
78
+ ![Queue component d3 visualisation](docs/examples/rethinkdb_queue_component_d3.svg)
79
79
 
80
80
  ### Component include dependency graph
81
81
 
@@ -85,9 +85,9 @@ This will highlight dependencies of includes within a specific component
85
85
 
86
86
  Here's a component include dependency visualisation generated for the `queue` component in [rethinkdb](https://github.com/rethinkdb/rethinkdb)
87
87
 
88
- ![Queue include graph dot](examples/rethinkdb_queue_include.svg)
88
+ ![Queue include graph dot](docs/examples/rethinkdb_queue_include.svg)
89
89
 
90
- ![Queue include graph d3](examples/rethinkdb_queue_include_d3.svg)
90
+ ![Queue include graph d3](docs/examples/rethinkdb_queue_include_d3.svg)
91
91
 
92
92
  ### Cyclic dependencies only graph
93
93
 
@@ -97,9 +97,9 @@ This will highlight cyclic dependencies between components within a project. Thi
97
97
 
98
98
  Here's the cyclic dependencies only visualisation generated for [rethinkdb](https://github.com/rethinkdb/rethinkdb) and [leveldb](https://github.com/google/leveldb)
99
99
 
100
- ![rethinkdb](examples/rethinkdb_cyclic_deps.svg)
100
+ ![rethinkdb](docs/examples/rethinkdb_cyclic_deps.svg)
101
101
 
102
- ![leveldb](examples/leveldb_cyclic_deps.svg)
102
+ ![leveldb](docs/examples/leveldb_cyclic_deps.svg)
103
103
 
104
104
  ## Development
105
105
 
data/docs/README.md CHANGED
@@ -3,10 +3,24 @@ layout: home
3
3
  title: "Github Pages for Non-Developers: Build Web Portfolios From Scratch"
4
4
  ---
5
5
 
6
- <section class="sec">
7
- This is a very narrowly focused tutorial about web development aimed at novices who have absolutely no web dev experience, nor have used [Github](https://github.com) or [Git](http://git-scm.com/), or even the command line.
6
+ # Cpp Dependency Graph
8
7
 
9
- The end product is a web portfolio, built (mostly) from scratch, that is easy to edit and easy to publish _anywhere_ &ndash; Github merely provides an easy starting point.
8
+ Generates useful component dependency visualisations (`dot` or `d3.js`) to study the architecture of C/C++ projects.
10
9
 
11
- (_This tutorial is in progress. [Feel free to fork it on Github](http://github.com/dannguyen/github-for-portfolios)_)
12
- </section>
10
+ Why do all the other languages have awesome tools to analyse codebases but C/C++ does not?
11
+
12
+ It's time to change that.
13
+
14
+ This tool aims to -
15
+
16
+ - provide multiple views into the architecture of a codebase
17
+ - generate views at multiple levels of the architecture
18
+ - make the resulting views genuinely useful, rich, dynamic and interactive (static views are boring)
19
+
20
+ ## Inspiration
21
+
22
+ This tool is inspired by a number of projects [rubrowser](http://www.emadelsaid.com/rubrowser/), [cpp-dependencies](https://github.com/tomtom-international/cpp-dependencies) and [objc-dependency-visualizer](https://github.com/PaulTaykalo/objc-dependency-visualizer).
23
+
24
+ The pretty `d3` visualisations are directly copied from `objc-dependency-visualiser`.
25
+
26
+ A huge shout out to the people behind these projects.
data/docs/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-slate
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/docs/index.md ADDED
@@ -0,0 +1,43 @@
1
+ ---
2
+ layout: page
3
+ title: Cpp Dependency Graph
4
+ tagline: Visualise C/C++ projects with amazing visualisations
5
+ description: Tutorial on how to use Cpp Dependency Graph
6
+ ---
7
+
8
+ # Cpp Dependency Graph
9
+
10
+ Generates useful component dependency visualisations (`dot` or `d3.js`) to study the architecture of C/C++ projects.
11
+
12
+ Why do all the other languages have awesome tools to analyse codebases but C/C++ does not?
13
+
14
+ It's time to change that.
15
+
16
+ This tool aims to -
17
+
18
+ - provide multiple views into the architecture of a codebase
19
+ - generate views at multiple levels of the architecture
20
+ - make the resulting views genuinely useful, rich, dynamic and interactive (static views are boring)
21
+
22
+ ## Inspiration
23
+
24
+ This tool is inspired by a number of projects [rubrowser](http://www.emadelsaid.com/rubrowser/), [cpp-dependencies](https://github.com/tomtom-international/cpp-dependencies) and [objc-dependency-visualizer](https://github.com/PaulTaykalo/objc-dependency-visualizer).
25
+
26
+ The pretty `d3` visualisations are directly copied from `objc-dependency-visualiser`.
27
+
28
+ A huge shout out to the people behind these projects.
29
+
30
+ ## Usage tutorial
31
+ ### Overall component dependency graph
32
+
33
+ To generate the overall component dependency graph for a project, use it like so -
34
+
35
+ `cpp_dependency_graph visualise -r spec\test\example_project\ -o deps.dot -f dot`
36
+
37
+ Below is the overall `dot` and `d3` component dependency visualisations for [leveldb](https://github.com/google/leveldb)
38
+
39
+ ![Dot](examples/leveldb_overall.svg)
40
+
41
+ ![d3.js visualisation of leveldb](examples/leveldb_overall_d3.svg)
42
+
43
+ ![d3.js visualisation of rocksdb](examples/rocksdb_overall_d3.svg)
@@ -17,7 +17,7 @@ class DirTree
17
17
  private
18
18
 
19
19
  def parse_dirs(path, name = nil)
20
- data = Hash.new{|h, k| h[k] = []}
20
+ data = Hash.new { |h, k| h[k] = [] }
21
21
  data[:name] = (name || path)
22
22
  # TODO: Use Dir.map.compact|filter instead here
23
23
  Dir.foreach(path) do |entry|
@@ -47,6 +47,12 @@ class SourceFile
47
47
  end
48
48
 
49
49
  def file_contents
50
- @file_contents ||= File.read(@path)
50
+ @file_contents ||= sanitised_file_contents
51
+ end
52
+
53
+ def sanitised_file_contents
54
+ contents = File.read(@path)
55
+ return contents if contents.valid_encoding?
56
+ contents.encode('UTF-16be', invalid: :replace, replace: '?').encode('UTF-8')
51
57
  end
52
58
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CppDependencyGraph
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpp_dependency_graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shreyas Balakrishna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-24 00:00:00.000000000 Z
11
+ date: 2018-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -217,22 +217,24 @@ files:
217
217
  - bin/setup
218
218
  - cpp_dependency_graph.gemspec
219
219
  - docs/README.md
220
- - examples/leveldb_cyclic_deps.svg
221
- - examples/leveldb_overall.png
222
- - examples/leveldb_overall.svg
223
- - examples/leveldb_overall_d3.png
224
- - examples/leveldb_overall_d3.svg
225
- - examples/rethinkdb_cyclic_deps.svg
226
- - examples/rethinkdb_queue_component.png
227
- - examples/rethinkdb_queue_component.svg
228
- - examples/rethinkdb_queue_component_d3.png
229
- - examples/rethinkdb_queue_component_d3.svg
230
- - examples/rethinkdb_queue_include.png
231
- - examples/rethinkdb_queue_include.svg
232
- - examples/rethinkdb_queue_include_d3.png
233
- - examples/rethinkdb_queue_include_d3.svg
234
- - examples/rocksdb_overall_d3.svg
235
- - examples/rocksdb_table_component.png
220
+ - docs/_config.yml
221
+ - docs/examples/leveldb_cyclic_deps.svg
222
+ - docs/examples/leveldb_overall.png
223
+ - docs/examples/leveldb_overall.svg
224
+ - docs/examples/leveldb_overall_d3.png
225
+ - docs/examples/leveldb_overall_d3.svg
226
+ - docs/examples/rethinkdb_cyclic_deps.svg
227
+ - docs/examples/rethinkdb_queue_component.png
228
+ - docs/examples/rethinkdb_queue_component.svg
229
+ - docs/examples/rethinkdb_queue_component_d3.png
230
+ - docs/examples/rethinkdb_queue_component_d3.svg
231
+ - docs/examples/rethinkdb_queue_include.png
232
+ - docs/examples/rethinkdb_queue_include.svg
233
+ - docs/examples/rethinkdb_queue_include_d3.png
234
+ - docs/examples/rethinkdb_queue_include_d3.svg
235
+ - docs/examples/rocksdb_overall_d3.svg
236
+ - docs/examples/rocksdb_table_component.png
237
+ - docs/index.md
236
238
  - exe/cpp_dependency_graph
237
239
  - lib/cpp_dependency_graph.rb
238
240
  - lib/cpp_dependency_graph/bidirectional_hash.rb