autobuild 1.6.2.b1 → 1.6.2.b2

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,15 +15,22 @@ require 'autobuild/config'
15
15
  require 'autobuild/exceptions'
16
16
 
17
17
  module Autobuild
18
+ class << self
19
+ attr_reader :display_lock
20
+ end
21
+ @display_lock = Mutex.new
22
+
18
23
  def self.message(*args)
19
- if @last_progress_msg
20
- puts
21
- @last_progress_msg = nil
22
- end
23
- if args.empty?
24
- puts
25
- else
26
- puts "#{color(*args)}"
24
+ display_lock.synchronize do
25
+ if @last_progress_msg
26
+ puts
27
+ @last_progress_msg = nil
28
+ end
29
+ if args.empty?
30
+ puts
31
+ else
32
+ puts "#{color(*args)}"
33
+ end
27
34
  end
28
35
  end
29
36
 
@@ -34,12 +41,12 @@ module Autobuild
34
41
 
35
42
  # Displays an error message
36
43
  def self.error(message)
37
- Autoproj.message(" ERROR: #{message}", :red, :bold)
44
+ Autobuild.message(" ERROR: #{message}", :red, :bold)
38
45
  end
39
46
 
40
47
  # Displays a warning message
41
48
  def self.warn(message)
42
- Autoproj.message(" WARN: #{message}", :magenta)
49
+ Autobuild.message(" WARN: #{message}", :magenta)
43
50
  end
44
51
 
45
52
 
@@ -50,9 +57,11 @@ module Autobuild
50
57
  options = Hash.new
51
58
  end
52
59
 
53
- progress_done(key)
54
- progress_messages << [key, color(*args)]
55
- display_progress
60
+ display_lock.synchronize do
61
+ progress_done(key)
62
+ progress_messages << [key, color(*args)]
63
+ display_progress
64
+ end
56
65
 
57
66
  if block_given?
58
67
  begin
@@ -67,29 +76,33 @@ module Autobuild
67
76
  end
68
77
  def self.progress(key, *args)
69
78
  found = false
70
- progress_messages.map! do |msg_key, msg|
71
- if msg_key == key
72
- found = true
73
- [msg_key, color(*args)]
74
- else
75
- [msg_key, msg]
79
+ display_lock.synchronize do
80
+ progress_messages.map! do |msg_key, msg|
81
+ if msg_key == key
82
+ found = true
83
+ [msg_key, color(*args)]
84
+ else
85
+ [msg_key, msg]
86
+ end
76
87
  end
88
+ if !found
89
+ progress_messages << [key, color(*args)]
90
+ end
91
+ display_progress
77
92
  end
78
- if !found
79
- progress_messages << [key, color(*args)]
80
- end
81
- display_progress
82
93
  end
83
94
  def self.progress_done(key)
84
95
  found = false
85
- progress_messages.delete_if do |msg_key, msg|
86
- if msg_key == key
87
- found = true
96
+ display_lock.synchronize do
97
+ progress_messages.delete_if do |msg_key, msg|
98
+ if msg_key == key
99
+ found = true
100
+ end
101
+ end
102
+ if found && @last_progress_msg
103
+ puts
104
+ display_progress
88
105
  end
89
- end
90
- if found && @last_progress_msg
91
- puts
92
- display_progress
93
106
  end
94
107
  found
95
108
  end
@@ -99,8 +112,11 @@ module Autobuild
99
112
  if @last_progress_msg && @last_progress_msg.length > msg.length
100
113
  print "\r" + " " * @last_progress_msg.length
101
114
  end
102
- print "\r #{msg}"
103
- @last_progress_msg = msg
115
+ print "\r #{msg}\r"
116
+ @last_progress_msg =
117
+ if msg.empty? then nil
118
+ else msg
119
+ end
104
120
  end
105
121
 
106
122
  # The exception type that is used to report multiple errors that occured
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.6.2.b1" unless defined? Autobuild::VERSION
2
+ VERSION = "1.6.2.b2" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2.b1
4
+ version: 1.6.2.b2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &17029640 !ruby/object:Gem::Requirement
16
+ requirement: &21511040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.7.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *17029640
24
+ version_requirements: *21511040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: utilrb
27
- requirement: &17029140 !ruby/object:Gem::Requirement
27
+ requirement: &21510560 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.3.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *17029140
35
+ version_requirements: *21510560
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdoc
38
- requirement: &17028600 !ruby/object:Gem::Requirement
38
+ requirement: &21510040 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '3.10'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *17028600
46
+ version_requirements: *21510040
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: hoe
49
- requirement: &17028140 !ruby/object:Gem::Requirement
49
+ requirement: &21509520 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '3.1'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *17028140
57
+ version_requirements: *21509520
58
58
  description: Collection of classes to handle build systems (CMake, autotools, ...)
59
59
  and import mechanisms (tarballs, CVS, SVN, git, ...). It also offers a Rake integration
60
60
  to import and build such software packages. It is the backbone of the autoproj (http://rock-robotics.org/autoproj)