autobuild 1.10.0.b3 → 1.10.0.b4

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: 28218a1fe204bc6efd9ae8a5ca2635067dd1aa8f
4
- data.tar.gz: dc5ea70ceb40b5798c5cbcfdbc53000dc1b0507d
3
+ metadata.gz: 337600547fed308e00ef0dbcfbedcdd02664d3d3
4
+ data.tar.gz: 5d051d09d63bcf0e82463b099d4a9e690893a516
5
5
  SHA512:
6
- metadata.gz: a43bb95fbd578877a7559ea37323bdfaedc0a3197bf47a3b283667eb99b3c83d8079bdd4a2627c03ade5802a475e140c93bdf5aadcc075d8f42cb0fec3689c1d
7
- data.tar.gz: b18e69dfe1aa5373a538d277ba30f455c94555b6de1c8a2335216545f0b37d8761920d1bd454bc9148f8ffed335aaf23e7e4225215ca2073fbbf2a24d770587c
6
+ metadata.gz: b996cbdfa5a35e5b23da4ded4e8da3258ebb9f06fadfd1ec0472b0958777d76771eebb7708c2959ca8d532b10485192d8f54de1071a205332a8d25fc964075d6
7
+ data.tar.gz: 54336977873b4150cea50d3356295b491ae154769c22cdf8660c2def2b9ca50a70709fa6291cf0898bbca475d450d47ad2843b6816476a2807868744150904d9
data/Rakefile CHANGED
@@ -16,7 +16,8 @@ Utilrb::Rake.hoe do
16
16
  self.extra_deps <<
17
17
  ['rake', '>= 0.9.0'] <<
18
18
  ['utilrb', '>= 1.6.0'] <<
19
- ['highline', '>= 0']
19
+ ['pastel', '>= 0.4.0'] <<
20
+ ['tty', '>= 0.2.0']
20
21
 
21
22
  self.test_globs = ['test/suite.rb']
22
23
  end
@@ -18,6 +18,12 @@ require 'shellwords'
18
18
  require 'find'
19
19
  require 'rake/tasklib'
20
20
  require 'fileutils'
21
+ require 'optparse'
22
+ require 'rake'
23
+ require 'singleton'
24
+ require 'pastel'
25
+ require 'tty'
26
+ require 'autobuild/tools'
21
27
 
22
28
  require 'autobuild/version'
23
29
  require 'autobuild/environment'
@@ -1,9 +1,3 @@
1
- require 'optparse'
2
- require 'rake'
3
- require 'singleton'
4
- require 'highline'
5
- require 'autobuild/tools'
6
-
7
1
  # Evaluates +script+ in autobuild context
8
2
  def Autobuild(&script)
9
3
  Autobuild.send(:module_eval, &script)
@@ -82,9 +76,6 @@ module Autobuild
82
76
  # The directory in which logs are saved. Defaults to PREFIX/log.
83
77
  attr_writer :logdir
84
78
 
85
- # A HighLine object that allows to colorize the output
86
- attr_reader :console
87
-
88
79
  # True if we build and if the build is applied on all packages
89
80
  def full_build?
90
81
  do_build && !only_doc && packages.empty?
@@ -94,22 +85,19 @@ module Autobuild
94
85
  register_utility_class 'doc', Utility, disabled_by_default: false
95
86
  register_utility_class 'test', Utility, disabled_by_default: true
96
87
 
97
- @console = HighLine.new
98
-
88
+ @colorizer = Pastel.new
99
89
  class << self
100
- attr_writer :color
90
+ def color=(flag)
91
+ @colorizer = Pastel.new(enabled: flag)
92
+ end
93
+
101
94
  def color?
102
- !!@color
95
+ @colorizer.enabled?
103
96
  end
104
97
  end
105
- @color = true
106
98
 
107
- def self.color(*args)
108
- if color?
109
- console.color(*args)
110
- else
111
- args.first
112
- end
99
+ def self.color(message, *style)
100
+ @colorizer.decorate(message, *style)
113
101
  end
114
102
 
115
103
  DEFAULT_OPTIONS = { :nice => nil,
@@ -372,17 +372,14 @@ module Autobuild
372
372
  package.progress_done
373
373
  package.message "The archive #{@url.to_s} is different from the one currently checked out at #{package.srcdir}", :bold
374
374
  package.message "I will have to delete the current folder to go on with the update"
375
- response = HighLine.new.ask " Continue (yes or no) ? If no, this update will be ignored, which can lead to build problems.", String do |q|
376
- q.overwrite = true
377
- q.in = ['yes', 'no']
378
- q.default = 'yes'
379
- q.case = :downcase
380
- end
375
+ response = TTY::Shell.new.ask " Continue (yes or no) ? If no, this update will be ignored, which can lead to build problems." do
376
+ modify :downcase
377
+ end.read_string
381
378
  else
382
379
  raise Autobuild::InteractionRequired, "importing #{package.name} would have required user interaction and allow_interactive is false"
383
380
  end
384
381
 
385
- if response == "no"
382
+ if response == 'no' || response == 'n'
386
383
  package.message "not updating #{package.srcdir}"
387
384
  package.progress_done
388
385
  return
@@ -352,9 +352,21 @@ module Autobuild
352
352
  end
353
353
  end
354
354
 
355
+ # Enumerates the remotes that this importer would set up on the
356
+ # repository
357
+ #
358
+ # @yieldparam [String] remote_name the remote name
359
+ # @yieldparam [String] url the remote URL
360
+ # @yieldparam [String] push_to the remote push-to URL
361
+ def each_configured_remote
362
+ ([['autobuild', repository, push_to]] + additional_remotes).each do |args|
363
+ yield(args[0], args[1], args[2] || args[1])
364
+ end
365
+ end
366
+
355
367
  # Updates the git repository's configuration for the target remote
356
368
  def update_remotes_configuration(package)
357
- ([['autobuild', repository, push_to]] + additional_remotes).each do |args|
369
+ each_configured_remote do |*args|
358
370
  setup_remote(package, *args)
359
371
  end
360
372
 
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.10.0.b3" unless defined? Autobuild::VERSION
2
+ VERSION = "1.10.0.b4" 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.10.0.b3
4
+ version: 1.10.0.b4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-27 00:00:00.000000000 Z
11
+ date: 2015-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -39,19 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.6.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: highline
42
+ name: pastel
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.4.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 0.4.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: tty
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 0.2.0
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rdoc
57
71
  requirement: !ruby/object:Gem::Requirement