Permalink
Browse files

Add Tasks.unless_installing_dependencies

  • Loading branch information...
1 parent 359e3f7 commit 07d17d66f1bd11029b3ef0cadcbd3c1eafd8f250 Nikolai Weibull committed Apr 27, 2012
Showing with 16 additions and 4 deletions.
  1. +5 −3 Rakefile
  2. +8 −0 lib/inventory/rake/tasks.rb
  3. +3 −1 lib/inventory/rake/version.rb
View
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
-require 'lookout/rake-3.0'
-
$:.unshift File.expand_path('../lib', __FILE__)
require 'inventory/rake-1.0'
@@ -10,4 +8,8 @@ Inventory::Rake::Tasks.define Inventory::Rake::Version, :gem => proc{ |_, s|
s.email = 'now@bitwi.se'
s.homepage = 'https://github.com/now/inventory-rake'
}
-Lookout::Rake::Tasks::Test.new
+
+Inventory::Rake::Tasks.unless_installing_dependencies do
+ require 'lookout/rake-3.0'
+ Lookout::Rake::Tasks::Test.new
+end
@@ -15,5 +15,13 @@ def define(inventory, options = {})
Inventory.new(:inventory => inventory)
Gem.new(:inventory => inventory, &(options.fetch(:gem, proc{ })))
end
+
+ def unless_installing_dependencies
+ yield if (%w'deps:install
+ deps:install:user
+ gem:deps:install
+ gem:deps:install:user' &
+ Rake.application.top_level_tasks).empty?
+ end
end
end
@@ -3,9 +3,11 @@
require 'inventory-1.0'
module Inventory::Rake
- Version = Inventory.new(1, 2, 0){
+ Version = Inventory.new(1, 3, 0){
def dependencies
super + Inventory::Dependencies.new{
+ development 'lookout', 3, 0, 0
+ development 'lookout-rake', 3, 0, 0
optional 'rake', 0, 9, 2
}
end

0 comments on commit 07d17d6

Please sign in to comment.