Created
November 19, 2013 08:06
-
-
Save burennto/7541933 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: utf-8 | |
| require 'awesome_print' | |
| require 'git' | |
| require 'grit' | |
| require 'fileutils' | |
| WORK_DIR = '/tmp/git_add' | |
| FileUtils.rm_rf(WORK_DIR) | |
| FileUtils.mkdir_p(WORK_DIR) | |
| `cd #{WORK_DIR} && git init .` | |
| `cd #{WORK_DIR} && touch README` | |
| `cd #{WORK_DIR} && touch リードミー` | |
| `cd #{WORK_DIR} && git add .` | |
| `cd #{WORK_DIR} && git commit -m "Add files"` | |
| Dir.chdir(WORK_DIR) do | |
| FileUtils.touch 'abcde.html' | |
| FileUtils.touch 'あいうえお.html' | |
| FileUtils.mkdir_p('templates/.config') | |
| FileUtils.touch 'templates/.config/pushto' | |
| FileUtils.mkdir_p('.dot-dir') | |
| FileUtils.touch '.dot-dir/file.txt' | |
| FileUtils.touch '.dot-file' | |
| end | |
| ap Grit::Repo.new(WORK_DIR).status.untracked.keys | |
| ap Git.open(WORK_DIR).status.untracked.keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment