Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Versioning will now be lockstep, bumped to 0.0.3

  • Loading branch information...
commit 4495e4306bac201f410ddc714a549848dc281483 1 parent 240d691
Michael Bleigh authored
View
79 Rakefile
@@ -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
View
1  VERSION
@@ -0,0 +1 @@
+0.0.3
View
1  oa-basic/VERSION
@@ -1 +0,0 @@
-0.0.1
View
4 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"
@@ -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
1  oa-core/VERSION
@@ -1 +0,0 @@
-0.0.1
View
4 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"
View
1  oa-oauth/VERSION
@@ -1 +0,0 @@
-0.0.1
View
4 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"
@@ -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
4 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"
@@ -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
1  omniauth/VERSION
@@ -1 +0,0 @@
-0.0.1
View
9 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"
@@ -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"
Please sign in to comment.
Something went wrong with that request. Please try again.