Module: Rundoc::CodeCommand::FileUtil

Instance Method Summary collapse

Instance Method Details

#filenameObject



6
7
8
9
10
11
12
# File 'lib/rundoc/code_command/write.rb', line 6

def filename
  files = Dir.glob(@filename)
  if files.length > 1
    raise "Filename glob #{@filename.inspect} matched more than one file. Be more specific to only match one file. Matches:\n" + files.join("  \n")
  end
  files.first || @filename
end

#mkdir_pObject



14
15
16
17
# File 'lib/rundoc/code_command/write.rb', line 14

def mkdir_p
  dir = File.expand_path("../", filename)
  FileUtils.mkdir_p(dir)
end