codegraph 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/gemspec +1 -1
  2. data/lib/codegraph.rb +7 -5
  3. metadata +2 -2
data/gemspec CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  spec = Gem::Specification.new do |s|
4
4
  s.name = "codegraph"
5
- s.version = "0.7.1"
5
+ s.version = "0.7.2"
6
6
  s.date = "2010-11-01"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.bindir = 'bin'
data/lib/codegraph.rb CHANGED
@@ -28,13 +28,13 @@ class FunctionGraph < RGL::DirectedAdjacencyGraph
28
28
  Funx = {"php" => "function",
29
29
  "perl" => "subroutine",
30
30
  "c" => "function",
31
- "f" => "subroutine",
31
+ "f" => "subroutine",
32
32
  "sh" => "function"}
33
33
 
34
34
  @@home = `echo $HOME`.chomp
35
35
  @@codehomedir = "#{@@home}/.codegraph"
36
36
  @@internal_funx = []
37
- @@matchBeforFuncName = '[^A-z0-9_]'
37
+ @@matchBeforFuncName = '[^A-z0-9_]\s*'
38
38
  @@matchAfterFuncName = '\('
39
39
 
40
40
  # Generate the codegraph storage directory
@@ -67,7 +67,8 @@ class FunctionGraph < RGL::DirectedAdjacencyGraph
67
67
  temfile = "_" + basefile
68
68
  case File.extname(file)
69
69
  when '.c','.h'
70
- cppCommand = "cpp -w -fpreprocessed -E -fdirectives-only #{file} -o #{@@codehomedir}/#{temfile}"
70
+ cppCommand = "cpp -w -fpreprocessed -E -fdirectives-only #{file} -o #{@@codehomedir}/#{temfile} 2>/dev/null"
71
+ cppCommand = "cpp -fpreprocessed #{file} -o #{@@codehomedir}/#{temfile} 2>/dev/null"
71
72
  grep = "grep -v -e '^$' #{temfile} | grep -v -e '^#' > #{basefile}"
72
73
  when '.f','.f77','.f90','.f95'
73
74
  cppCommand = "cp #{file} #{@@codehomedir}/#{temfile}"
@@ -80,7 +81,7 @@ class FunctionGraph < RGL::DirectedAdjacencyGraph
80
81
  gen4ctags = "ctags -x #{ctagsKinds} #{basefile} | sort -n -k 3 > " + funxFile
81
82
  command = [cppCommand,cd,grep,gen4ctags].join(";")
82
83
 
83
- puts command
84
+ puts command if false
84
85
  system(command)
85
86
 
86
87
  open(@@codehomedir+'/'+funxFile).readlines.each {|line|
@@ -130,9 +131,10 @@ class FunctionGraph < RGL::DirectedAdjacencyGraph
130
131
  # scan functions for the function names
131
132
  names = @funx.keys
132
133
  @funx.each_pair {|name,body|
134
+ puts "Add func: #{name}" if true
133
135
  add_vertex(name)
134
136
  (names - [name] + @@internal_funx).each { |func|
135
- add_edge("#{name}","#{func}") if /#@@matchBeforFuncName#{func}/.match(body)
137
+ add_edge("#{name}","#{func}") if/#@@matchBeforFuncName#{func}#@@matchAfterFuncName/.match(gbody)
136
138
  }
137
139
  }
138
140
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 1
9
- version: 0.7.1
8
+ - 2
9
+ version: 0.7.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ralf Mueller