I use Thor to copy the contents of one folder to another, here is my code:
module Generators module App class New < Thor::Group include Thor::Actions desc "Generate a new customer gem structure" argument :name argument :pascal_case_name def self.source_root File.expand_path("../../templates", __dir__) end def create directory("app", name.to_s) end
The problem is that files that start with a dot, for example .gitignore
or .env
, are not copied. I had to remove the dot at the beginning of such files, but this does not suit me.
I tried to use the debugger for the directory method, but I didn't see anything suspicious there.