Commit a6f54978 by Jon Frisby

Merge over change to gemspec handling.

parent 89548ee7
source :rubygems
gem 'rake', '>= 0.8.7', :require => false
gem 'activesupport', '>= 2.3.0', :require => false
gem 'activerecord', '>= 2.3.0', :require => false
group :development do
gem 'mg'
platforms :ruby do
gem 'mg', :require => false
platforms :mri do
gem 'yard', :require => false
end
end
......
......@@ -22,8 +22,73 @@ end
require "./lib/annotate"
require 'mg'
MG.new("annotate.gemspec")
require "mg"
begin
MG.new("annotate.gemspec")
rescue Exception => e
STDERR.puts("WARNING: Couldn't read gemspec. As such, a number of tasks may be unavailable to you until you run 'rake gem:gemspec' to correct the issue.")
# Gemspec is probably in a broken state, so let's give ourselves a chance to
# build a new one...
end
DEVELOPMENT_GROUPS=[:development, :test]
RUNTIME_GROUPS=Bundler.definition.groups - DEVELOPMENT_GROUPS
namespace :gem do
task :gemspec do
spec = Gem::Specification.new do |gem|
# See http://docs.rubygems.org/read/chapter/20
# for more options.
gem.version = Annotate.version
gem.name = "annotate"
gem.homepage = "http://github.com/ctran/annotate_models"
gem.rubyforge_project = "annotate"
gem.license = "Ruby"
gem.summary = %q{Annotates Rails Models, routes, fixtures, and others based on the database schema.}
gem.description = %q{Annotates Rails/ActiveRecord Models, routes, fixtures, and others based on the database schema.}
gem.email = ["alex@stinky.com", "ctran@pragmaquest.com", "x@nofxx.com", "turadg@aleahmad.net", "jon@cloudability.com"]
gem.authors = ["Cuong Tran", "Alex Chaffee", "Marcos Piccinini", "Turadg Aleahmad", "Jon Frisby"]
gem.require_paths = ["lib"]
# gem.rdoc_options = ["--charset=UTF-8"]
# gem.required_ruby_version = "> 1.9.2"
Bundler.load.dependencies_for(*RUNTIME_GROUPS).each do |dep|
runtime_resolved = Bundler.definition.specs_for(RUNTIME_GROUPS).select { |spec| spec.name == dep.name }.first
if(!runtime_resolved.nil?)
gem.add_dependency(dep.name, dep.requirement)
end
end
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.extra_rdoc_files = ['README.rdoc', 'CHANGELOG.rdoc', 'TODO.rdoc']
gem.files = `git ls-files -- .`.split("\n").reject do |fn|
fn =~ /^Gemfile.*/ ||
fn =~ /^Rakefile/ ||
fn =~ /^\.rvmrc/ ||
fn =~ /^\.gitignore/ ||
fn =~ /^\.rspec/ ||
fn =~ /^\.document/ ||
fn =~ /^\.yardopts/ ||
fn =~ /^pkg/ ||
fn =~ /^spec/ ||
fn =~ /^doc/ ||
fn =~ /^vendor\/cache/
end.sort
end
File.open("annotate.gemspec", "wb") do |fh|
fh.write("# This file is auto-generated!\n")
fh.write("# DO NOT EDIT THIS FILE DIRECTLY!\n")
fh.write("# Instead, edit the Rakefile and run 'rake gems:gemspec'.")
fh.write(spec.to_ruby)
end
end
end
namespace :jeweler do
task :clobber do
FileUtils.rm_f("pkg")
end
end
task :clobber => :'jeweler:clobber'
require "rspec/core/rake_task" # RSpec 2.0
RSpec::Core::RakeTask.new(:spec) do |t|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment