class Sk::Skeleton

Attributes

name[RW]

Public Class Methods

new(name, &block) click to toggle source
# File lib/sk/skeleton.rb, line 9
def initialize(name, &block)
  @name = name

  # check if dir already exists!
  FileUtils.mkdir(@name)
  FileUtils.cd(@name)

  block.call self

  # go back!
  FileUtils.cd('..')
end

Public Instance Methods

dir(name, &block) click to toggle source
# File lib/sk/skeleton.rb, line 28
def dir(name, &block)
  FileUtils.mkdir(name)
  FileUtils.cd(name)

  block.call if block

  FileUtils.cd('..')
end
file(name, options={}) click to toggle source
# File lib/sk/skeleton.rb, line 22
def file(name, options={})
  FileUtils.touch name
end
Also aliased as: touch
touch(name, options={})
Alias for: file