From 9be7363d8e9a04e14866768d8ccc166e24c77e84 Mon Sep 17 00:00:00 2001 From: Jerry Cheung Date: Fri, 18 Sep 2015 10:29:49 -0700 Subject: [PATCH 1/5] add script/changelog --- README.rdoc | 2 +- script/changelog | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100755 script/changelog diff --git a/README.rdoc b/README.rdoc index 89b2d7d7..7980c403 100644 --- a/README.rdoc +++ b/README.rdoc @@ -56,7 +56,7 @@ To run the integration tests against an LDAP server: This section is for gem maintainers to cut a new version of the gem. * Update lib/net/ldap/version.rb to next version number X.X.X following {semver}(http://semver.org/). -* Update `History.rdoc`. Get latest changes with `git log --oneline vLAST_RELEASE..HEAD | grep Merge` +* Update `History.rdoc`. Get latest changes with `script/changelog` * On the master branch, run `script/release` diff --git a/script/changelog b/script/changelog new file mode 100755 index 00000000..cda2ad83 --- /dev/null +++ b/script/changelog @@ -0,0 +1,47 @@ +#!/bin/bash +# Usage: script/changelog [-r ] [-b ] [-h ] +# +# repo: BASE string of GitHub REPOsitory url. e.g. "user_or_org/REPOsitory". Defaults to git remote url. +# base: git ref to compare from. e.g. "v1.3.1". Defaults to latest git tag. +# head: git ref to compare to. Defaults to "HEAD". +# +# Generate a changelog preview from pull requests merged between `base` and +# `head`. +# +# https://github.com/jch/release-scripts/blob/master/changelog +set -e + +[ $# -eq 0 ] && set -- --help +while [[ $# > 1 ]] +do + key="$1" + case $key in + -r|--repo) + repo="$2" + shift + ;; + -b|--base) + base="$2" + shift + ;; + -h|--head) + head="$2" + shift + ;; + *) + ;; + esac + shift +done + +repo="${repo:-$(git remote -v | grep push | awk '{print $2}' | cut -d'/' -f4- | sed 's/\.git//')}" +base="${base:-$(git tag -l | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -n 1)}" +head="${head:-HEAD}" +api_url="https://api.github.com" + +# get merged PR's. Better way is to query the API for these, but this is easier +for pr in $(git log --oneline $base..$head | grep "Merge pull request" | awk '{gsub("#",""); print $5}') +do + # frustrated with trying to pull out the right values, fell back to ruby + curl -s "$api_url/repos/$repo/pulls/$pr" | ruby -rjson -e 'pr=JSON.parse(STDIN.read); puts "* #{pr[%q(title)]} {##{pr[%q(number)]}}[#{pr[%q(html_url)]}]"' +done From f45e7ff32c7c6e7faee877bba7409006eb3cee4b Mon Sep 17 00:00:00 2001 From: Jerry Cheung Date: Fri, 18 Sep 2015 10:30:23 -0700 Subject: [PATCH 2/5] bump version 0.12 --- History.rdoc | 13 +++++++++++++ lib/net/ldap/version.rb | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index fa7ff5a1..70e92eee 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,16 @@ +=== Net::LDAP 0.12 + +* Correctly set BerIdentifiedString values to UTF-8 {#212}[https://github.com/ruby-ldap/ruby-net-ldap/pull/212] +* Raise Net::LDAP::ConnectionRefusedError when new connection is refused. {#213}[https://github.com/ruby-ldap/ruby-net-ldap/pull/213] +* obscure auth password upon #inspect, added test, closes #216 {#217}[https://github.com/ruby-ldap/ruby-net-ldap/pull/217] +* Fixing incorrect error class name {#207}[https://github.com/ruby-ldap/ruby-net-ldap/pull/207] +* Travis update {#205}[https://github.com/ruby-ldap/ruby-net-ldap/pull/205] +* Remove obsolete rbx-19mode from Travis {#204}[https://github.com/ruby-ldap/ruby-net-ldap/pull/204] +* mv "sudo" from script/install-openldap to .travis.yml {#199}[https://github.com/ruby-ldap/ruby-net-ldap/pull/199] +* Remove meaningless shebang {#200}[https://github.com/ruby-ldap/ruby-net-ldap/pull/200] +* Fix Travis CI build {#202}[https://github.com/ruby-ldap/ruby-net-ldap/pull/202] +* README.rdoc: fix travis link {#195}[https://github.com/ruby-ldap/ruby-net-ldap/pull/195] + === Net::LDAP 0.11 * Major enhancements: * #183 Specific errors subclassing Net::LDAP::Error diff --git a/lib/net/ldap/version.rb b/lib/net/ldap/version.rb index 98d557cf..1d0f6b08 100644 --- a/lib/net/ldap/version.rb +++ b/lib/net/ldap/version.rb @@ -1,5 +1,5 @@ module Net class LDAP - VERSION = "0.11" + VERSION = "0.12" end end From c005e67a5796e36c5c37771368717df9cd0543c9 Mon Sep 17 00:00:00 2001 From: Jerry Cheung Date: Fri, 18 Sep 2015 10:30:40 -0700 Subject: [PATCH 3/5] update readme for release instructions --- README.rdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rdoc b/README.rdoc index 7980c403..7f774e31 100644 --- a/README.rdoc +++ b/README.rdoc @@ -55,10 +55,11 @@ To run the integration tests against an LDAP server: This section is for gem maintainers to cut a new version of the gem. +* Check out a new branch `release-VERSION` * Update lib/net/ldap/version.rb to next version number X.X.X following {semver}(http://semver.org/). * Update `History.rdoc`. Get latest changes with `script/changelog` - -* On the master branch, run `script/release` +* Open a pull request with these changes for review +* After merging, on the master branch, run `script/release` :include: Contributors.rdoc From 98d122d3f94707e2367da8353ee2610ec095ff7c Mon Sep 17 00:00:00 2001 From: Jerry Cheung Date: Fri, 18 Sep 2015 17:42:23 -0700 Subject: [PATCH 4/5] follow semver --- lib/net/ldap/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/ldap/version.rb b/lib/net/ldap/version.rb index 1d0f6b08..219b4156 100644 --- a/lib/net/ldap/version.rb +++ b/lib/net/ldap/version.rb @@ -1,5 +1,5 @@ module Net class LDAP - VERSION = "0.12" + VERSION = "0.12.0" end end From 777438da6cf28581ef7c05703c09855f062f1574 Mon Sep 17 00:00:00 2001 From: Jerry Cheung Date: Fri, 18 Sep 2015 17:43:01 -0700 Subject: [PATCH 5/5] missed a spot --- History.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index 70e92eee..40b45255 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,4 +1,4 @@ -=== Net::LDAP 0.12 +=== Net::LDAP 0.12.0 * Correctly set BerIdentifiedString values to UTF-8 {#212}[https://github.com/ruby-ldap/ruby-net-ldap/pull/212] * Raise Net::LDAP::ConnectionRefusedError when new connection is refused. {#213}[https://github.com/ruby-ldap/ruby-net-ldap/pull/213]