Project

mkfiles

0.0
No commit activity in last 3 years
No release in over 3 years
A gem for generating directories, subdirectiories and empty files based on paths from a yaml file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.16.a
~> 10.0
~> 3.0
 Project Readme

Mkfiles

A gem for generating directories, subdirectiories and empty files automaticaly based on paths from a yaml file.

For now it doesn't delete any file but it will overwrite if there are any conflicts.

Installation

Add this line to your application's Gemfile:

gem 'mkfiles'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mkfiles

Usage

Reqiure module and method.

require "mkfiles/generate_from_file"

Use it.

Mkfiles.generate_from_file("sample.yml")

Put a path to your yml file. Pay attention for your current working directory if you are using relative start place in your yml file.

Yaml files

The path to a yaml file must be passed as an argument for the script. It contains the start place path (for example "." for current dirrectory) and relative paths for all entries (directories, subdirectories and empty files) that will be created.

Start place can be relative or absolute.

Sub paths for directories and subdirectories must ended with "/".

Use "/" as the directory separator.

An example of yaml file

start_place: "."

sub_paths:
  - random_directory_341234213/
  - ewqrfsd.txt
  - vdfewre/fwewfevc.txt
  - qewasdsdf/sd23e2fv/wfe32gv/d322fvgd/
  - qewasdsdf/sd23e2fv/dwqqwdqwef/
  - New Folderr53453/New Folder44444574/new document63452.txt

To do features

  • CLI commands
  • Template yml file generator

License

The gem is available as open source under the terms of the MIT License.