Refactor build system
This commit is contained in:
parent
b16e5b1072
commit
81358854f2
|
@ -2,6 +2,5 @@ rvm:
|
|||
- 1.8.7
|
||||
- 1.9.1
|
||||
- 1.9.2
|
||||
- jruby
|
||||
- rbx
|
||||
- ree
|
||||
|
|
4
Gemfile
4
Gemfile
|
@ -6,7 +6,3 @@ gemspec :path => 'oa-enterprise'
|
|||
gemspec :path => 'oa-more'
|
||||
gemspec :path => 'oa-oauth'
|
||||
gemspec :path => 'oa-openid'
|
||||
|
||||
group :development do
|
||||
gem "thrift_client", "0.6.1", :git => "git://github.com/sferik/thrift_client.git", :branch => "bump_version"
|
||||
end
|
||||
|
|
172
Rakefile
172
Rakefile
|
@ -1,158 +1,48 @@
|
|||
OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-enterprise oa-more)
|
||||
$:.unshift File.expand_path('..', __FILE__)
|
||||
require 'tasks/all'
|
||||
|
||||
def each_gem(action, &block)
|
||||
OMNIAUTH_GEMS.each do |gem|
|
||||
puts "#{gem} #{action}"
|
||||
Dir.chdir(gem) do
|
||||
yield
|
||||
end
|
||||
end
|
||||
end
|
||||
desc 'Clean up temporary files'
|
||||
task :clean => 'all:clean'
|
||||
|
||||
def version
|
||||
File.read("VERSION").strip
|
||||
end
|
||||
desc 'Build gem files for all projects into the package directory'
|
||||
task :build => 'all:build'
|
||||
|
||||
def bump_version(position)
|
||||
v = version.split('.').map{|s| s.to_i}
|
||||
v[position] += 1
|
||||
write_version(*v)
|
||||
end
|
||||
desc 'Build and install gems for all projects'
|
||||
task :install => 'all:install'
|
||||
|
||||
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 'Write version with MAJOR, MINOR, PATCH, and PRE environment variables'
|
||||
task 'version:write' => 'all:version:write'
|
||||
|
||||
def display_version
|
||||
puts "Version is now #{version}"
|
||||
end
|
||||
desc 'Display the current version for all projects'
|
||||
task :version => 'all:version'
|
||||
desc 'Increment the major version for all projects'
|
||||
task 'version:bump:major' => 'all:version:bump:major'
|
||||
desc 'Increment the minor version for all projects'
|
||||
task 'version:bump:minor' => 'all:version:bump:minor'
|
||||
desc 'Increment the patch version for all projects'
|
||||
task 'version:bump:patch' => 'all:version:bump:patch'
|
||||
|
||||
desc "Display the current version"
|
||||
task :version do
|
||||
display_version
|
||||
end
|
||||
desc 'Run specs for all projects'
|
||||
task :spec => 'all:spec'
|
||||
task :test => :spec
|
||||
task :default => :test
|
||||
|
||||
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|
|
||||
unless system('bundle exec rake spec')
|
||||
error_gems << gem
|
||||
end
|
||||
end
|
||||
|
||||
puts
|
||||
if error_gems.any?
|
||||
puts "#{error_gems.size} gems with failing specs: #{error_gems.join(', ')}"
|
||||
exit(1)
|
||||
else
|
||||
puts "All gems passed specs."
|
||||
end
|
||||
end
|
||||
|
||||
desc "Release all gems to gemcutter and create a tag"
|
||||
task :release => ['tag', 'clean', 'build', 'publish']
|
||||
desc 'Generate docs for all projects'
|
||||
task 'doc:yard' => 'all:doc:yard'
|
||||
|
||||
task :tag do
|
||||
system("git tag v#{version.join}")
|
||||
system('git push origin --tags')
|
||||
sh "git tag -a -m \"Version #{version}\" v#{version}"
|
||||
sh "git push"
|
||||
sh "git push --tags"
|
||||
end
|
||||
|
||||
task :publish do
|
||||
each_gem('is releasing to Rubygems...') do
|
||||
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...') do
|
||||
system('rake build')
|
||||
end
|
||||
build_gem
|
||||
end
|
||||
|
||||
desc "Install gems for all projects"
|
||||
task :install 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 |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
|
||||
end
|
||||
|
||||
task :default => :spec
|
||||
task :test => :spec
|
||||
desc 'Build, tag, and push gems for all projects to Rubygems'
|
||||
task :release => [:build, :tag, :push]
|
||||
|
||||
namespace :doc do
|
||||
require 'yard'
|
||||
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',
|
||||
]
|
||||
task.files = PROJECTS.map{|project| "#{root}/#{project}/lib/**/*.rb"} + ['README.markdown', 'LICENSE']
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
module OmniAuth
|
||||
module Version
|
||||
unless defined?(::OmniAuth::Version::MAJOR)
|
||||
MAJOR = 0
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::MINOR)
|
||||
MINOR = 2
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PATCH)
|
||||
PATCH = 4
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PRE)
|
||||
PRE = nil
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::STRING)
|
||||
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1 +0,0 @@
|
|||
0.2.4
|
|
@ -0,0 +1,19 @@
|
|||
module OmniAuth
|
||||
module Version
|
||||
unless defined?(::OmniAuth::Version::MAJOR)
|
||||
MAJOR = 0
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::MINOR)
|
||||
MINOR = 2
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PATCH)
|
||||
PATCH = 4
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PRE)
|
||||
PRE = nil
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::STRING)
|
||||
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,8 +1,8 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
version = File.read("VERSION").strip
|
||||
require File.expand_path('../lib/omniauth/version', __FILE__)
|
||||
|
||||
Gem::Specification.new do |gem|
|
||||
gem.add_runtime_dependency 'oa-core', version
|
||||
gem.add_runtime_dependency 'oa-core', OmniAuth::Version::STRING
|
||||
gem.add_runtime_dependency 'jruby-openssl', '~> 0.7.3' if RUBY_PLATFORM == 'java'
|
||||
gem.add_runtime_dependency 'rest-client', '~> 1.6.0'
|
||||
gem.add_development_dependency 'maruku', '~> 0.6'
|
||||
|
@ -14,9 +14,9 @@ Gem::Specification.new do |gem|
|
|||
gem.add_development_dependency 'yard', '~> 0.6'
|
||||
gem.add_development_dependency 'ZenTest', '~> 4.5'
|
||||
gem.name = 'oa-basic'
|
||||
gem.version = version
|
||||
gem.summary = %q{HTTP Basic strategies for OmniAuth.}
|
||||
gem.version = OmniAuth::Version::STRING
|
||||
gem.description = %q{HTTP Basic strategies for OmniAuth.}
|
||||
gem.summary = gem.description
|
||||
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
|
||||
gem.homepage = 'http://github.com/intridea/omniauth'
|
||||
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
0.2.4
|
|
@ -0,0 +1,19 @@
|
|||
module OmniAuth
|
||||
module Version
|
||||
unless defined?(::OmniAuth::Version::MAJOR)
|
||||
MAJOR = 0
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::MINOR)
|
||||
MINOR = 2
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PATCH)
|
||||
PATCH = 4
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PRE)
|
||||
PRE = nil
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::STRING)
|
||||
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
version = File.read("VERSION").strip
|
||||
require File.expand_path('../lib/omniauth/version', __FILE__)
|
||||
|
||||
Gem::Specification.new do |gem|
|
||||
gem.add_development_dependency 'maruku', '~> 0.6'
|
||||
|
@ -10,9 +10,9 @@ Gem::Specification.new do |gem|
|
|||
gem.add_development_dependency 'yard', '~> 0.6'
|
||||
gem.add_development_dependency 'ZenTest', '~> 4.5'
|
||||
gem.name = 'oa-core'
|
||||
gem.version = version
|
||||
gem.summary = %q{HTTP Basic strategies for OmniAuth.}
|
||||
gem.description = %q{HTTP Basic strategies for OmniAuth.}
|
||||
gem.version = OmniAuth::Version::STRING
|
||||
gem.description = %q{Core strategies for OmniAuth.}
|
||||
gem.summary = gem.description
|
||||
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
|
||||
gem.homepage = 'http://github.com/intridea/omniauth'
|
||||
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
0.2.4
|
|
@ -0,0 +1,19 @@
|
|||
module OmniAuth
|
||||
module Version
|
||||
unless defined?(::OmniAuth::Version::MAJOR)
|
||||
MAJOR = 0
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::MINOR)
|
||||
MINOR = 2
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PATCH)
|
||||
PATCH = 4
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PRE)
|
||||
PRE = nil
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::STRING)
|
||||
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,12 +1,12 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
version = File.read("VERSION").strip
|
||||
require File.expand_path('../lib/omniauth/version', __FILE__)
|
||||
|
||||
Gem::Specification.new do |gem|
|
||||
gem.add_runtime_dependency 'addressable', '2.2.4'
|
||||
gem.add_runtime_dependency 'jruby-openssl', '~> 0.7.3' if RUBY_PLATFORM == 'java'
|
||||
gem.add_runtime_dependency 'nokogiri', '~> 1.4.2'
|
||||
gem.add_runtime_dependency 'net-ldap', '~> 0.2.2'
|
||||
gem.add_runtime_dependency 'oa-core', version
|
||||
gem.add_runtime_dependency 'oa-core', OmniAuth::Version::STRING
|
||||
gem.add_runtime_dependency 'pyu-ruby-sasl', '~> 0.0.3.1'
|
||||
gem.add_runtime_dependency 'rubyntlm', '~> 0.1.1'
|
||||
gem.add_development_dependency 'maruku', '~> 0.6'
|
||||
|
@ -18,9 +18,9 @@ Gem::Specification.new do |gem|
|
|||
gem.add_development_dependency 'yard', '~> 0.6'
|
||||
gem.add_development_dependency 'ZenTest', '~> 4.5'
|
||||
gem.name = 'oa-enterprise'
|
||||
gem.version = version
|
||||
gem.summary = %q{Enterprise strategies for OmniAuth.}
|
||||
gem.version = OmniAuth::Version::STRING
|
||||
gem.description = %q{Enterprise strategies for OmniAuth.}
|
||||
gem.summary = gem.description
|
||||
gem.email = ['james.a.rosen@gmail.com', 'ping@intridea.com', 'michael@intridea.com', 'sferik@gmail.com']
|
||||
gem.homepage = 'http://github.com/intridea/omniauth'
|
||||
gem.authors = ['James A. Rosen', 'Ping Yu', 'Michael Bleigh', 'Erik Michaels-Ober']
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
0.2.4
|
|
@ -0,0 +1,19 @@
|
|||
module OmniAuth
|
||||
module Version
|
||||
unless defined?(::OmniAuth::Version::MAJOR)
|
||||
MAJOR = 0
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::MINOR)
|
||||
MINOR = 2
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PATCH)
|
||||
PATCH = 4
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PRE)
|
||||
PRE = nil
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::STRING)
|
||||
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,10 +1,10 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
version = File.read("VERSION").strip
|
||||
require File.expand_path('../lib/omniauth/version', __FILE__)
|
||||
|
||||
Gem::Specification.new do |gem|
|
||||
gem.add_runtime_dependency 'jruby-openssl', '~> 0.7.3' if RUBY_PLATFORM == 'java'
|
||||
gem.add_runtime_dependency 'multi_json', '~> 1.0.0'
|
||||
gem.add_runtime_dependency 'oa-core', version
|
||||
gem.add_runtime_dependency 'oa-core', OmniAuth::Version::STRING
|
||||
gem.add_runtime_dependency 'rest-client', '~> 1.6.0'
|
||||
gem.add_development_dependency 'json_pure', '~> 1.5'
|
||||
gem.add_development_dependency 'maruku', '~> 0.6'
|
||||
|
@ -16,9 +16,9 @@ Gem::Specification.new do |gem|
|
|||
gem.add_development_dependency 'yard', '~> 0.6'
|
||||
gem.add_development_dependency 'ZenTest', '~> 4.5'
|
||||
gem.name = 'oa-more'
|
||||
gem.version = version
|
||||
gem.summary = %q{Additional strategies for OmniAuth.}
|
||||
gem.version = OmniAuth::Version::STRING
|
||||
gem.description = %q{Additional strategies for OmniAuth.}
|
||||
gem.summary = gem.description
|
||||
gem.email = 'michael@intridea.com'
|
||||
gem.homepage = 'http://github.com/intridea/omniauth'
|
||||
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
0.2.4
|
|
@ -1,11 +1,6 @@
|
|||
require 'omniauth/oauth'
|
||||
require 'multi_json'
|
||||
|
||||
begin
|
||||
require 'evernote'
|
||||
rescue LoadError => e
|
||||
raise "Omniauth Evernote strategy requires 'evernote' gem. Add it to your Gemfile: gem 'evernote'"
|
||||
end
|
||||
require 'evernote'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
module OmniAuth
|
||||
module Version
|
||||
unless defined?(::OmniAuth::Version::MAJOR)
|
||||
MAJOR = 0
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::MINOR)
|
||||
MINOR = 2
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PATCH)
|
||||
PATCH = 4
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PRE)
|
||||
PRE = nil
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::STRING)
|
||||
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,12 +1,12 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
version = File.read("VERSION").strip
|
||||
require File.expand_path('../lib/omniauth/version', __FILE__)
|
||||
|
||||
Gem::Specification.new do |gem|
|
||||
gem.add_runtime_dependency 'faraday', '~> 0.6.1'
|
||||
gem.add_runtime_dependency 'jruby-openssl', '~> 0.7.3' if RUBY_PLATFORM == 'java'
|
||||
gem.add_runtime_dependency 'multi_json', '~> 1.0.0'
|
||||
gem.add_runtime_dependency 'multi_xml', '~> 0.2.2'
|
||||
gem.add_runtime_dependency 'oa-core', version
|
||||
gem.add_runtime_dependency 'oa-core', OmniAuth::Version::STRING
|
||||
gem.add_runtime_dependency 'oauth', '~> 0.4.0'
|
||||
gem.add_runtime_dependency 'oauth2', '~> 0.4.1'
|
||||
gem.add_development_dependency 'evernote', '~> 0.9'
|
||||
|
@ -19,9 +19,9 @@ Gem::Specification.new do |gem|
|
|||
gem.add_development_dependency 'yard', '~> 0.6'
|
||||
gem.add_development_dependency 'ZenTest', '~> 4.5'
|
||||
gem.name = 'oa-oauth'
|
||||
gem.version = version
|
||||
gem.summary = %q{OAuth strategies for OmniAuth.}
|
||||
gem.version = OmniAuth::Version::STRING
|
||||
gem.description = %q{OAuth strategies for OmniAuth.}
|
||||
gem.summary = gem.description
|
||||
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
|
||||
gem.homepage = 'http://github.com/intridea/omniauth'
|
||||
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
0.2.4
|
|
@ -0,0 +1,19 @@
|
|||
module OmniAuth
|
||||
module Version
|
||||
unless defined?(::OmniAuth::Version::MAJOR)
|
||||
MAJOR = 0
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::MINOR)
|
||||
MINOR = 2
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PATCH)
|
||||
PATCH = 4
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::PRE)
|
||||
PRE = nil
|
||||
end
|
||||
unless defined?(::OmniAuth::Version::STRING)
|
||||
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,9 +1,9 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
version = File.read("VERSION").strip
|
||||
require File.expand_path('../lib/omniauth/version', __FILE__)
|
||||
|
||||
Gem::Specification.new do |gem|
|
||||
gem.add_runtime_dependency 'jruby-openssl', '~> 0.7.3' if RUBY_PLATFORM == 'java'
|
||||
gem.add_runtime_dependency 'oa-core', version
|
||||
gem.add_runtime_dependency 'oa-core', OmniAuth::Version::STRING
|
||||
gem.add_runtime_dependency 'rack-openid', '~> 1.3.1'
|
||||
gem.add_runtime_dependency 'ruby-openid-apps-discovery', '~> 1.2.0'
|
||||
gem.add_development_dependency 'maruku', '~> 0.6'
|
||||
|
@ -15,9 +15,9 @@ Gem::Specification.new do |gem|
|
|||
gem.add_development_dependency 'yard', '~> 0.6'
|
||||
gem.add_development_dependency 'ZenTest', '~> 4.5'
|
||||
gem.name = 'oa-openid'
|
||||
gem.version = version
|
||||
gem.summary = %q{OpenID strategies for OmniAuth.}
|
||||
gem.version = OmniAuth::Version::STRING
|
||||
gem.description = %q{OpenID strategies for OmniAuth.}
|
||||
gem.summary = gem.description
|
||||
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
|
||||
gem.homepage = 'http://github.com/intridea/omniauth'
|
||||
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
version = File.read("VERSION").strip
|
||||
require File.expand_path('../lib/omniauth/version', __FILE__)
|
||||
|
||||
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, version
|
||||
gem.add_runtime_dependency subgem, OmniAuth::Version::STRING
|
||||
end
|
||||
gem.name = 'omniauth'
|
||||
gem.version = version
|
||||
gem.version = OmniAuth::Version::STRING
|
||||
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']
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
PROJECTS = %w(oa-core oa-basic oa-enterprise oa-more oa-oauth oa-openid omniauth)
|
||||
|
||||
def root
|
||||
File.expand_path('../../', __FILE__)
|
||||
end
|
||||
|
||||
require root + '/lib/omniauth/version'
|
||||
|
||||
def version
|
||||
::OmniAuth::Version.constants.each do |const|
|
||||
::OmniAuth::Version.send(:remove_const, const)
|
||||
end
|
||||
load root + '/lib/omniauth/version.rb'
|
||||
OmniAuth::Version::STRING
|
||||
end
|
||||
|
||||
PROJECTS.each do |project|
|
||||
namespace project.to_sym do
|
||||
dir = root + (project == 'omniauth' ? '' : "/#{project}")
|
||||
package_dir = "#{dir}/pkg"
|
||||
coverage_dir = "#{dir}/converage"
|
||||
temp_dir = "#{dir}/tmp"
|
||||
gem = "#{project}-#{version}.gem"
|
||||
gemspec = "#{project}.gemspec"
|
||||
|
||||
task :clean do
|
||||
rm_rf package_dir
|
||||
rm_rf coverage_dir
|
||||
rm_rf temp_dir
|
||||
end
|
||||
|
||||
task :build => :clean do
|
||||
cd dir
|
||||
sh "gem build #{gemspec}"
|
||||
mkdir_p package_dir unless Dir.exists?(package_dir)
|
||||
mv gem, "#{package_dir}/#{gem}"
|
||||
end
|
||||
|
||||
task :install => :build do
|
||||
sh "gem install #{package_dir}/#{gem}"
|
||||
end
|
||||
|
||||
task :push => :build do
|
||||
sh "gem push #{package_dir}/#{gem}"
|
||||
end
|
||||
|
||||
task :version do
|
||||
puts "#{project}: #{version}"
|
||||
end
|
||||
|
||||
namespace :version do
|
||||
|
||||
destination = "#{dir}/lib/omniauth/version.rb"
|
||||
|
||||
task :write do
|
||||
write_version(destination, ENV['MAJOR'], ENV['MINOR'], ENV['PATCH'], ENV['PRE'])
|
||||
end
|
||||
|
||||
namespace :bump do
|
||||
|
||||
task :major do
|
||||
bump_version(destination, 0)
|
||||
end
|
||||
|
||||
task :minor do
|
||||
bump_version(destination, 1)
|
||||
end
|
||||
|
||||
task :patch do
|
||||
bump_version(destination, 2)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
task :spec do
|
||||
cd dir
|
||||
sh "#{$0} spec"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
namespace :all do
|
||||
task :clean => PROJECTS.map{|project| "#{project}:clean"}
|
||||
task :build => PROJECTS.map{|project| "#{project}:build"}
|
||||
task :install => PROJECTS.map{|project| "#{project}:install"}
|
||||
task :push => PROJECTS.map{|project| "#{project}:push"}
|
||||
task "version" => PROJECTS.map{|project| "#{project}:version"}
|
||||
task "version:write" => PROJECTS.map{|project| "#{project}:version:write"} + [:version]
|
||||
task "version:bump:major" => PROJECTS.map{|project| "#{project}:version:bump:major"} + [:version]
|
||||
task "version:bump:minor" => PROJECTS.map{|project| "#{project}:version:bump:minor"} + [:version]
|
||||
task "version:bump:patch" => PROJECTS.map{|project| "#{project}:version:bump:patch"} + [:version]
|
||||
task :spec do
|
||||
errors = []
|
||||
PROJECTS.map do |project|
|
||||
next if project == "omniauth"
|
||||
Rake::Task["#{project}:spec"].invoke || errors << project
|
||||
end
|
||||
fail("Errors in #{errors.join(', ')}") unless errors.empty?
|
||||
end
|
||||
end
|
||||
|
||||
def write_version(destination, major=nil, minor=nil, patch=nil, pre=nil)
|
||||
source = "#{root}/lib/omniauth/version.rb"
|
||||
v = version.split('.')
|
||||
v[0] = major if major
|
||||
v[1] = minor if minor
|
||||
v[2] = patch if patch
|
||||
v[3] = pre if pre
|
||||
v[3] = v[3] ? v[3].to_s : "nil"
|
||||
|
||||
ruby = File.read(source)
|
||||
ruby.gsub! /^(\s*)MAJOR = .*?$/, "\\1MAJOR = #{v[0]}"
|
||||
fail "Could not insert MAJOR in #{source}" unless $1
|
||||
ruby.gsub! /^(\s*)MINOR = .*?$/, "\\1MINOR = #{v[1]}"
|
||||
fail "Could not insert MINOR in #{source}" unless $1
|
||||
ruby.gsub! /^(\s*)PATCH = .*?$/, "\\1PATCH = #{v[2]}"
|
||||
fail "Could not insert PATCH in #{source}" unless $1
|
||||
ruby.gsub! /^(\s*)PRE = .*?$/, "\\1PRE = #{v[3]}"
|
||||
fail "Could not insert PRE in #{source}" unless $1
|
||||
File.open(destination, 'w') do |file|
|
||||
file.write ruby
|
||||
end
|
||||
end
|
||||
|
||||
def bump_version(destination, position)
|
||||
v = version.split('.').map{|s| s.to_i}
|
||||
v[position] += 1
|
||||
write_version(destination, *v)
|
||||
end
|
Loading…
Reference in New Issue