<commit_before># This is kind of naughty, I know,
# but we need to know what will the state be once RxSwift is deployed.

set -e

BRANCH=$(git rev-parse --abbrev-ref HEAD)
ESCAPED_SOURCE=$(pwd | sed -E "s/\//\\\\\//g")

function cleanup {
  pushd ~/.cocoapods/repos/master
  git clean -d -f
  git reset master --hard
  popd
}

trap cleanup EXIT

VERSION=`cat RxSwift.podspec | grep -E "s.version\s+=" | cut -d '"' -f 2`
TARGETS=(RxTest RxCocoa RxBlocking RxSwift)

pushd ~/.cocoapods/repos/master/Specs
for TARGET in ${TARGETS[@]}
do
  mkdir -p ${TARGET}/${VERSION}
done
popd

for TARGET in ${TARGETS[@]}
do

  mkdir -p ~/.cocoapods/repos/master/Specs/${TARGET}/${VERSION}
  rm       ~/.cocoapods/repos/master/Specs/${TARGET}/${VERSION}/* || echo

  cat $TARGET.podspec |
  sed -E "s/s.source[^\}]+\}/s.source           = { :git => '${ESCAPED_SOURCE}', :branch => \'${BRANCH}\' }/" > ~/.cocoapods/repos/master/Specs/${TARGET}/${VERSION}/${TARGET}.podspec
done

function validate() {
    local PODSPEC=$1

    ~/Projects/CocoaPods/bin/pod lib lint $PODSPEC --verbose --no-clean --allow-warnings # temporary allow warning because of deprecated API in rc
    #pod lib lint $PODSPEC --verbose --no-clean --allow-warnings # temporary allow warning because of deprecated API in rc
}

for TARGET in ${TARGETS[@]}
do

validate ${TARGET}.podspec

done<commit_msg>Workarounds because of CocoaPods meets Swift 3.0<commit_after># This is kind of naughty, I know,
# but we need to know what will the state be once RxSwift is deployed.

set -e

BRANCH=$(git rev-parse --abbrev-ref HEAD)
ESCAPED_SOURCE=$(pwd | sed -E "s/\//\\\\\//g")

function cleanup {
  pushd ~/.cocoapods/repos/master
  git clean -d -f
  git reset master --hard
  popd
}

trap cleanup EXIT

VERSION=`cat RxSwift.podspec | grep -E "s.version\s+=" | cut -d '"' -f 2`
TARGETS=(RxTest RxCocoa RxBlocking RxSwift)

pushd ~/.cocoapods/repos/master/Specs
for TARGET in ${TARGETS[@]}
do
  mkdir -p ${TARGET}/${VERSION}
done
popd

for TARGET in ${TARGETS[@]}
do

  mkdir -p ~/.cocoapods/repos/master/Specs/${TARGET}/${VERSION}
  rm       ~/.cocoapods/repos/master/Specs/${TARGET}/${VERSION}/* || echo

  cat $TARGET.podspec |
  sed -E "s/s.source[^\}]+\}/s.source           = { :git => '${ESCAPED_SOURCE}', :branch => \'${BRANCH}\' }/" > ~/.cocoapods/repos/master/Specs/${TARGET}/${VERSION}/${TARGET}.podspec
done

function validate() {
    local PODSPEC=$1

    # custom cocoapods installation is because of CocoaPods incompatiblity with Swift 3
    cd ~/.cocoapods/repos/master/; ~/Projects/CocoaPods/bin/pod lib lint ~/Projects/RxSwift/${PODSPEC} --verbose --no-clean --allow-warnings # temporary allow warning because of deprecated API in rc
    #pod lib lint $PODSPEC --verbose --no-clean --allow-warnings # temporary allow warning because of deprecated API in rc
}

for TARGET in ${TARGETS[@]}
do

validate ${TARGET}.podspec

done
{'fraction_non_alphanumeric': 0.16475893166840097, 'fraction_numerical': 0.002428026361429067, 'mean_word_length': 3.3696969696969696, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '2199933', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1028, 'n_words': 296}