Commit 63467863 by Marcos Augusto

handle errors when not in a rails folder

parent 84a9b0eb
......@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{annotate}
s.version = "2.2.2"
s.version = "2.2.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Marcos Piccinini"]
s.date = %q{2008-12-25}
s.date = %q{2008-12-26}
s.default_executable = %q{annotate}
s.description = %q{Annotates Rails Models and Routes}
s.email = ["x@nofxx.com"]
......
......@@ -13,4 +13,8 @@ OptionParser.new do |opts|
opts.on('-v', '--version') { puts "Annotate v#{Annotate::VERSION}"; exit }
end.parse!
Rake::Task[task].invoke
begin
Rake::Task[task].invoke
rescue NameError => e
puts "Can`t find Rake. Are we in a Rails folder?"
end
......@@ -2,10 +2,13 @@ $:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
module Annotate
VERSION = '2.2.2'
VERSION = '2.2.3'
end
load 'Rakefile'
Dir[File.join(File.dirname(__FILE__), 'tasks', '**/*.rake')].each { |rake| load rake }
begin
load 'Rakefile'
Dir[File.join(File.dirname(__FILE__), 'tasks', '**/*.rake')].each { |rake| load rake }
rescue LoadError => e
nil
end
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