autobuild 1.17.0 → 1.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +107 -0
  3. data/Gemfile +2 -1
  4. data/Rakefile +1 -4
  5. data/autobuild.gemspec +14 -11
  6. data/bin/autobuild +4 -3
  7. data/lib/autobuild.rb +4 -5
  8. data/lib/autobuild/build_logfile.rb +6 -4
  9. data/lib/autobuild/config.rb +90 -40
  10. data/lib/autobuild/configurable.rb +30 -18
  11. data/lib/autobuild/environment.rb +126 -120
  12. data/lib/autobuild/exceptions.rb +48 -31
  13. data/lib/autobuild/import/archive.rb +134 -82
  14. data/lib/autobuild/import/cvs.rb +28 -24
  15. data/lib/autobuild/import/darcs.rb +13 -16
  16. data/lib/autobuild/import/git-lfs.rb +37 -30
  17. data/lib/autobuild/import/git.rb +231 -179
  18. data/lib/autobuild/import/hg.rb +23 -18
  19. data/lib/autobuild/import/svn.rb +48 -29
  20. data/lib/autobuild/importer.rb +530 -499
  21. data/lib/autobuild/mail_reporter.rb +77 -77
  22. data/lib/autobuild/package.rb +171 -101
  23. data/lib/autobuild/packages/autotools.rb +47 -42
  24. data/lib/autobuild/packages/cmake.rb +71 -65
  25. data/lib/autobuild/packages/dummy.rb +9 -8
  26. data/lib/autobuild/packages/genom.rb +1 -1
  27. data/lib/autobuild/packages/gnumake.rb +19 -13
  28. data/lib/autobuild/packages/import.rb +2 -6
  29. data/lib/autobuild/packages/orogen.rb +32 -31
  30. data/lib/autobuild/packages/pkgconfig.rb +2 -2
  31. data/lib/autobuild/packages/python.rb +7 -2
  32. data/lib/autobuild/packages/ruby.rb +22 -17
  33. data/lib/autobuild/parallel.rb +35 -39
  34. data/lib/autobuild/pkgconfig.rb +25 -13
  35. data/lib/autobuild/progress_display.rb +23 -23
  36. data/lib/autobuild/rake_task_extension.rb +6 -6
  37. data/lib/autobuild/reporting.rb +38 -26
  38. data/lib/autobuild/subcommand.rb +72 -65
  39. data/lib/autobuild/test.rb +8 -7
  40. data/lib/autobuild/test_utility.rb +10 -9
  41. data/lib/autobuild/timestamps.rb +28 -23
  42. data/lib/autobuild/tools.rb +17 -16
  43. data/lib/autobuild/utility.rb +16 -18
  44. data/lib/autobuild/version.rb +1 -1
  45. metadata +39 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43869aed86ff761f4f091a8c5dbd4d27cdb481cd2b60bf4843bd259366d2a88b
4
- data.tar.gz: c62531880b13b4401323193c8bbbc1d095ae1f0201aecf16646c5f316f7aff03
3
+ metadata.gz: c3203bb516411ada5796ebf11313d0be7731f6068361ac526424938700c886bf
4
+ data.tar.gz: 5b988ac45c9c2cc3216e73d7917a61555a0171d830e94fe4d59edb95938ed49d
5
5
  SHA512:
6
- metadata.gz: 47a3d57e94becd1e6e96ccf36902e5cb908d56d3faf0ee0f18904c041caae1940eaa959b51ae641c9de826c6cf211a42953a81268a61d4bf60efce9173bf373f
7
- data.tar.gz: e6edd90897e22b8dd0e89e490027ebb2c2632bc3c201355a787bf83413b8958a5ee97a3aab6da0e6dbe96fde093d453032244fcca7145af99f578ad3c425874d
6
+ metadata.gz: 46805b87b14989037a618067c414b046945e586a138f9dfb56c3ab80d34132c233f9df28a55860cf41f69b799ffe98b0d22bdcbe6d86aea7c788f4783bfc1838
7
+ data.tar.gz: b3afdff0d56e867853f4d440eb758c9866885efedea1099cedaf19271653d8680646d5efeca895aa814024e09e58cef7cbe5966116ef02337d1d546582319f86
@@ -0,0 +1,107 @@
1
+ inherit_gem:
2
+ rubocop-rock: defaults.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: "2.3"
6
+ Exclude:
7
+ - lib/autobuild/packages/genom.rb
8
+ - vendor/**/*
9
+ - pkg/**/*
10
+
11
+ Style/ClassVars:
12
+ Enabled: false
13
+
14
+ Style/TrivialAccessors:
15
+ IgnoreClassMethods: true
16
+
17
+ Naming/PredicateName:
18
+ Enabled: false
19
+
20
+ Lint/SplatKeywordArguments:
21
+ Enabled: false
22
+
23
+ Style/FrozenStringLiteralComment:
24
+ Enabled: false
25
+
26
+ Style/AccessModifierDeclarations:
27
+ EnforcedStyle: inline
28
+
29
+ Naming/FileName:
30
+ Exclude:
31
+ - lib/autobuild/import/git-lfs.rb
32
+
33
+
34
+
35
+
36
+ Layout/AlignParameters:
37
+ Enabled: false
38
+
39
+ Layout/DotPosition:
40
+ Enabled: false
41
+
42
+ Layout/FirstParameterIndentation:
43
+ Enabled: false
44
+
45
+ Layout/IndentAssignment:
46
+ Enabled: false
47
+
48
+ Layout/IndentationWidth:
49
+ Enabled: false
50
+
51
+ Layout/MultilineMethodCallBraceLayout:
52
+ Enabled: false
53
+
54
+ Layout/MultilineMethodCallIndentation:
55
+ Enabled: false
56
+
57
+ Lint/RescueException:
58
+ Enabled: false
59
+
60
+ Metrics/AbcSize:
61
+ Enabled: false
62
+
63
+ Metrics/BlockLength:
64
+ Enabled: false
65
+
66
+ Metrics/ClassLength:
67
+ Enabled: false
68
+
69
+ Metrics/CyclomaticComplexity:
70
+ Enabled: false
71
+
72
+ Metrics/MethodLength:
73
+ Enabled: false
74
+
75
+ Metrics/PerceivedComplexity:
76
+ Enabled: false
77
+
78
+ Style/ClassCheck:
79
+ Enabled: false
80
+
81
+ Style/Documentation:
82
+ Enabled: false
83
+
84
+ Style/EmptyLiteral:
85
+ Enabled: false
86
+
87
+ Style/GuardClause:
88
+ Enabled: false
89
+
90
+ Style/HashSyntax:
91
+ Enabled: false
92
+
93
+ Style/PerlBackrefs:
94
+ Enabled: false
95
+
96
+ Style/StringLiterals:
97
+ Enabled: false
98
+
99
+ Layout/IndentHeredoc:
100
+ Enabled: false
101
+
102
+ Metrics/LineLength:
103
+ Max: 90
104
+ Exclude:
105
+ - test/**/*
106
+
107
+
data/Gemfile CHANGED
@@ -3,10 +3,11 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :vscode do
6
+ gem 'debase', '>= 0.2.2.beta10'
6
7
  gem 'pry'
7
8
  gem 'pry-byebug'
8
9
  gem 'rubocop', '>= 0.6.0'
10
+ gem 'rubocop-rock'
9
11
  gem 'ruby-debug-ide', '>= 0.6.0'
10
- gem 'debase', '>= 0.2.2.beta10'
11
12
  gem 'solargraph'
12
13
  end
data/Rakefile CHANGED
@@ -8,9 +8,6 @@ Rake::TestTask.new(:test) do |t|
8
8
  t.libs << "lib" << Dir.pwd
9
9
 
10
10
  test_files = Rake::FileList['test/**/test_*.rb']
11
- if !File.executable?('/usr/bin/cvs')
12
- test_files.exclude('test/import/test_cvs.rb')
13
- end
11
+ test_files.exclude('test/import/test_cvs.rb') unless File.executable?('/usr/bin/cvs')
14
12
  t.test_files = test_files
15
13
  end
16
-
@@ -1,33 +1,36 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'autobuild/version'
5
4
 
6
5
  Gem::Specification.new do |s|
7
6
  s.name = "autobuild"
8
7
  s.version = Autobuild::VERSION
9
- s.required_ruby_version = '>= 2.1.0'
8
+ s.required_ruby_version = '>= 2.3.0'
10
9
  s.authors = ["Sylvain Joyeux"]
11
10
  s.email = "sylvain.joyeux@m4x.org"
12
11
  s.summary = "Library to handle build systems and import mechanisms"
13
- s.description = "Collection of classes to handle build systems (CMake, autotools, ...) and import mechanisms (tarballs, CVS, SVN, git, ...). It also offers a Rake integration to import and build such software packages. It is the backbone of the autoproj (http://rock-robotics.org/autoproj) integrated software project management tool."
12
+ s.description = "Collection of classes to handle build systems "\
13
+ "(CMake, autotools, ...) and import mechanisms "\
14
+ "(tarballs, CVS, SVN, git, ...). It also offers a Rake integration "\
15
+ "to import and build such software packages. It is the backbone "\
16
+ "of the autoproj (http://rock-robotics.org/autoproj) integrated "\
17
+ "software project management tool."
14
18
  s.homepage = "http://rock-robotics.org"
15
19
  s.licenses = ["BSD"]
16
20
 
17
- s.required_ruby_version = ">= 1.9.3"
18
21
  s.require_paths = ["lib"]
19
22
  s.extensions = []
20
- s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
+ s.files = `git ls-files -z`.split("\x0")
24
+ .reject { |f| f.match(%r{^(test|spec|features)/}) }
21
25
 
26
+ s.add_runtime_dependency 'pastel', '~> 0.7.0', '>= 0.7.0'
22
27
  s.add_runtime_dependency "rake", "~> 12.0", ">= 12.3.0"
23
- s.add_runtime_dependency "utilrb", "~> 3.0", ">= 3.0"
24
- s.add_runtime_dependency 'tty-prompt', '~> 0.15.0'
25
28
  s.add_runtime_dependency 'tty-cursor', '~> 0.5.0'
29
+ s.add_runtime_dependency 'tty-prompt', '~> 0.15.0'
26
30
  s.add_runtime_dependency 'tty-screen', '~> 0.6.4'
27
- s.add_runtime_dependency 'pastel', '~> 0.7.0', '>= 0.7.0'
31
+ s.add_runtime_dependency "utilrb", "~> 3.0", ">= 3.0"
32
+ s.add_development_dependency "fakefs"
28
33
  s.add_development_dependency "flexmock", '~> 2.0', ">= 2.0.0"
29
34
  s.add_development_dependency "minitest", "~> 5.0", ">= 5.0"
30
- s.add_development_dependency "fakefs"
31
35
  s.add_development_dependency "simplecov"
32
36
  end
33
-
@@ -2,12 +2,14 @@
2
2
 
3
3
  begin
4
4
  require 'daemons'
5
- rescue LoadError
5
+ rescue LoadError # rubocop:disable Lint/HandleExceptions
6
6
  end
7
7
 
8
8
  require 'autobuild'
9
9
 
10
+ # rubocop:disable Style/MixinUsage
10
11
  include Autobuild
12
+ # rubocop:enable Style/MixinUsage
11
13
 
12
14
  DEFAULT_HTTP_PORT = 2000
13
15
 
@@ -20,7 +22,7 @@ Autobuild.packages = packages
20
22
  conffile = File.expand_path(conffile, Dir.pwd)
21
23
  if Autobuild.daemonize
22
24
  puts "Going into daemon mode ..."
23
- Daemons.daemonize
25
+ Daemons.daemonize
24
26
  end
25
27
 
26
28
  Reporting << StdoutReporter.new
@@ -40,4 +42,3 @@ rescue ThreadError
40
42
  rescue Interrupt
41
43
  STDERR.puts "interrupted"
42
44
  end
43
-
@@ -1,13 +1,13 @@
1
1
  require 'rake'
2
2
 
3
- if defined? Rake::DSL
4
- include Rake::DSL
5
- end
3
+ # rubocop:disable Style/MixinUsage
4
+ include Rake::DSL if defined?(Rake::DSL)
5
+ # rubocop:enable Style/MixinUsage
6
6
 
7
7
  require 'utilrb/logger'
8
8
 
9
9
  module Autobuild
10
- LIB_DIR = File.expand_path(File.dirname(__FILE__))
10
+ LIB_DIR = __dir__
11
11
  extend Logger::Root('Autobuild', Logger::INFO)
12
12
  end
13
13
 
@@ -15,7 +15,6 @@ module Autobuild
15
15
  require 'socket'
16
16
  require 'etc'
17
17
  require 'find'
18
- require 'thread'
19
18
  require 'pathname'
20
19
  require 'shellwords'
21
20
  require 'find'
@@ -28,9 +28,11 @@ def diff(other)
28
28
  result = []
29
29
  by_package.each do |pkg_name, phases|
30
30
  other_phases = other.by_package[pkg_name]
31
- next if !other_phases
31
+ next unless other_phases
32
+
32
33
  phases.each do |phase, duration|
33
- next if !other_phases.has_key?(phase)
34
+ next unless other_phases.key?(phase)
35
+
34
36
  other_duration = other_phases[phase]
35
37
  result << Entry.new(pkg_name, phase, nil, other_duration - duration)
36
38
  end
@@ -44,7 +46,8 @@ def self.parse(file)
44
46
  next if line.empty?
45
47
 
46
48
  cols = line.split(/\s+/)
47
- date, time = cols.shift, cols.shift
49
+ date = cols.shift
50
+ time = cols.shift
48
51
  start_time = Time.parse("#{date} #{time}")
49
52
  duration = Float(cols.pop)
50
53
  phase = cols.pop
@@ -55,4 +58,3 @@ def self.parse(file)
55
58
  end
56
59
  end
57
60
  end
58
-
@@ -1,5 +1,5 @@
1
1
  # Evaluates +script+ in autobuild context
2
- def Autobuild(&script)
2
+ def Autobuild(&script) # rubocop:disable Naming/MethodName
3
3
  Autobuild.send(:module_eval, &script)
4
4
  end
5
5
 
@@ -18,7 +18,8 @@ def Autobuild(&script)
18
18
  # do_rebuild:: if we should cleanly rebuild every packages
19
19
  # do_doc:: if we should produce the documentation
20
20
  # doc_errors:: if errors during the documentation generation are treated as errors
21
- # daemonize:: if the build should go into daemon mode (only if the daemons gem is available)
21
+ # daemonize:: if the build should go into daemon mode (only if the daemons gem
22
+ # is available)
22
23
  # clean_log:: remove all logs before starting the build
23
24
  # packages:: a list of packages to build specifically
24
25
  # default_packages:: the list of packages to build if Autobuild.packages is empty.
@@ -27,10 +28,10 @@ def Autobuild(&script)
27
28
  # Otherwise, the existing logfile contents is erased.
28
29
  module Autobuild
29
30
  class << self
30
- %w{ nice srcdir prefix
31
+ %w[ nice srcdir prefix
31
32
  verbose debug do_update do_build do_rebuild do_forced_build
32
33
  daemonize clean_log packages default_packages
33
- keep_oldlogs}.each do |name|
34
+ keep_oldlogs ].each do |name|
34
35
  attr_accessor name
35
36
  end
36
37
 
@@ -45,12 +46,14 @@ class << self
45
46
  # @yieldparam [Hash] utility options
46
47
  # @return [void]
47
48
  def each_utility
48
- return enum_for(__method__) if !block_given?
49
+ return enum_for(__method__) unless block_given?
50
+
49
51
  utilities.each { |name, (utl, options)| yield(name, utl, options) }
50
52
  end
51
53
 
52
54
  def register_utility_class(name, klass, disabled_by_default: false, **options)
53
- utilities[name] = [klass, Hash[disabled_by_default: disabled_by_default], options]
55
+ creation_options = { disabled_by_default: disabled_by_default }
56
+ utilities[name] = [klass, creation_options, options]
54
57
  singleton_class.class_eval do
55
58
  attr_accessor "only_#{name}"
56
59
  attr_accessor "do_#{name}"
@@ -70,7 +73,9 @@ def create_utility(utility_name, package)
70
73
  package.utilities[utility_name] = utility
71
74
  utility.enabled = !creation_options[:disabled_by_default]
72
75
  utility
73
- else raise ArgumentError, "there is no utility called #{utility_name}, available utilities are #{utilities.keys.sort.join(", ")}"
76
+ else
77
+ raise ArgumentError, "there is no utility called #{utility_name}, "\
78
+ "available utilities are #{utilities.keys.sort.join(', ')}"
74
79
  end
75
80
  end
76
81
  # The directory in which logs are saved. Defaults to PREFIX/log.
@@ -85,10 +90,13 @@ def full_build?
85
90
  register_utility_class 'doc', Utility, disabled_by_default: false
86
91
  register_utility_class 'test', TestUtility, disabled_by_default: true
87
92
 
88
- DEFAULT_OPTIONS = { :nice => nil,
89
- :srcdir => Dir.pwd, :prefix => Dir.pwd, :logdir => nil,
90
- :verbose => false, :debug => false, :do_build => true, :do_forced_build => false, :do_rebuild => false, :do_update => true,
91
- :daemonize => false, :packages => [], :default_packages => [], :keep_oldlogs => false }
93
+ DEFAULT_OPTIONS = {
94
+ :nice => nil, :srcdir => Dir.pwd, :prefix => Dir.pwd,
95
+ :logdir => nil, :verbose => false, :debug => false, :do_build => true,
96
+ :do_forced_build => false, :do_rebuild => false, :do_update => true,
97
+ :daemonize => false, :packages => [], :default_packages => [],
98
+ :keep_oldlogs => false
99
+ }.freeze
92
100
 
93
101
  DEFAULT_OPTIONS.each do |name, value|
94
102
  send("#{name}=", value)
@@ -128,14 +136,15 @@ def self.apply_post_install(pkg, info)
128
136
  @mail = Hash.new
129
137
  class << self
130
138
  # Mailing configuration. It is a hash with the following keys (as symbols)
131
- # [:to] the mail destination. Defaults to USER@HOSTNAME, where USER is the username
132
- # of autobuild's caller, and HOSTNAME the hostname of the current machine.
139
+ # [:to] the mail destination. Defaults to USER@HOSTNAME, where USER is
140
+ # the username of autobuild's caller, and HOSTNAME the hostname of the
141
+ # current machine.
133
142
  # [:from] the mail origin. Defaults to the same value than +:to+
134
143
  # [:smtp] the hostname of the SMTP server, defaults to localhost
135
144
  # [:port] the port of the SMTP server, defauts to 22
136
145
  # [:only_errors] mail only on errors. Defaults to false.
137
146
  attr_reader :mail
138
-
147
+
139
148
  # call-seq:
140
149
  # post_success_message => string
141
150
  # post_success_message "msg" => "msg"
@@ -159,7 +168,9 @@ def post_success_message(*args, &block)
159
168
  end
160
169
 
161
170
  # The directory in which logs are saved
162
- def logdir; @logdir || "#{prefix}/log" end
171
+ def logdir
172
+ @logdir || "#{prefix}/log"
173
+ end
163
174
 
164
175
  # Removes all log files
165
176
  def clean_log!
@@ -173,33 +184,67 @@ def clean_log!
173
184
  def commandline(args)
174
185
  parser = OptionParser.new do |opts|
175
186
  opts.separator "Path specification"
176
- opts.on("--srcdir PATH", "sources are installed in PATH") do |v| Autobuild.srcdir=v end
177
- opts.on("--prefix PATH", "built packages are installed in PATH") do |v| Autobuild.prefix = v end
178
- opts.on("--logdir PATH", "logs are saved in PATH (default: <prefix>/autobuild)") do |v| Autobuild.logdir = v end
187
+ opts.on("--srcdir PATH", "sources are installed in PATH") do |v|
188
+ Autobuild.srcdir = v
189
+ end
190
+ opts.on("--prefix PATH", "built packages are installed in PATH") do |v|
191
+ Autobuild.prefix = v
192
+ end
193
+ opts.on("--logdir PATH", "logs are saved in PATH "\
194
+ "(default: <prefix>/autobuild)") do |v|
195
+ Autobuild.logdir = v
196
+ end
179
197
 
180
198
  opts.separator ""
181
199
  opts.separator "General behaviour"
182
- opts.on('--nice NICE', Integer, 'nice the subprocesses to the given value') do |v| Autobuild.nice = v end
200
+ opts.on('--nice NICE', Integer,
201
+ 'nice the subprocesses to the given value') do |v|
202
+ Autobuild.nice = v
203
+ end
183
204
  opts.on("-h", "--help", "Show this message") do
184
205
  puts opts
185
206
  exit
186
207
  end
187
208
  if defined? Daemons
188
- opts.on("--[no-]daemon", "go into daemon mode") do |v| Autobuild.daemonize = v end
209
+ opts.on("--[no-]daemon", "go into daemon mode") do |v|
210
+ Autobuild.daemonize = v
211
+ end
212
+ end
213
+ opts.on("--no-update", "update already checked-out sources") do |v|
214
+ Autobuild.do_update = v
215
+ end
216
+ opts.on("--no-build", "only prepare packages, do not build them") do |v|
217
+ Autobuild.do_build = v
218
+ end
219
+ opts.on("--forced-build", "force the trigger of "\
220
+ "all the build commands") do |v|
221
+ Autobuild.do_forced_build = v
222
+ end
223
+ opts.on("--rebuild", "clean and rebuild") do |v|
224
+ Autobuild.do_forced_build = v
225
+ end
226
+ opts.on("--only-doc", "only generate documentation") do |v|
227
+ Autobuild.only_doc = v
228
+ end
229
+ opts.on("--no-doc", "don't generate documentation") do |v|
230
+ Autobuild.do_doc = v
231
+ end
232
+ opts.on("--doc-errors", "treat documentation failure as error") do |v|
233
+ Autobuild.pass_doc_errors = v
189
234
  end
190
- opts.on("--no-update", "update already checked-out sources") do |v| Autobuild.do_update = v end
191
- opts.on("--no-build", "only prepare packages, do not build them") do |v| Autobuild.do_build = v end
192
- opts.on("--forced-build", "force the trigger of all the build commands") do |v| Autobuild.do_forced_build = v end
193
- opts.on("--rebuild", "clean and rebuild") do |v| Autobuild.do_forced_build = v end
194
- opts.on("--only-doc", "only generate documentation") do |v| Autobuild.only_doc = v end
195
- opts.on("--no-doc", "don't generate documentation") do |v| Autobuild.do_doc = v end
196
- opts.on("--doc-errors", "treat documentation failure as error") do |v| Autobuild.pass_doc_errors = v end
197
235
 
198
236
  opts.separator ""
199
237
  opts.separator "Program output"
200
- opts.on("--[no-]verbose", "display output of commands on stdout") do |v| Autobuild.verbose = v end
201
- opts.on("--[no-]debug", "debug information (for debugging purposes)") do |v| Autobuild.debug = v end
202
- opts.on("--keep-oldlogs", "old logs will be kept, new program output being appended") do |v| Autobuild.keep_oldlogs = v end
238
+ opts.on("--[no-]verbose", "display output of commands on stdout") do |v|
239
+ Autobuild.verbose = v
240
+ end
241
+ opts.on("--[no-]debug", "debug information") do |v|
242
+ Autobuild.debug = v
243
+ end
244
+ opts.on("--keep-oldlogs", "old logs will be kept, "\
245
+ "new program output being appended") do |v|
246
+ Autobuild.keep_oldlogs = v
247
+ end
203
248
  opts.on('--version', "displays autobuild version and then exits") do
204
249
  puts "autobuild v#{Autobuild::VERSION}"
205
250
  exit 0
@@ -207,29 +252,35 @@ def commandline(args)
207
252
 
208
253
  opts.separator ""
209
254
  opts.separator "Mail reports"
210
- opts.on("--mail-from EMAIL", String, "From: field of the sent mails") do |from_email|
255
+ opts.on("--mail-from EMAIL", String,
256
+ "From: field of the sent mails") do |from_email|
211
257
  mail[:from] = from_email
212
258
  end
213
- opts.on("--mail-to EMAILS", String, "comma-separated list of emails to which the reports should be sent") do |emails|
259
+ opts.on("--mail-to EMAILS", String, "comma-separated list of emails "\
260
+ "to which the reports should be sent") do |emails|
214
261
  mail[:to] ||= []
215
262
  mail[:to] += emails.split(',')
216
263
  end
217
- opts.on("--mail-subject SUBJECT", String, "Subject: field of the sent mails") do |subject_email|
264
+ opts.on("--mail-subject SUBJECT", String,
265
+ "Subject: field of the sent mails") do |subject_email|
218
266
  mail[:subject] = subject_email
219
267
  end
220
- opts.on("--mail-smtp HOSTNAME", String, " address of the mail server written as hostname[:port]") do |smtp|
221
- raise "invalid SMTP specification #{smtp}" unless smtp =~ /^([^:]+)(?::(\d+))?$/
268
+ opts.on("--mail-smtp HOSTNAME", String, "address of the mail server "\
269
+ "written as hostname[:port]") do |smtp|
270
+ unless smtp =~ /^([^:]+)(?::(\d+))?$/
271
+ raise "invalid SMTP specification #{smtp}"
272
+ end
273
+
222
274
  mail[:smtp] = $1
223
275
  mail[:port] = Integer($2) if $2 && !$2.empty?
224
276
  end
225
277
  opts.on("--mail-only-errors", "send mail only on errors") do
226
278
  mail[:only_errors] = true
227
279
  end
228
-
229
280
  end
230
281
 
231
282
  parser.parse!(args)
232
- if !args[0]
283
+ unless args[0]
233
284
  puts parser
234
285
  exit
235
286
  end
@@ -244,7 +295,7 @@ def commandline(args)
244
295
  #
245
296
  # @return [Array<String>]
246
297
  def self.all_phases
247
- %w{import prepare build} +
298
+ %w[import prepare build] +
248
299
  utilities.keys
249
300
  end
250
301
 
@@ -278,7 +329,7 @@ def self.apply(packages, buildname = "autobuild", phases = [], options = Hash.ne
278
329
  phases = ['doc']
279
330
  else
280
331
  phases = ['import']
281
- phases += ['prepare', 'build'] if Autobuild.do_build
332
+ phases += %w[prepare build] if Autobuild.do_build
282
333
  phases << 'doc' if Autobuild.do_doc
283
334
  end
284
335
  end
@@ -308,4 +359,3 @@ def self.apply(packages, buildname = "autobuild", phases = [], options = Hash.ne
308
359
  end
309
360
  end
310
361
  end
311
-