summaryrefslogtreecommitdiff
path: root/gicli.rb
diff options
context:
space:
mode:
Diffstat (limited to 'gicli.rb')
-rwxr-xr-xgicli.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/gicli.rb b/gicli.rb
new file mode 100755
index 0000000..93e858f
--- /dev/null
+++ b/gicli.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+
+dir = File.join(__dir__, "..", "gitignore")
+inputs = ARGV.map { |a| ["#{a.downcase}.gitignore", nil] }.to_h
+Dir
+ .entries(dir)
+ .select { |f| inputs.include?(f.downcase) }
+ .each do |f|
+ File.open(File.join(dir, f)) do |f|
+ IO.copy_stream(f, $stdout)
+ end
+ end
+
+__END__
+ __ _ __ _ _ _
+ / _` |/ _` | | | |
+| (_| | (_| | |_| |
+ \__, |\__,_|\__, |
+ |___/ |___/
+