lib/flame/generators/base.rb in flamerb-0.1.2 vs lib/flame/generators/base.rb in flamerb-0.1.3
- old
+ new
@@ -2,12 +2,10 @@
require "rails/generators/base"
module Flame
module Generators
class Base < Rails::Generators::Base
- source_root File.expand_path("../../../templates", __dir__)
-
private
# @param [Array] packages
# @return [void]
# @example
@@ -20,9 +18,15 @@
# @return [void]
# @example
# yarn_install_dev(["vite", "react", "react-dom"])
def yarn_install_dev(packages)
run("yarn add -D #{packages.join(" ")} --silent")
+ end
+
+ class << self
+ def source_root
+ File.expand_path("../../../templates", __dir__)
+ end
end
end
end
end