我正在尝试使用Thor模板方法。但是当我为我的案例编写规范时,事实证明脚本没有看到模板目录
/crx
/lib
/templates
manifest
command.rb
module Crx
class Command < Thor
include Thor::Actions
def self.source_root
File.dirname(__FILE__)
end
desc "add", "add extension files like manifest, content_script"
def add(name)
template 'templates/manifest'
end
end
end
Crx::Command should create manifest
Thor::Error:
Could not find "templates/manifest" in any of your source paths. Your current source paths are:
/home/lewy/Programowanie/ruby/crx/lib/crx