dependencytree 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 871b5cca00b7e8c672ebe92d50d82ce45312b676
4
- data.tar.gz: 24ba59e668837116dde2ccea7f5fdc5363cc0853
3
+ metadata.gz: d6c9b207272aaedff4dd7cc712102bd2f2cfa4cb
4
+ data.tar.gz: 029233de8ac63dcc17fbaf8cc1e92137fd0eadd2
5
5
  SHA512:
6
- metadata.gz: 02d79005326ff09a232d65027e7e25f6188693a516a82a81a4385d84dd2aa0890de0cdb979794346a3afc8b6e5cf849286092c31f1b913baefb40811e6150fa9
7
- data.tar.gz: 58ef9a55ed91519884a254cd7f48c022569e4eb228162e158794398975fc6ed15e0dba89108384e0fa31f339f7dbc650aa0d01deb71c354c3653e3491bc9075c
6
+ metadata.gz: 390ac33f9cdc9705ad310452f5f5903fa385f5b41a8ed5ad6e8092a2a61cf4fa0300f872ddaa535271a9a304d2f568a9f0cc6ce8b6ac24e78bdd0cac9d01b927
7
+ data.tar.gz: 41a9423ef8427f410dd05f4d90cfbc28bf04ff17097e9f7714c426a8420738bb2da57c3e9ce5824a51dc0793262910764e8b1659f5bb26885d1e0fcb22bd99b8
data/README.md CHANGED
@@ -15,10 +15,26 @@ Install it yourself as from https://rubygems.org/ by calling:
15
15
 
16
16
  Use the program in the shell and give it all ruby sources or folders containing ruby sources.
17
17
 
18
+ ### Example
19
+
20
+ An example call would look like this:
21
+
18
22
  dependencytree ./lib
19
23
 
24
+ ### Command line options
25
+
26
+ The following is a list of possible command line options:
27
+
28
+ -v, --verbose Verbose output
29
+ -p, --pattern[=OPTIONAL] Pattern to accept source codes with (default: (?-mix:.*\.rb))
30
+ -i, --ignore[=OPTIONAL] Paths to not load (default: (?-mix:^$))
31
+ -o, --output[=OPTIONAL] Output path for the JSON file
32
+ -h, --help Show this message
33
+
34
+ ### About the JSON output
35
+
20
36
  The output will be a JSON of the references. The interesting parts are:
21
- * **uuid**: Every class/module has a unique UUID for referencing. The UUID will stay unique only for one parsing run.
37
+ * **uuid**: Every class/module has a unique generated UUID for referencing. The UUID will stay unique only for one parsing run to allow graph building.
22
38
  * **resolved_refs**: Resolved / found references that are pointing to the UUID of the refered class.
23
39
  * **unresolved_refs**: Unresolved references that could not be found inside the sources provided.
24
40
  This can be Ruby classes or other classes from gems that were not scanned.
@@ -31,7 +47,10 @@ The output will be a JSON of the references. The interesting parts are:
31
47
  * **name**: The local module/class name, for example `"Stat"`.
32
48
  * **full_name**: The full name of the module/class, for example `"File::Stat"`.
33
49
 
34
- The following is the example for the dependency tree tool itself:
50
+ ### Example JSON output
51
+
52
+ The following is the example for the dependency tree tool itself.
53
+ A similar output will be written for the example call given above.
35
54
 
36
55
  ```
37
56
  [
@@ -1,3 +1,3 @@
1
1
  module Dependencytree
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -15,12 +15,14 @@ module Dependencytree
15
15
  return
16
16
  end
17
17
  if File.directory?(path)
18
+ STDERR.puts path if options[:verbose]
18
19
  Dir.entries(path).each { |x|
19
20
  resolved = File.join(path, x)
20
21
  handle_path(options, consumer, resolved) if File.directory?(resolved) && x != "." && x != ".."
21
22
  handle_path(options, consumer, resolved) if File.file?(resolved) && options[:pattern].match(resolved)
22
23
  }
23
24
  elsif File.file?(path)
25
+ STDERR.puts path if options[:verbose]
24
26
  $LOG.debug("Handling path #{path}")
25
27
  tree = Parser::CurrentRuby.parse_file(path)
26
28
  $LOG.debug("Parsed tree: #{tree}") if $LOG.debug?
@@ -35,7 +37,6 @@ module Dependencytree
35
37
  options[:pattern] = /.*\.rb/
36
38
  OptionParser.new do |opt|
37
39
  opt.on("-v", "--verbose", "Verbose output") do |o|
38
- # TBD
39
40
  options[:verbose] = true
40
41
  $LOG.debug("verbose")
41
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependencytree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephan Fuhrmann