autobuild 1.7.12.rc5 → 1.7.12.rc6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a4395f370d1e1c38b7e5b47ee51c44c21c4cf50
4
- data.tar.gz: 2fbb94fa41c844eb6f883c89e82707bd5d11cee9
3
+ metadata.gz: 2adc58accd29a554c2853a23fe117ea15e021263
4
+ data.tar.gz: f5c20d74ad6ab876b0f20e0edd3f4a6137cac1c3
5
5
  SHA512:
6
- metadata.gz: ffc19e8cf7505968892cbb0428f4e24bc4bd77c29cb5e9b6837e23fab111ab8ad1c53fffd2560a47d475f8e8d142f176c249939bb8dbf3b9ccf5b0d759de993b
7
- data.tar.gz: 2084cca9a550f9176f793f22a96040ce1cc0ba0be484d8463f6593b9c810fe160a094079081bb8b62f0bf832852b070b463e5390f7372bf82de70032639495a0
6
+ metadata.gz: cb1d9df085fee0ee0e9b1fcf89497d57c09b2be06ef3559725f54135b367f9b468a2332078fb0246969218b2e533af7ef824cb9fd9354009055eeb22f212369e
7
+ data.tar.gz: c01f8ded6b0a6ab6a5bb15e7c96c5515ddf6802ec9c1b1c9f99a8a16310ed06203d160a1e6d5ae24cd4adbc743e377dc4f57150e61ccbff19d3ad75902dca511
@@ -476,6 +476,7 @@ module Autobuild
476
476
  # and installed.
477
477
  def depends_on(*packages)
478
478
  packages.each do |p|
479
+ p = p.name if p.respond_to?(:name)
479
480
  raise ArgumentError, "#{p.inspect} should be a string" if !p.respond_to? :to_str
480
481
  p = p.to_str
481
482
  next if p == name
@@ -79,14 +79,14 @@ module Autobuild
79
79
  attr_reader :reverse_dependencies
80
80
  attr_reader :processed
81
81
  attr_reader :started_packages
82
- attr_reader :active_packages
82
+ attr_reader :active_tasks
83
83
  attr_reader :queue
84
84
  attr_reader :priorities
85
85
 
86
86
  def initialize(reverse_dependencies)
87
87
  @reverse_dependencies = reverse_dependencies
88
88
  @processed = Set.new
89
- @active_packages = Set.new
89
+ @active_tasks = Set.new
90
90
  @priorities = Hash.new
91
91
  @started_packages = Hash.new
92
92
  @queue = Hash.new
@@ -94,7 +94,8 @@ module Autobuild
94
94
 
95
95
  def push(task, base_priority = 1)
96
96
  if task.respond_to?(:package)
97
- queue[task] = started_packages[task.package] || base_priority
97
+ started_packages[task.package] ||= -started_packages.size
98
+ queue[task] = started_packages[task.package]
98
99
  else queue[task] = base_priority
99
100
  end
100
101
  end
@@ -113,25 +114,32 @@ module Autobuild
113
114
  end
114
115
 
115
116
  def mark_as_active(pending_task)
116
- if pending_task.respond_to?(:package) && !pending_task.kind_of?(Autobuild::SourceTreeTask)
117
- active_packages << pending_task.package
118
- started_packages[pending_task.package] ||= -started_packages.size
119
- end
117
+ active_tasks << pending_task
118
+ end
119
+
120
+ def active_task?(task)
121
+ active_tasks.include?(task)
120
122
  end
121
123
 
122
124
  def ready?(task)
123
125
  task.prerequisite_tasks.all? do |t|
124
- t.already_invoked?
126
+ already_processed?(t)
125
127
  end
126
128
  end
127
129
 
130
+ def already_processed?(task)
131
+ task.already_invoked? && !active_task?(task)
132
+ end
133
+
134
+ def needs_processing?(task)
135
+ !task.already_invoked? && !active_task?(task)
136
+ end
137
+
128
138
  def process_finished_task(task)
129
- if task.respond_to?(:package)
130
- active_packages.delete(task.package)
131
- end
139
+ active_tasks.delete(task)
132
140
  processed << task
133
141
  reverse_dependencies[task].each do |candidate|
134
- if !candidate.already_invoked? && ready?(candidate)
142
+ if needs_processing?(candidate) && ready?(candidate)
135
143
  push(candidate, priorities[task])
136
144
  end
137
145
  end
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.7.12.rc5" unless defined? Autobuild::VERSION
2
+ VERSION = "1.7.12.rc6" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.12.rc5
4
+ version: 1.7.12.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-23 00:00:00.000000000 Z
11
+ date: 2014-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake