-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrace.rb
48 lines (38 loc) · 1.03 KB
/
trace.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This code is used for prototyping, all has been converted to golang code
# class Trace
# def initialize()
# @path = $work_dir
# @git_folders = []
# @git_paths = []
# end
# def list
# recursive_read
# truncate_git_folders
# @git_paths
# .map! { |git_path| git_path.join("/") }
# .each { |git_path| puts git_path }
# puts "DescSec"
# @git_paths.each do |git_path|
# pathname = "#{@path}/#{git_path}/.git/description"
# puts File.read(pathname)
# end
# end
# def recursive_read
# Dir.glob("**/*/", File::FNM_DOTMATCH, base: @path) do |entry_name|
# # @git_folders << entry_name if entry_name.include?(".git/")
# puts @path
# puts entry_name
# end
# end
# def truncate_git_folders
# @git_folders.each do |entry_name|
# dot_path = entry_name.split("/")
# if dot_path.last == ".git"
# dot_path.pop # get rid of ".git"
# @git_paths << dot_path
# end
# end
# end
# end
# $work_dir = ARGV[0]
# Trace.new.list