Permalink
Browse files

New versioning system to support testing on http://test.rubygems.org/

  • Loading branch information...
1 parent 63b11f3 commit 1d100ab8e90619f3106dbcf9f752824a145d63be @sferik sferik committed Apr 22, 2011
View
@@ -6,4 +6,3 @@ gemspec :path => 'oa-enterprise'
gemspec :path => 'oa-more'
gemspec :path => 'oa-oauth'
gemspec :path => 'oa-openid'
-gemspec :path => 'omniauth'
View
147 Rakefile
@@ -1,29 +1,72 @@
-require 'rake'
-require File.expand_path('../omniauth/lib/omniauth/version', __FILE__)
+OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-enterprise oa-more)
-begin
- require 'term/ansicolor'
- include Term::ANSIColor
-rescue LoadError
- def cyan; '' end
- def blue; '' end
- def clear; '' end
- def green; '' end
- def red; '' end
+def each_gem(action, &block)
+ OMNIAUTH_GEMS.each do |gem|
+ puts "#{gem} #{action}"
+ Dir.chdir(gem) do
+ yield
+ end
+ end
end
-OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-enterprise oa-more omniauth)
+def version
+ File.read("VERSION").strip
+end
-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) do
- block.call(dir)
+def bump_version(position)
+ v = version.split('.').map{|s| s.to_i}
+ v[position] += 1
+ write_version(*v)
+end
+
+def write_version(major, minor, patch)
+ v = version.split('.').map{|s| s.to_i}
+ v[0] = major unless major.nil?
+ v[1] = minor unless minor.nil?
+ v[2] = patch unless patch.nil?
+ File.open("VERSION", 'w') do |f|
+ f.write v.join('.')
+ end
+ each_gem('is writing version file...') do
+ File.open("VERSION", 'w') do |f|
+ f.write v.join('.')
end
end
+ display_version
end
-desc 'Run specs for all of the gems.'
+def display_version
+ puts "Version is now #{version}"
+end
+
+desc "Display the current version"
+task :version do
+ display_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
+ desc "Increment the major version"
+ task :major do
+ bump_version(0)
+ end
+ desc "Increment the minor version"
+ task :minor do
+ bump_version(1)
+ end
+ desc "Increment the patch version"
+ task :patch do
+ bump_version(2)
+ end
+ end
+end
+
+desc "Run specs for all of the gems"
task :spec do
error_gems = []
each_gem('specs are running...') do |gem|
@@ -34,74 +77,82 @@ task :spec do
puts
if error_gems.any?
- puts "#{red}#{error_gems.size} gems with failing specs: #{error_gems.join(', ')}#{clear}"
+ puts "#{error_gems.size} gems with failing specs: #{error_gems.join(', ')}"
exit(1)
else
- puts "#{green}All gems passed specs.#{clear}"
+ puts "All gems passed specs."
end
end
desc "Release all gems to gemcutter and create a tag"
task :release => ['tag', 'clean', 'build', 'publish']
task :tag do
- system("git tag v#{Omniauth::VERSION}")
+ system("git tag v#{version.join}")
system('git push origin --tags')
end
task :publish do
each_gem('is releasing to Rubygems...') do
- system('gem push pkg/*.gem')
+ system("gem push pkg/#{gem}-#{version.join}.gem")
end
+ system("gem push pkg/omniauth-#{version.join}.gem")
+end
+
+def build_gem
+ system('gem build omniauth.gemspec')
+ FileUtils.mkdir_p('pkg')
+ FileUtils.mv("omniauth-#{version}.gem", 'pkg')
+end
+
+def install_gem
+ system("gem install pkg/omniauth-#{version}.gem")
end
desc "Build gem files for all projects"
task :build do
- each_gem('is building gems...') do
+ each_gem('is building...') do
system('rake build')
end
+ build_gem
end
desc "Install gems for all projects"
task :install do
- each_gem('is installing gems...') do
+ each_gem('is installing...') do
system('rake install')
end
+ build_gem
+ install_gem
end
desc "Clean pkg and other stuff"
task :clean do
- OMNIAUTH_GEMS.each do |dir|
- Dir.chdir(dir) do
- %w(tmp pkg coverage dist).each{|d| FileUtils.rm_rf d}
+ OMNIAUTH_GEMS.each do |gem|
+ Dir.chdir(gem) do
+ %w(tmp pkg coverage dist).each do |directory|
+ FileUtils.rm_rf directory
+ end
end
+ %w(tmp pkg coverage dist).each do |directory|
+ FileUtils.rm_rf directory
+ end
+ end
+ Dir["**/*.gem"].each do |gem|
+ FileUtils.rm_rf gem
end
- Dir["**/*.gem"].each { |gem| FileUtils.rm_rf gem }
end
task :default => :spec
task :test => :spec
-begin
+namespace :doc do
require 'yard'
- YARD::Rake::YardocTask.new(:doc) do |t|
- t.files = OMNIAUTH_GEMS.inject([]){|a,g| a = a + ["#{g}/lib/**/*.rb"]; a} + ['README.markdown']
- end
-
- namespace :doc do
- YARD::Rake::YardocTask.new(:pages) do |t|
- t.files = OMNIAUTH_GEMS.inject([]){|a,g| a = a + ["#{g}/lib/**/*.rb"]; a} + ['README.markdown']
- end
-
- namespace :pages do
- desc 'Generate and publish YARD docs to GitHub pages.'
- task :publish => ['doc:pages'] do
- Dir.chdir(File.dirname(__FILE__) + '/../omniauth.doc') do
- system("git add .")
- system("git add -u")
- system("git push origin gh-pages")
- end
- end
- end
+ YARD::Rake::YardocTask.new do |task|
+ task.files = OMNIAUTH_GEMS.map{|gem| ["#{gem}/lib/**/*.rb"]} + ['README.markdown', 'LICENSE']
+ task.options = [
+ '--markup', 'markdown',
+ '--markup-provider', 'maruku',
+ ]
end
end
View
@@ -0,0 +1 @@
+0.2.4
File renamed without changes.
View
@@ -0,0 +1 @@
+0.2.4
@@ -1,17 +1,18 @@
# -*- encoding: utf-8 -*-
-require File.expand_path('../../omniauth/lib/omniauth/version', __FILE__)
+version = File.read("VERSION").strip
Gem::Specification.new do |gem|
- gem.add_runtime_dependency 'oa-core', Omniauth::VERSION.dup
+ gem.add_runtime_dependency 'oa-core', version
gem.add_runtime_dependency 'rest-client', '~> 1.6.0'
+ gem.add_development_dependency 'maruku', '~> 0.6'
gem.add_development_dependency 'simplecov', '~> 0.4'
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rspec', '~> 2.5'
gem.add_development_dependency 'webmock', '~> 1.6'
gem.add_development_dependency 'yard', '~> 0.6'
gem.name = 'oa-basic'
- gem.version = Omniauth::VERSION.dup
+ gem.version = version
gem.summary = %q{HTTP Basic strategies for OmniAuth.}
gem.description = %q{HTTP Basic strategies for OmniAuth.}
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
View
@@ -0,0 +1 @@
+0.2.4
View
@@ -1,14 +1,15 @@
# -*- encoding: utf-8 -*-
-require File.expand_path('../../omniauth/lib/omniauth/version', __FILE__)
+version = File.read("VERSION").strip
Gem::Specification.new do |gem|
+ gem.add_development_dependency 'maruku', '~> 0.6'
gem.add_development_dependency 'simplecov', '~> 0.4'
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rspec', '~> 2.5'
gem.add_development_dependency 'yard', '~> 0.6'
gem.name = 'oa-core'
- gem.version = Omniauth::VERSION.dup
+ gem.version = version
gem.summary = %q{HTTP Basic strategies for OmniAuth.}
gem.description = %q{HTTP Basic strategies for OmniAuth.}
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
View
@@ -0,0 +1 @@
+0.2.4
@@ -1,21 +1,22 @@
# -*- encoding: utf-8 -*-
-require File.expand_path('../../omniauth/lib/omniauth/version', __FILE__)
+version = File.read("VERSION").strip
Gem::Specification.new do |gem|
gem.add_runtime_dependency 'addressable', '2.2.4'
- gem.add_runtime_dependency 'oa-core', Omniauth::VERSION.dup
+ gem.add_runtime_dependency 'oa-core', version
gem.add_runtime_dependency 'nokogiri', '~> 1.4.2'
gem.add_runtime_dependency 'net-ldap', '~> 0.2.2'
gem.add_runtime_dependency 'rubyntlm', '~> 0.1.1'
gem.add_runtime_dependency 'pyu-ruby-sasl', '~> 0.0.3.1'
+ gem.add_development_dependency 'maruku', '~> 0.6'
gem.add_development_dependency 'simplecov', '~> 0.4'
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rspec', '~> 2.5'
gem.add_development_dependency 'webmock', '~> 1.6'
gem.add_development_dependency 'yard', '~> 0.6'
gem.name = 'oa-enterprise'
- gem.version = Omniauth::VERSION.dup
+ gem.version = version
gem.summary = %q{Enterprise strategies for OmniAuth.}
gem.description = %q{Enterprise strategies for OmniAuth.}
gem.email = ['james.a.rosen@gmail.com', 'ping@intridea.com', 'michael@intridea.com', 'sferik@gmail.com']
View
@@ -0,0 +1 @@
+0.2.4
View
@@ -1,19 +1,20 @@
# -*- encoding: utf-8 -*-
-require File.expand_path('../../omniauth/lib/omniauth/version', __FILE__)
+version = File.read("VERSION").strip
Gem::Specification.new do |gem|
- gem.add_dependency 'oa-core', Omniauth::VERSION.dup
+ gem.add_dependency 'oa-core', version
gem.add_dependency 'rest-client', '~> 1.6.0'
gem.add_dependency 'multi_json', '~> 0.0.2'
gem.add_development_dependency 'json_pure', '~> 1.5'
+ gem.add_development_dependency 'maruku', '~> 0.6'
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rspec', '~> 2.5'
gem.add_development_dependency 'simplecov', '~> 0.4'
gem.add_development_dependency 'webmock', '~> 1.6'
gem.add_development_dependency 'yard', '~> 0.6'
gem.name = 'oa-more'
- gem.version = Omniauth::VERSION.dup
+ gem.version = version
gem.summary = %q{Additional strategies for OmniAuth.}
gem.description = %q{Additional strategies for OmniAuth.}
gem.email = 'michael@intridea.com'
View
@@ -0,0 +1 @@
+0.2.4
@@ -1,21 +1,22 @@
# -*- encoding: utf-8 -*-
-require File.expand_path('../../omniauth/lib/omniauth/version', __FILE__)
+version = File.read("VERSION").strip
Gem::Specification.new do |gem|
- gem.add_runtime_dependency 'oa-core', Omniauth::VERSION.dup
+ gem.add_runtime_dependency 'oa-core', version
gem.add_runtime_dependency 'multi_json', '>= 0.0.5'
gem.add_runtime_dependency 'nokogiri', '~> 1.4.2'
gem.add_runtime_dependency 'oauth', '~> 0.4.0'
gem.add_runtime_dependency 'faraday', '~> 0.6.1'
gem.add_runtime_dependency 'oauth2', '~> 0.4.1'
gem.add_development_dependency 'evernote', '~> 0.9'
+ gem.add_development_dependency 'maruku', '~> 0.6'
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rspec', '~> 2.5'
gem.add_development_dependency 'webmock', '~> 1.6'
gem.add_development_dependency 'yard', '~> 0.6'
gem.name = 'oa-oauth'
- gem.version = Omniauth::VERSION.dup
+ gem.version = version
gem.summary = %q{OAuth strategies for OmniAuth.}
gem.description = %q{OAuth strategies for OmniAuth.}
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
View
@@ -0,0 +1 @@
+0.2.4
@@ -1,17 +1,18 @@
# -*- encoding: utf-8 -*-
-require File.expand_path('../../omniauth/lib/omniauth/version', __FILE__)
+version = File.read("VERSION").strip
Gem::Specification.new do |gem|
- gem.add_dependency 'oa-core', Omniauth::VERSION.dup
+ gem.add_dependency 'oa-core', version
gem.add_dependency 'rack-openid', '~> 1.3.1'
- gem.add_dependency 'ruby-openid-apps-discovery'
+ gem.add_dependency 'ruby-openid-apps-discovery', '~> 1.2.0'
+ gem.add_development_dependency 'maruku', '~> 0.6'
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rake', '~> 0.8'
gem.add_development_dependency 'rspec', '~> 2.5'
gem.add_development_dependency 'webmock', '~> 1.6'
gem.add_development_dependency 'yard', '~> 0.6'
gem.name = 'oa-openid'
- gem.version = Omniauth::VERSION.dup
+ gem.version = version
gem.summary = %q{OpenID strategies for OmniAuth.}
gem.description = %q{OpenID strategies for OmniAuth.}
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
@@ -1,12 +1,12 @@
# -*- encoding: utf-8 -*-
-require File.expand_path('../../omniauth/lib/omniauth/version', __FILE__)
+version = File.read("VERSION").strip
Gem::Specification.new do |gem|
%w(oa-core oa-oauth oa-basic oa-openid oa-enterprise oa-more).each do |subgem|
- gem.add_runtime_dependency subgem, Omniauth::VERSION.dup
+ gem.add_runtime_dependency subgem, version
end
gem.name = 'omniauth'
- gem.version = Omniauth::VERSION.dup
+ gem.version = version
gem.summary = %q{Rack middleware for standardized multi-provider authentication.}
gem.description = %q{OmniAuth is an authentication framework that that separates the concept of authentiation from the concept of identity, providing simple hooks for any application to have one or multiple authentication providers for a user.}
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
View
No changes.
Oops, something went wrong.

0 comments on commit 1d100ab

Please sign in to comment.