summaryrefslogtreecommitdiff
path: root/gicli.rb
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-07-14 12:53:51 +0100
committerKatharina Fey <kookie@spacekookie.de>2019-07-14 12:53:51 +0100
commit1ce38d67294676ebc810f7c75af1e998b23fe702 (patch)
treee9cb072aeb2e36a02de414fe78fbe0845f40c65e /gicli.rb
Initial working version
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__
+ __ _ __ _ _ _
+ / _` |/ _` | | | |
+| (_| | (_| | |_| |
+ \__, |\__,_|\__, |
+ |___/ |___/
+