Permalink
Browse files

Gem dependency refactor

  • Loading branch information...
1 parent 051d69e commit 9d19c63b97e0f2e218d8bcff84fc7bc79b7b1562 @sferik sferik committed Apr 22, 2011
View
No changes.
View
@@ -0,0 +1,4 @@
+--markup markdown
+--markup-provider maruku
+-
+LICENSE
View
15 Gemfile
@@ -1,10 +1,9 @@
source 'http://rubygems.org'
-OMNIAUTH_GEMS = %w(oa-basic oa-core oa-oauth oa-openid oa-enterprise oa-more omniauth)
-
-OMNIAUTH_GEMS.each do |jem|
- gem jem, :path => jem
-end
-
-eval File.read(File.join(File.dirname(__FILE__), '/development_dependencies.rb'))
-
+gemspec :path => 'oa-basic'
+gemspec :path => 'oa-core'
+gemspec :path => 'oa-enterprise'
+gemspec :path => 'oa-more'
+gemspec :path => 'oa-oauth'
+gemspec :path => 'oa-openid'
+gemspec :path => 'omniauth'
View
127 Rakefile
@@ -1,4 +1,3 @@
-require 'rubygems'
require 'rake'
begin
@@ -23,44 +22,12 @@ def each_gem(action, &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
error_gems = []
- each_gem('specs are running...') do |jem|
- ENV['RSPEC_FORMAT'] = 'progress'
+ each_gem('specs are running...') do |gem|
unless system('rake spec')
- error_gems << jem
+ error_gems << gem
end
end
@@ -73,99 +40,56 @@ task :spec do
end
end
-namespace :dependencies do
- desc 'Install all dependencies via Bundler'
- task :install do
- each_gem('is installing dependencies...') do
- system('bundle install')
- end
- end
-end
-
task :release => ['release:tag', 'gems:publish', 'doc:pages:publish']
-namespace :release do
- task :tag do
- system("git tag v#{version}")
- system('git push origin --tags')
+desc 'Push all gems to Gemcutter'
+task :push do
+ each_gem('is releasing to Gemcutter...') do
+ system('rake release')
end
end
-namespace :gems do
-
- desc 'Build all gems'
- task :build do
- each_gem('is building gems...') do
- system('rake gem')
- end
- end
-
- desc 'Push all gems to Gemcutter'
- task :push do
- each_gem('is releasing to Gemcutter...') do
- system('rake gem:publish')
- end
+desc 'Build all gems'
+task :build do
+ each_gem('is building gems...') do
+ system('rake build')
end
+end
- desc 'Install all gems'
- task :install do
- each_gem('is installing gems...') do
- system('rake gem:install')
- end
+desc 'Install all gems'
+task :install do
+ each_gem('is installing gems...') do
+ system('rake install')
end
-
- desc "Uninstall gems"
- task :uninstall do
- sh "sudo gem uninstall #{OMNIAUTH_GEMS.join(" ")} -a"
- end
-
+end
+
+desc "Uninstall gems"
+task :uninstall do
+ sh "sudo gem uninstall #{OMNIAUTH_GEMS.join(" ")} -a"
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 }
+ %w(tmp pkg coverage dist).each{|d| FileUtils.rm_rf d}
end
end
Dir["**/*.gem"].each { |gem| FileUtils.rm_rf gem }
end
-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
- desc "Increment the major version."
- task(:major){ bump_version(0) }
- desc "Increment the minor version."
- task(:minor){ bump_version(1) }
- desc "Increment the patch version."
- task(:patch){ bump_version(2) }
- end
-end
-
task :default => :spec
+task :test => :spec
begin
- YARD_OPTS = ['-m', 'markdown', '-M', 'maruku']
require 'yard'
YARD::Rake::YardocTask.new(:doc) do |t|
- t.files = OMNIAUTH_GEMS.inject([]){|a,g| a = a + ["#{g}/lib/**/*.rb"]; a} + ['README.markdown']
- t.options = YARD_OPTS
+ 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']
- t.options = YARD_OPTS + ['-o', '../omniauth.doc']
+ t.files = OMNIAUTH_GEMS.inject([]){|a,g| a = a + ["#{g}/lib/**/*.rb"]; a} + ['README.markdown']
end
namespace :pages do
@@ -174,12 +98,9 @@ begin
Dir.chdir(File.dirname(__FILE__) + '/../omniauth.doc') do
system("git add .")
system("git add -u")
- system("git commit -m 'Generating docs for version #{version}.'")
system("git push origin gh-pages")
end
end
end
end
-rescue LoadError
- puts "You need to install YARD."
end
View
@@ -1 +0,0 @@
-0.2.3
@@ -1,29 +0,0 @@
-# to be evaluated within the context of a Gemspec or a Gemfile
-
-# It's ridiculous that Bundler can't sync up with .gemspec files for
-# development dependencies. Until it can, make sure to keep these
-# two blocks parallel.
-if Object.const_defined?(:Bundler) && Bundler.const_defined?(:Dsl) && self.kind_of?(Bundler::Dsl)
- group :development do
- gem 'addressable', '2.2.4'
- gem 'rack'
- gem 'rake'
- gem 'mg', '~> 0.0.8'
- gem 'rspec', '~> 2.5.0'
- gem 'webmock', '~> 1.6.2'
- gem 'rack-test', '~> 0.5.4'
- gem 'json_pure', '~> 1.5.1' # multi_json implementation
- gem 'evernote', '~> 0.9.0' unless RUBY_PLATFORM == 'java'
- gem 'jruby-openssl', '~> 0.7.2' if RUBY_PLATFORM == 'java'
- end
-else #gemspec
- gem.add_development_dependency 'addressable', '0.2.4'
- gem.add_development_dependency 'rake'
- gem.add_development_dependency 'mg', '~> 0.0.8'
- gem.add_development_dependency 'rspec', '~> 1.3.0'
- gem.add_development_dependency 'webmock', '~> 1.3.4'
- gem.add_development_dependency 'rack-test', '~> 0.5.4'
- gem.add_development_dependency 'json_pure', '~> 1.5.1' # multi_json implementation
- gem.add_development_dependency 'evernote', '~> 0.9.0' unless RUBY_PLATFORM == 'java'
- gem.add_runtime_dependency('jruby-openssl', '~> 0.7.2') if RUBY_PLATFORM == 'java'
-end
View
No changes.
View
@@ -0,0 +1,4 @@
+--markup markdown
+--markup-provider maruku
+-
+LICENSE
View
@@ -1,9 +1,3 @@
-source "http://rubygems.org"
+source 'http://rubygems.org'
-gem 'oa-core', :path => File.expand_path('../../oa-core/', __FILE__)
-
-# Will automatically pull in this gem and all its
-# dependencies specified in the gemspec
-gem 'oa-basic', :path => File.expand_path("..", __FILE__)
-
-eval File.read(File.join(File.dirname(__FILE__), '../development_dependencies.rb'))
+gemspec
View
@@ -1,14 +1,6 @@
-require 'rubygems'
require 'bundler'
-Bundler.setup
-require 'rake'
-
-require 'mg'
-MG.new('oa-basic.gemspec')
-
+Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
-RSpec::Core::RakeTask.new(:spec) do |s|
- s.rspec_opts = "--format=#{ENV['RSPEC_FORMAT'] || 'nested'} --colour"
-end
-
+RSpec::Core::RakeTask.new(:spec)
task :default => :spec
+task :test => :spec
View
@@ -1,22 +1,25 @@
-require 'rubygems'
-
-version = File.open(File.dirname(__FILE__) + '/../VERSION', 'r').read.strip
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../omniauth/lib/omniauth/version', __FILE__)
Gem::Specification.new do |gem|
- gem.name = "oa-basic"
- gem.version = version
- gem.summary = %Q{HTTP Basic strategies for OmniAuth.}
- gem.description = %Q{HTTP Basic strategies for OmniAuth.}
- gem.email = "michael@intridea.com"
- gem.homepage = "http://github.com/intridea/omniauth"
- gem.authors = ["Michael Bleigh"]
-
- gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE)
-
- gem.add_dependency 'oa-core', version
- gem.add_dependency 'rest-client', '~> 1.6.0'
- gem.add_dependency 'multi_json', '~> 0.0.2'
- gem.add_dependency 'nokogiri', '~> 1.4.2'
-
- eval File.read(File.join(File.dirname(__FILE__), '../development_dependencies.rb'))
+ gem.add_runtime_dependency 'oa-core', Omniauth::VERSION.dup
+ gem.add_runtime_dependency 'rest-client', '~> 1.6.0'
+ 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.summary = %q{HTTP Basic strategies for OmniAuth.}
+ gem.description = %q{HTTP Basic strategies for OmniAuth.}
+ gem.email = ['michael@intridea.com', 'sferik@gmail.com']
+ gem.homepage = 'http://github.com/intridea/omniauth'
+ gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
+ gem.files = `git ls-files`.split("\n")
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ gem.require_paths = ['lib']
+ gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if gem.respond_to? :required_rubygems_version=
end
View
No changes.
View
@@ -0,0 +1,4 @@
+--markup markdown
+--markup-provider maruku
+-
+LICENSE
View
@@ -1,6 +1,3 @@
-source "http://rubygems.org"
+source 'http://rubygems.org'
-# Will automatically pull in this gem and all its
-# dependencies specified in the gemspec
-gem 'oa-core', :path => File.expand_path("..", __FILE__)
-eval File.read(File.join(File.dirname(__FILE__), '../development_dependencies.rb'))
+gemspec
View
@@ -1,14 +1,6 @@
-require 'rubygems'
require 'bundler'
-Bundler.setup
-require 'rake'
-
-require 'mg'
-MG.new('oa-core.gemspec')
-
+Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
-RSpec::Core::RakeTask.new(:spec) do |s|
- s.rspec_opts = "--format=#{ENV['RSPEC_FORMAT'] || 'nested'} --colour"
-end
-
+RSpec::Core::RakeTask.new(:spec)
task :default => :spec
+task :test => :spec
View
@@ -1,17 +1,22 @@
-version = File.open(File.dirname(__FILE__) + '/../VERSION', 'r').read.strip
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../omniauth/lib/omniauth/version', __FILE__)
Gem::Specification.new do |gem|
- gem.name = "oa-core"
- gem.version = version
- gem.summary = %Q{HTTP Basic strategies for OmniAuth.}
- gem.description = %Q{HTTP Basic strategies for OmniAuth.}
- gem.email = "michael@intridea.com"
- gem.homepage = "http://github.com/intridea/omniauth"
- gem.authors = ["Michael Bleigh"]
-
- gem.files = Dir.glob("{lib}/**/*") + %w(LICENSE)
-
- gem.add_dependency 'rack', '~> 1.1'
-
- eval File.read(File.join(File.dirname(__FILE__), '../development_dependencies.rb'))
+ 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.summary = %q{HTTP Basic strategies for OmniAuth.}
+ gem.description = %q{HTTP Basic strategies for OmniAuth.}
+ gem.email = ['michael@intridea.com', 'sferik@gmail.com']
+ gem.homepage = 'http://github.com/intridea/omniauth'
+ gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
+ gem.files = `git ls-files`.split("\n")
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ gem.require_paths = ['lib']
+ gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if gem.respond_to? :required_rubygems_version=
end
@@ -1,3 +1,5 @@
+require 'simplecov'
+SimpleCov.start
require 'rubygems'
require 'bundler'
Bundler.setup
View
No changes.
Oops, something went wrong.

0 comments on commit 9d19c63

Please sign in to comment.