sigsurv 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sigsurv/version.rb +1 -1
- data/lib/sigsurv.rb +3 -3
- metadata +1 -1
data/lib/sigsurv/version.rb
CHANGED
data/lib/sigsurv.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require "sigsurv/version"
|
2
2
|
|
3
3
|
module Sigsurv
|
4
|
-
SYMBOLS =
|
4
|
+
SYMBOLS = {module: "m", class: "c", def: "d", do: "o", e: "e"}
|
5
5
|
def self.analyze(directory)
|
6
|
-
Dir["#{directory}
|
6
|
+
Dir["#{directory}/**/*\.rb"].map do |file_path|
|
7
7
|
contents = IO.read(file_path)
|
8
|
-
[file_path, contents.scan(/#{SYMBOLS.join("|")}/).map{|x| x.
|
8
|
+
[file_path, contents.scan(/#{SYMBOLS.keys.join("|")}/).map{|x| SYMBOLS[x.to_sym]}.join]
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|