Top Level Namespace

Defined Under Namespace

Modules: BlogHelper, SimpleBlogHelper, Standard Classes: BlogController, HomeController, Post, PostHTMLRender, SimpleBlog

Instance Method Summary collapse

Instance Method Details

#copy_template_file(path) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/simpleblog/rake.rb', line 31

def copy_template_file(path)
  gem_path = File.dirname(__dir__)

  if File.exist?(path)
    $stdout.puts "#{path} already exist. Do you want to override? (y/n) default: y"
    input = $stdin.gets.chomp

    return if input == "n"

    p "Overriden: #{path}"
  else
    p "Created: #{path}"
  end

  copy_file("#{gem_path}/simpleblog/template/#{path}", path)
end