Skip to content

Commit

Permalink
Removing rspec rake requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed Mar 20, 2011
1 parent 7d56265 commit db40128
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Rakefile
Expand Up @@ -3,7 +3,11 @@ require File.dirname(__FILE__) + '/lib/gem_template/gems'
GemTemplate::Gems.activate %w(rake rspec)

require 'rake'
require 'spec/rake/spectask'

begin
require 'spec/rake/spectask'
rescue Exception => e
end

def gemspec
@gemspec ||= begin
Expand Down
9 changes: 7 additions & 2 deletions lib/gem_template/gems.rb
Expand Up @@ -39,12 +39,17 @@ def activate(*gems)
gems.flatten.collect { |g| g.to_sym }.each do |name|
version = @versions[name]
vendor = File.expand_path("../../../vendor/#{name}/lib", __FILE__)
warning = "#{name} #{"(#{version})" if version} failed to activate"
if File.exists?(vendor)
$:.unshift vendor
elsif defined?(gem)
gem name.to_s, version
begin
gem name.to_s, version
rescue Exception => e
puts warning if @config.warn
end
else
puts "#{name} #{"(#{version})" if version} failed to activate" if @config.warn
puts warning if @config.warn
end
end
end
Expand Down

0 comments on commit db40128

Please sign in to comment.