Sha256: c2b460aa05f6910bec2d7054315ccd5f9b86c02a6e87f245ddefc05e02754811

Contents?: true

Size: 652 Bytes

Versions: 1

Compression:

Stored size: 652 Bytes

Contents

require 'fileutils'
require 'file_helper'

class NewCommand
  attr_accessor :dir

  def initialize(dir)
    @dir = dir.to_s
    @file_helper = FileHelper.new(dir)
  end

  def execute
    FileUtils.mkdir_p([
      "#{ @dir }/_drafts",
      "#{ @dir }/_includes",
      "#{ @dir }/_layouts",
      "#{ @dir }/_pages",
      "#{ @dir }/_posts",
      "#{ @dir }/_site"
    ])

    blog_name = 'My First Blog'
    tagline = 'A short description of my blog'
    desc = 'Site description'

    @file_helper.new_file("_config.yml",
                          "---\nsite:\n  name: #{ blog_name }\n  tagline: #{ tagline }\n  description: #{ desc }")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ignoramos-1.1.0 lib/commands/new_command.rb