Module: Google::Cloud::Debugger::Debuggee::AppUniquifierGenerator

Defined in:
lib/google/cloud/debugger/debuggee/app_uniquifier_generator.rb

Overview

Generates an application debuggee uniquifier by hashing the application file stats.

Constant Summary collapse

MAX_DEPTH =

Max number of directory levels the generator looks into.

10

Class Method Summary collapse

Class Method Details

.generate_app_uniquifier(sha, app_path = nil) ⇒ NilClass

Computes the application uniquifier by examine the file stats of the files in the given application root directory. It only looks at .rb files and Gemfile.lock

Parameters:

  • sha (Digest::SHA)

    A digest SHA object used to add the hashing values

  • app_path (String) (defaults to: nil)

    Application root directory where the Ruby application is located.

Returns:

  • (NilClass)


44
45
46
47
48
49
50
51
52
53
54
# File 'lib/google/cloud/debugger/debuggee/app_uniquifier_generator.rb', line 44

def self.generate_app_uniquifier sha, app_path = nil
  app_path ||= if defined?(::Rack::Directory)
                 Rack::Directory.new("").root
               else
                 Dir.getwd
               end

  process_directory sha, app_path

  nil
end