neo_doxygen: Add missing documentation.
[nit.git] / contrib / neo_doxygen / src / tests / neo_doxygen_dump.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # A variant of the `neo_doxygen` program that produces a debugging output of the graph instead of saving it.
16 #
17 # Note: The `--dest` option is ignored.
18 module tests::neo_doxygen_dump
19
20 import tests
21 import neo_doxygen
22
23 redef class Sys
24 redef fun program_name do return "%PROGRAM_NAME%"
25 end
26
27 redef class NeoDoxygenJob
28 redef fun list_files(dir) do
29 var a = super.to_a
30 default_comparator.sort(a)
31 return a
32 end
33 end
34
35 redef class NeoDoxygenCommand
36 redef fun create_store(url) do return new DebugStore
37 end
38
39 # Dummy storage medium that write a debugging output to the standard output.
40 #
41 # For testing purposes only.
42 class DebugStore
43 super GraphStore
44
45 redef fun has_node_label(name) do return false
46
47 redef fun save_all(neo_entities) do
48 print ""
49 for n in neo_entities do
50 if n isa NeoEdge then
51 var buffer = new RopeBuffer
52 n.debug buffer
53 print buffer
54 end
55 end
56 print "---===DONE===---"
57 end
58 end