Versioning will now be lockstep, bumped to 0.0.3

This commit is contained in:
Michael Bleigh 2010-05-01 15:07:56 -04:00
parent 240d691253
commit 4495e4306b
11 changed files with 83 additions and 26 deletions

View File

@ -4,24 +4,83 @@ require 'term/ansicolor'
include Term::ANSIColor
OMNIAUTH_GEMS = %w(omniauth oa-core oa-oauth oa-openid)
OMNIAUTH_GEMS = %w(oa-core oa-oauth oa-openid omniauth)
def each_gem(action, &block)
OMNIAUTH_GEMS.each_with_index do |dir, i|
print blue, "\n\n== ", cyan, dir, blue, " ", action, clear, "\n\n"
Dir.chdir(dir, &block)
end
end
def version_file
File.dirname(__FILE__) + '/VERSION'
end
def version
File.open(version_file, 'r').read.strip
end
def bump_version(position)
v = version
v = v.split('.').map{|s| s.to_i}
v[position] += 1
write_version(*v)
end
def write_version(major, minor, patch)
major = nil if major == ''
minor = nil if minor == ''
patch = nil if patch == ''
v = version
v = v.split('.').map{|s| s.to_i}
v[0] = major || v[0]
v[1] = minor || v[1]
v[2] = patch || v[2]
File.open(version_file, 'w'){ |f| f.write v.map{|i| i.to_s}.join('.') }
puts "Version is now: #{version}"
end
desc 'Run specs for all of the gems.'
task :spec do
OMNIAUTH_GEMS.each_with_index do |dir, i|
Dir.chdir(dir) do
print blue, "\n\n== ", cyan, dir, blue, " specs are running...", clear, "\n\n"
system('rake spec')
end
each_gem('specs are running...') do
system('rake spec')
end
end
desc 'Push all gems to Gemcutter'
task :gemcutter do
OMNIAUTH_GEMS.each_with_index do |dir, i|
Dir.chdir(dir) { system('rake gemcutter') }
each_gem('is releasing to Gemcutter...') do
system('rake gemcutter')
end
end
task :default => :spec
desc 'Build all gems'
task :build do
each_gem('is releasing to Gemcutter...') do
system('rake gemcutter')
end
end
desc 'Display the current version.'
task :version do
puts "Current Version: #{version}"
end
namespace :version do
desc "Write version with MAJOR, MINOR, and PATCH level env variables."
task :write do
write_version(ENV['MAJOR'], ENV['MINOR'], ENV['PATCH'])
end
namespace :bump do
task(:major){ bump_version(0) }
task(:minor){ bump_version(1) }
task(:patch){ bump_version(2) }
end
end
task :default => :spec

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.0.3

View File

@ -1 +0,0 @@
0.0.1

View File

@ -1,4 +1,4 @@
version = File.open(File.dirname(__FILE__) + '/VERSION', 'r').read.strip
version = File.open(File.dirname(__FILE__) + '/../VERSION', 'r').read.strip
Gem::Specification.new do |gem|
gem.name = "oa-basic"
@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE.rdoc CHANGELOG.rdoc)
gem.add_dependency 'oa-core', "~> #{version.gsub(/\d$/,'0')}"
gem.add_dependency 'oa-core', version
gem.add_dependency 'restclient'
gem.add_development_dependency "rspec", ">= 1.2.9"

View File

@ -1 +0,0 @@
0.0.1

View File

@ -1,6 +1,8 @@
version = File.open(File.dirname(__FILE__) + '/../VERSION', 'r').read.strip
Gem::Specification.new do |gem|
gem.name = "oa-core"
gem.version = File.open(File.dirname(__FILE__) + '/VERSION', 'r').read.strip
gem.version = version
gem.summary = %Q{HTTP Basic strategies for OmniAuth.}
gem.description = %Q{HTTP Basic strategies for OmniAuth.}
gem.email = "michael@intridea.com"

View File

@ -1 +0,0 @@
0.0.1

View File

@ -1,4 +1,4 @@
version = File.open(File.dirname(__FILE__) + '/VERSION', 'r').read.strip
version = File.open(File.dirname(__FILE__) + '/../VERSION', 'r').read.strip
Gem::Specification.new do |gem|
gem.name = "oa-oauth"
@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE.rdoc CHANGELOG.rdoc)
gem.add_dependency 'oa-core', "~> #{version.gsub(/\d$/,'0')}"
gem.add_dependency 'oa-core', version
gem.add_dependency 'oauth'
gem.add_dependency 'oauth2'
gem.add_dependency 'nokogiri'

View File

@ -1,4 +1,4 @@
version = File.open(File.dirname(__FILE__) + '/VERSION', 'r').read.strip
version = File.open(File.dirname(__FILE__) + '/../VERSION', 'r').read.strip
Gem::Specification.new do |gem|
gem.name = "oa-openid"
@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE.rdoc CHANGELOG.rdoc)
gem.add_dependency 'oa-core', "~> #{version.gsub(/\d$/,'0')}"
gem.add_dependency 'oa-core', version
gem.add_dependency 'rack-openid'
gem.add_development_dependency "rspec", ">= 1.2.9"

View File

@ -1 +0,0 @@
0.0.1

View File

@ -1,4 +1,4 @@
version = File.open(File.dirname(__FILE__) + '/VERSION', 'r').read.strip
version = File.open(File.dirname(__FILE__) + '/../VERSION', 'r').read.strip
Gem::Specification.new do |gem|
gem.name = "omniauth"
@ -11,10 +11,9 @@ Gem::Specification.new do |gem|
gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE.rdoc CHANGELOG.rdoc)
gem.add_dependency 'oa-core', "~> #{version.gsub(/\d$/,'0')}"
gem.add_dependency 'oa-oauth', "~> #{version.gsub(/\d$/,'0')}"
gem.add_dependency 'oa-basic', "~> #{version.gsub(/\d$/,'0')}"
gem.add_dependency 'oa-openid', "~> #{version.gsub(/\d$/,'0')}"
%w(oa-core oa-oauth oa-basic oa-openid).each do |subgem|
gem.add_dependency subgem, version
end
gem.add_development_dependency "rspec", ">= 1.2.9"
gem.add_development_dependency "webmock"