Skip to content

Commit

Permalink
Versioning will now be lockstep, bumped to 0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bleigh committed May 1, 2010
1 parent 240d691 commit 4495e43
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 26 deletions.
79 changes: 69 additions & 10 deletions Rakefile
Expand Up @@ -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

desc 'Build all gems'
task :build do
each_gem('is releasing to Gemcutter...') do
system('rake gemcutter')
end
end

task :default => :spec

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 change: 1 addition & 0 deletions VERSION
@@ -0,0 +1 @@
0.0.3
1 change: 0 additions & 1 deletion oa-basic/VERSION

This file was deleted.

4 changes: 2 additions & 2 deletions oa-basic/oa-basic.gemspec
@@ -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"
Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion oa-core/VERSION

This file was deleted.

4 changes: 3 additions & 1 deletion oa-core/oa-core.gemspec
@@ -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"
Expand Down
1 change: 0 additions & 1 deletion oa-oauth/VERSION

This file was deleted.

4 changes: 2 additions & 2 deletions oa-oauth/oa-oauth.gemspec
@@ -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"
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions oa-openid/oa-openid.gemspec
@@ -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"
Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion omniauth/VERSION

This file was deleted.

9 changes: 4 additions & 5 deletions omniauth/omniauth.gemspec
@@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 4495e43

Please sign in to comment.