sigsurv 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/sigsurv/version.rb +1 -1
  2. data/lib/sigsurv.rb +3 -3
  3. metadata +1 -1
@@ -1,3 +1,3 @@
1
1
  module Sigsurv
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/lib/sigsurv.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  require "sigsurv/version"
2
2
 
3
3
  module Sigsurv
4
- SYMBOLS = %w(module class def do end)
4
+ SYMBOLS = {module: "m", class: "c", def: "d", do: "o", e: "e"}
5
5
  def self.analyze(directory)
6
- Dir["#{directory}/**/*rb"].map do |file_path|
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.split(//).first}.join]
8
+ [file_path, contents.scan(/#{SYMBOLS.keys.join("|")}/).map{|x| SYMBOLS[x.to_sym]}.join]
9
9
  end
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sigsurv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: