15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/inline_forms/gem_files.rb', line 15
def gem_files(include_installer:)
files =
if File.directory?(File.join(REPO_ROOT, ".git"))
Dir.chdir(REPO_ROOT) do
tracked = `git ls-files`.split("\n")
untracked = `git ls-files --others --exclude-standard`.split("\n")
(tracked + untracked).uniq
end
else
Dir.chdir(REPO_ROOT) do
Dir.glob("**/*", File::FNM_DOTMATCH).reject do |f|
f.start_with?(".git/", ".bundle/", "pkg/") ||
f == ".git" || f == ".bundle"
end
end
end
files.select! { |f| File.file?(File.join(REPO_ROOT, f)) }
files.reject do |f|
installer_file = INSTALLER_FILE_PREFIXES.any? { |prefix| f == prefix || f.start_with?(prefix) }
include_installer ? !installer_file : installer_file
end
end
|