diff --git a/Gemfile b/Gemfile index ddc859c..7caaf9a 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,3 @@ gemspec :path => 'oa-enterprise' gemspec :path => 'oa-more' gemspec :path => 'oa-oauth' gemspec :path => 'oa-openid' -gemspec :path => 'omniauth' diff --git a/Rakefile b/Rakefile index aa1f763..9ae2185 100644 --- a/Rakefile +++ b/Rakefile @@ -1,29 +1,72 @@ -require 'rake' -require File.expand_path('../omniauth/lib/omniauth/version', __FILE__) - -begin - require 'term/ansicolor' - include Term::ANSIColor -rescue LoadError - def cyan; '' end - def blue; '' end - def clear; '' end - def green; '' end - def red; '' end -end - -OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-enterprise oa-more omniauth) +OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-enterprise oa-more) 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) + OMNIAUTH_GEMS.each do |gem| + puts "#{gem} #{action}" + Dir.chdir(gem) do + yield end end end -desc 'Run specs for all of the gems.' +def version + File.read("VERSION").strip +end + +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 + +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,10 +77,10 @@ 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 @@ -45,63 +88,71 @@ 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 { |gem| FileUtils.rm_rf gem } + Dir["**/*.gem"].each do |gem| + FileUtils.rm_rf gem + end 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 diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..72f9fa8 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.2.4 \ No newline at end of file diff --git a/omniauth/lib/omniauth.rb b/lib/omniauth.rb similarity index 100% rename from omniauth/lib/omniauth.rb rename to lib/omniauth.rb diff --git a/oa-basic/VERSION b/oa-basic/VERSION new file mode 100644 index 0000000..72f9fa8 --- /dev/null +++ b/oa-basic/VERSION @@ -0,0 +1 @@ +0.2.4 \ No newline at end of file diff --git a/oa-basic/oa-basic.gemspec b/oa-basic/oa-basic.gemspec index c0728c5..1a8b007 100644 --- a/oa-basic/oa-basic.gemspec +++ b/oa-basic/oa-basic.gemspec @@ -1,9 +1,10 @@ # -*- 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' @@ -11,7 +12,7 @@ Gem::Specification.new do |gem| 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'] diff --git a/oa-core/VERSION b/oa-core/VERSION new file mode 100644 index 0000000..72f9fa8 --- /dev/null +++ b/oa-core/VERSION @@ -0,0 +1 @@ +0.2.4 \ No newline at end of file diff --git a/oa-core/oa-core.gemspec b/oa-core/oa-core.gemspec index 035137b..481efc1 100644 --- a/oa-core/oa-core.gemspec +++ b/oa-core/oa-core.gemspec @@ -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'] diff --git a/oa-enterprise/VERSION b/oa-enterprise/VERSION new file mode 100644 index 0000000..72f9fa8 --- /dev/null +++ b/oa-enterprise/VERSION @@ -0,0 +1 @@ +0.2.4 \ No newline at end of file diff --git a/oa-enterprise/oa-enterprise.gemspec b/oa-enterprise/oa-enterprise.gemspec index 78f3352..bbd1bab 100644 --- a/oa-enterprise/oa-enterprise.gemspec +++ b/oa-enterprise/oa-enterprise.gemspec @@ -1,13 +1,14 @@ # -*- 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' @@ -15,7 +16,7 @@ Gem::Specification.new do |gem| 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'] diff --git a/oa-more/VERSION b/oa-more/VERSION new file mode 100644 index 0000000..72f9fa8 --- /dev/null +++ b/oa-more/VERSION @@ -0,0 +1 @@ +0.2.4 \ No newline at end of file diff --git a/oa-more/oa-more.gemspec b/oa-more/oa-more.gemspec index af88855..c579938 100644 --- a/oa-more/oa-more.gemspec +++ b/oa-more/oa-more.gemspec @@ -1,11 +1,12 @@ # -*- 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' @@ -13,7 +14,7 @@ Gem::Specification.new do |gem| 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' diff --git a/oa-oauth/VERSION b/oa-oauth/VERSION new file mode 100644 index 0000000..72f9fa8 --- /dev/null +++ b/oa-oauth/VERSION @@ -0,0 +1 @@ +0.2.4 \ No newline at end of file diff --git a/oa-oauth/oa-oauth.gemspec b/oa-oauth/oa-oauth.gemspec index 4b2ef3b..31f24c8 100644 --- a/oa-oauth/oa-oauth.gemspec +++ b/oa-oauth/oa-oauth.gemspec @@ -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'] diff --git a/oa-openid/VERSION b/oa-openid/VERSION new file mode 100644 index 0000000..72f9fa8 --- /dev/null +++ b/oa-openid/VERSION @@ -0,0 +1 @@ +0.2.4 \ No newline at end of file diff --git a/oa-openid/oa-openid.gemspec b/oa-openid/oa-openid.gemspec index 9af5819..cf8624c 100644 --- a/oa-openid/oa-openid.gemspec +++ b/oa-openid/oa-openid.gemspec @@ -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'] diff --git a/omniauth/omniauth.gemspec b/omniauth.gemspec similarity index 85% rename from omniauth/omniauth.gemspec rename to omniauth.gemspec index f18758f..293fee5 100644 --- a/omniauth/omniauth.gemspec +++ b/omniauth.gemspec @@ -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'] diff --git a/omniauth/.gemtest b/omniauth/.gemtest deleted file mode 100644 index e69de29..0000000 diff --git a/omniauth/LICENSE b/omniauth/LICENSE deleted file mode 100644 index 811fa0e..0000000 --- a/omniauth/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-2011 Michael Bleigh and Intridea, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/omniauth/README.rdoc b/omniauth/README.rdoc deleted file mode 100644 index 7feb94a..0000000 --- a/omniauth/README.rdoc +++ /dev/null @@ -1,17 +0,0 @@ -= OmniAuth - -Description goes here. - -== Note on Patches/Pull Requests - -* Fork the project. -* Make your feature addition or bug fix. -* Add tests for it. This is important so I don't break it in a - future version unintentionally. -* Commit, do not mess with rakefile, version, or history. - (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) -* Send me a pull request. Bonus points for topic branches. - -== Copyright - -Copyright (c) 2010 Michael Bleigh. See LICENSE for details. diff --git a/omniauth/Rakefile b/omniauth/Rakefile deleted file mode 100644 index 14cfe0b..0000000 --- a/omniauth/Rakefile +++ /dev/null @@ -1,2 +0,0 @@ -require 'bundler' -Bundler::GemHelper.install_tasks diff --git a/omniauth/lib/omniauth/version.rb b/omniauth/lib/omniauth/version.rb deleted file mode 100644 index 748e2cb..0000000 --- a/omniauth/lib/omniauth/version.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Omniauth - # The version of the gem - VERSION = '0.2.4'.freeze unless defined?(::Omniauth::VERSION) -end -