Commit d5cff4cf by Jon Frisby

Improved code loading, incl. support for older versions of Rake.

parent 68f459be
source :rubygems
gem "rake"
gem 'rake', '>= 0.8.7', :require => false
gem 'activesupport', '>= 2.3.0', :require => false
group :development do
gem 'mg'
gem 'rspec'
gem 'wrong', '>=0.6.2'
gem 'files', '>=0.2.1'
platforms :ruby do
gem 'yard', :require => false
end
end
gem 'activesupport', '>= 3.0.0', :require => nil
group :development, :test do
gem 'rspec', :require => false
platforms :ruby do
gem 'pry', :require => false
gem 'pry-coolline', :require => false
end
end
group :test do
gem 'wrong', '>=0.6.2', :require => false
gem 'files', '>=0.2.1', :require => false
end
here = File.dirname __FILE__
# Note : this causes annoying psych warnings under Ruby 1.9.2-p180; to fix, upgrade to 1.9.3
begin
require 'bundler'
......@@ -10,11 +8,19 @@ rescue Bundler::BundlerError => e
exit e.status_code
end
require 'rake/dsl_definition'
using_dsl = false
begin
require 'rake/dsl_definition'
using_dsl = true
rescue Exception => e
# We might just be on an old version of Rake...
end
require 'rake'
include Rake::DSL
if(using_dsl)
include Rake::DSL
end
require "#{here}/lib/annotate"
require "./lib/annotate"
# want other tests/tasks run by default? Add them to the list
task :default => [:spec]
......
#!/usr/bin/env ruby
require 'rubygems'
begin
require 'bundler'
Bundler.setup
rescue Exception => e
end
here = File.expand_path(File.dirname __FILE__)
$:<< "#{here}/../lib"
require 'optparse'
require 'rake/dsl_definition'
require 'rake'
begin
require "annotate"
rescue LoadError
here = File.expand_path(File.dirname __FILE__)
$:<< "#{here}/../lib"
require "annotate"
require 'rake/dsl_definition'
rescue Exception => e
# We might just be on an old version of Rake...
end
require 'rake'
require 'annotate'
task = :annotate_models
......
here = File.dirname __FILE__
require "#{here}/annotate/version"
$:.unshift(File.dirname(__FILE__))
require 'annotate/version'
module Annotate
def self.load_tasks
......
begin
require 'rspec'
rescue LoadError
require 'rubygems'
gem 'rspec'
require 'rspec'
end
require 'rubygems'
require 'bundler'
Bundler.setup
require "wrong/adapters/rspec"
require 'rspec'
require 'wrong/adapters/rspec'
$:.unshift(File.join(File.dirname(__FILE__), '../lib'))
$:.unshift(File.dirname(__FILE__))
$:.unshift(File.dirname(__FILE__) + '/../lib')
require 'active_support'
require 'active_support/core_ext/string/inflections'
require 'annotate'
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