Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge over change to gemspec handling.

  • Loading branch information...
commit a6f54978b6e5fb5761db7bbb26f5c7d79c05de91 1 parent 89548ee
@MrJoy MrJoy authored
Showing with 70 additions and 5 deletions.
  1. +3 −3 Gemfile
  2. +67 −2 Rakefile
View
6 Gemfile
@@ -1,11 +1,11 @@
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
View
69 Rakefile
@@ -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|
Please sign in to comment.
Something went wrong with that request. Please try again.