We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7d1576 commit 05a45e4Copy full SHA for 05a45e4
linguist.rb
@@ -0,0 +1,16 @@
1
+require 'rugged'
2
+require 'linguist'
3
+require 'json'
4
+
5
+# Puts a JSON of language names and corresponding file names.
6
+def detect_code_files()
7
+ if ARGV.length != 1 then
8
+ puts 'Usage: ruby linguist.rb repo_path'
9
+ end
10
+ repo_path = ARGV[0]
11
+ repo = Rugged::Repository.new(repo_path)
12
+ project = Linguist::Repository.new(repo, repo.head.target_id)
13
+ puts JSON.generate(project.breakdown_by_file)
14
+end
15
16
+detect_code_files()
0 commit comments