README.md in flexdot-1.0.2 vs README.md in flexdot-2.0.0

- old
+ new

@@ -1,7 +1,8 @@ # Flexdot +[![Gem Version](https://badge.fury.io/rb/flexdot.svg)](https://badge.fury.io/rb/flexdot) [![Test](https://github.com/hidakatsuya/flexdot/workflows/Test/badge.svg?branch=master)](https://github.com/hidakatsuya/flexdot/actions?query=workflow%3ATest) A Flexible and Rake based dotfile manager. ## Getting Started @@ -10,29 +11,52 @@ Ruby 2.5+ ### Installing -Install it as: +Create the following directory structure: - $ gem install flexdot - -Then, create the following directory structure: - ``` $HOME/ - dotfiles/ +├── dotfiles/ +: ``` -Create a `$HOME/dotfiles/Rakefile` with the following codes: +Create a `Gemfile` to install Flexdot: + $ cd $HOME/dotfiles + $ bundle init + +Add this line to the `Gemfile`: + ```ruby +gem 'flexdot' +``` + +Or install it yourself as: + + $ gem install flexdot + +Then, create a `$HOME/dotfiles/Rakefile` with the following codes: + +```ruby require 'flexdot' -Flexdot.install_tasks( - base_dir: '.', # $HOME/dotfiles/ - target_dir: '/home/username' # $HOME/ +Flexdot.setup( + home_dir: '/home/username', + + # (optional) + # The dotfile directory path. + # Default '.'. + dotfiles_dir: '.', + + # (optional) + # The `rake install` command will be available to install the dotfile for the specified index file. + # Default nil. + # + # Note that the `rake install` command is always available if you have a single index file. + default_index: 'name_of_an_index_file' ) ``` Finally, run `rake -T` in the `$HOME/dotfiles` and make sure that the output is as follows: @@ -92,16 +116,28 @@ ├── macOS.yml ├── ubuntu.yml └── Rakefile ``` +### Rakefile + +```ruby +require 'flexdot' + +Flexdot.setup( + home_dir: '..', + default_index: 'macOS' +) +``` + ### Available Commands When you run the `rake -T` command in that directory structure, you should have two installation commands available: $ rake -T rake clear_backups # Clear all backups + rake install # Install dotfiles for macOS rake install:macOS # Install dotfiles for macOS rake install:ubuntu # Install dotfiles for ubuntu ### Dotfile Index File @@ -174,9 +210,13 @@ start.sh: .xkeysnail stop.sh: .xkeysnail ``` ### Installing dotfiles + + $ rake install + +Or $ rake install:macOS The following is the output result: