<commit_before>#!/bin/bash
#
# usage: $ bash Brewfile.sh
#
# To be installed by App Store in advance
# Xcode, Evernote, LINE, Yorufukurou, The Unaarchiver, 1password, Degrees

# homebrewが入っているか確認
if [ ! `which brew` ]; then
    echo "You don't have homebrew! Start Installing."
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    brew install brew-cask
    echo "Homebrew installation Done! Please type 'brew install'."
    exit
fi

export HOMEBREW_CASK_OPTS="--appdir=/Applications"

echo "Do you 'brew update'? This takes a few minutes. (recommended) [Y/n]"
echo -n "> "
read update
echo "OK, next, do you 'brew cask update'? This takes a few minutes. (recommended) [Y/n]"
echo -n "> "
read caskupdate
echo  "OK, at last, do you 'brew upgrade'? This takes a lot of times. [y/N]"
echo -n "> "
read upgrade

# brew update
if [ ! "${update,,}" = "n" -a ! "${update,,}" = "no" ]; then
    echo "Updating Homebrew... "
    brew update
    echo "Done!"
fi

# brew cask update
if [ ! "${caskupdate,,}" = "n" -a ! "${caskupdate,,}" = "no" ]; then
    echo "Updating Homebrew Cask... "
    brew cask update
    echo "Done!"
fi

# brew upgrade
if [ "${upgrade,,}" = "y" -o "${upgrade,,}" = "yes" ]; then
    echo -n "Upgrading Homebrew... "
    brew update
    echo "Done!"
fi

BASICS="vim brew-cask gcc pwgen tree git bash trash wget tmux"
echo "Installing Basic packages... "
brew install $BASICS
echo "Done!"

RUBY="ruby-build rbenv"
echo "Installing Ruby packages... "
brew install $RUBY
echo "Done!"

GEMS="bundle chef knife-solo berkshelf berkshelf kitchen-vagrant test-kitchen knife-solo_data_bag"
echo "Installing Chef packages... "
gem install $GEMS
echo "Done!"

CASKS="bettertouchtool menumeters vlc rescuetime firefox google-chrome karabiner cyberduck
    iterm2 dropbox virtualbox vagrant mysqlworkbench google-japanese-ime github macvim-kaoriya cocoarestclient cacoo-ninja"
echo "Installing Cask packages... "
brew cask install $CASKS
echo "Done!"<commit_msg>brewfileにgem updateとvagrant pluginを追加<commit_after>#!/bin/bash
#
# usage: $ bash Brewfile.sh
#
# To be installed by App Store in advance
# Xcode, Evernote, LINE, Yorufukurou, The Unaarchiver, 1password, Degrees

# homebrewが入っているか確認
if [ ! `which brew` ]; then
    echo "You don't have homebrew! Start Installing."
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    brew install brew-cask
    echo "Homebrew installation Done! Please type 'brew install'."
    exit
fi

export HOMEBREW_CASK_OPTS="--appdir=/Applications"

echo "Do you 'brew update'? This takes a few minutes. (recommended) [Y/n]"
echo -n "> "
read update
echo "OK, next, do you 'brew cask update'? This takes a few minutes. (recommended) [Y/n]"
echo -n "> "
read caskupdate
echo  "OK, at last, do you 'brew upgrade'? This takes a lot of times. [y/N]"
echo -n "> "
read upgrade

# brew update
if [ ! "${update,,}" = "n" -a ! "${update,,}" = "no" ]; then
    echo "Updating Homebrew... "
    brew update
    echo "Done!\n"
fi

# brew cask update
if [ ! "${caskupdate,,}" = "n" -a ! "${caskupdate,,}" = "no" ]; then
    echo "Updating Homebrew Cask... "
    brew cask update
    echo "Done!\n"
fi

# brew upgrade
if [ "${upgrade,,}" = "y" -o "${upgrade,,}" = "yes" ]; then
    echo -n "Upgrading Homebrew... "
    brew update
    echo "Done!\n"
fi

BASICS="vim brew-cask gcc pwgen tree git bash trash wget tmux"
echo "Installing Basic packages... "
brew install $BASICS
echo "Done!\n"

RUBY="ruby-build rbenv"
echo "Installing Ruby packages... "
brew install $RUBY
printf "Done!\n\n"

GEMS="bundler chef knife-solo berkshelf kitchen-vagrant test-kitchen knife-solo_data_bag"
echo "Installing gem packages... "
for pkg in $GEMS; do
    gem list | grep $pkg > /dev/null
    ec=$?
    if [ ! $ec -eq 0 ]; then
        echo $pkg
        gem install $pkg
    else
        echo "gem package \"${pkg}\" is already installed. (Up to date)"
    fi
done
printf "Done!\n\n"

gem update

echo "Installing vagrant plugins..."
VAGRANT="vagrant-omnibus vagrant-vbguest vagrant-cachier sahara vagrant-global-status vagrant-vbox-snapshot"
for pkg in $VAGRANT; do
    vagrant plugin list | grep $pkg > /dev/null
    ec=$?
    if [ ! $ec -eq 0 ]; then
        vagrant plugin install $pkg
    else
        echo "vagrant plugin \"${pkg}\" is already installed. (Up to date)"
    fi
done
printf "Done!\n\n"

CASKS="bettertouchtool menumeters vlc rescuetime firefox google-chrome karabiner \
    cyberduck iterm2 dropbox virtualbox vagrant mysqlworkbench google-japanese-ime github \
    macvim-kaoriya cocoarestclient adobe-air cacoo-ninja"
echo "Installing Cask packages... "
brew cask install $CASKS
printf "Done!\n"
{'fraction_non_alphanumeric': 0.13486005089058525, 'fraction_numerical': 0.001272264631043257, 'mean_word_length': 3.535576923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '44021', 'n_tokens_mistral': 1702, 'n_tokens_neox': 1613, 'n_words': 552}