lib/vedeu/generator/helpers.rb in vedeu-0.4.37 vs lib/vedeu/generator/helpers.rb in vedeu-0.4.38
- old
+ new
@@ -18,16 +18,41 @@
name.tr!('-', '_')
name.downcase!
name
end
+ # @param destination [String]
+ # @return [void]
+ def make_directory(destination)
+ Vedeu.log_stdout(type: :create, message: "#{destination}")
+
+ FileUtils.mkdir_p(destination)
+ end
+
# @param source [String]
# @param destination [String]
# @return [void]
+ def copy_file(source, destination)
+ Vedeu.log_stdout(type: :create, message: "#{destination}")
+
+ FileUtils.cp(source, destination)
+ end
+
+ # @param source [String]
+ # @param destination [String]
+ # @return [void]
def make_file(source, destination)
- Vedeu.log_stdout(type: :create, message: "Writing: '#{destination}'")
+ Vedeu.log_stdout(type: :create, message: "#{destination}")
File.write(destination, parse(source))
+ end
+
+ # @param destination [String]
+ # @return [void]
+ def touch_file(destination)
+ Vedeu.log_stdout(type: :create, message: "#{destination}")
+
+ FileUtils.touch(destination)
end
# @return [String]
def name
@_name ||= @name.downcase