Created
June 13, 2017 23:17
-
-
Save Daniel-Worrall/f26b271021b885180c534c4ab6849910 to your computer and use it in GitHub Desktop.
Crystal Project of a lot of mini projects from a list, from Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
file = File.open('list.txt', 'r') | |
File.open('shard.yml', 'w') do |f1| | |
f1.puts "name: 100projects\nversion: 0.1.0\n\nauthors:\n - <>\n\ntargets:\n" | |
while line = file.gets | |
filename = line.strip.gsub(/[^\w\.]/, '_').downcase | |
f1.puts " #{filename}:\n main: src/#{filename}/main.cr" | |
FileUtils::mkdir_p "src/#{filename}" | |
File.new "src/#{filename}/main.cr", 'w' | |
end | |
f1.puts "\ncrystal: 0.22.0\n\nlicense: MIT\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment