Class: CreateCommand

Inherits:
Command show all
Defined in:
lib/commands.rb

Overview

Create directories ###########################

Instance Attribute Summary

Attributes inherited from Command

#path

Instance Method Summary collapse

Methods inherited from Command

#<=>, #run, #transform

Constructor Details

#initialize(*args) ⇒ CreateCommand

Returns a new instance of CreateCommand.



108
109
110
# File 'lib/commands.rb', line 108

def initialize *args
  (@dirname, @path)=args
end

Instance Method Details

#dirnameObject



112
# File 'lib/commands.rb', line 112

def dirname ; transform @dirname ; end

#dry_runObject



114
115
116
# File 'lib/commands.rb', line 114

def dry_run
  "mkdir #{dirname}"
end

#priorityObject



106
# File 'lib/commands.rb', line 106

def priority ; 1 ; end

#real_runObject



118
119
120
# File 'lib/commands.rb', line 118

def real_run
  FileUtils.mkdir_p dirname
end