autoproj 1.12.5 → 1.12.6

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: de1b737b5a26bac3eafe2394e7a9d57032321935
4
- data.tar.gz: c09ff63617a7bc670e9608c4d06a245cdd112ba6
3
+ metadata.gz: 30982dc07e20775dc8e9e2a2dd5a3210445f02d1
4
+ data.tar.gz: f3d8d1886e6c8ecd8140ba60c92e154de2c022a5
5
5
  SHA512:
6
- metadata.gz: e4e68ed38d8a6b2588053fdb5bf38955600ebfeb825e3ab67d8834b37e1c21fb8723a503267c6c9400eb5f4a5a0f85838dfe6dd4f0656b4ccd3a84acad669b1e
7
- data.tar.gz: 49c225e45df8256da2d3e90d1da139d4766be1e1d2454637a19b5e67991dff729968b83cd594fc99cd70f55cea93003937000986d22c61c9465baed342d64cf4
6
+ metadata.gz: 23a44919a79b9428768958e6a5d60940f12f22f81b0227957a3effe09784a7b39c4a08ed5a02b48c2430c6cea7b91d7f6f7afb6ddd2ffbf49d02b4847e344f1a
7
+ data.tar.gz: ca149e32d50932a01db5a2ead6afc35aa367ed602eb20de2514fbb8ef9ba6f2e406b1a4d31aaf4ff86976f04a31966211e87036eac76e32013f787cdb6afce24
@@ -2423,7 +2423,7 @@ module Autobuild
2423
2423
 
2424
2424
  def find_in_path(file)
2425
2425
  path = ENV['PATH'].split(File::PATH_SEPARATOR).
2426
- find { |dir| File.exists?(File.join(dir, file)) }
2426
+ find { |dir| File.exist?(File.join(dir, file)) }
2427
2427
  if path
2428
2428
  return File.join(path, file)
2429
2429
  end
@@ -25,35 +25,51 @@ module Autoproj
25
25
  :http_url => "https://git.#{base_url}",
26
26
  :ssh_url => "git@#{base_url}:",
27
27
  :fallback_to_http => true,
28
- :default => 'git,ssh'
29
-
30
- gitorious_long_doc = [
31
- "How should I interact with #{base_url} (git, http or ssh)",
32
- "If you give two values, comma-separated, the first one will be",
33
- "used for pulling and the second one for pushing"]
28
+ :default => 'http,ssh',
29
+ :disabled_methods => []
30
+
31
+ disabled_methods = Array(options[:disabled_methods])
34
32
 
35
33
  access_methods = Hash[
36
34
  'git' => 'git,ssh',
37
35
  'ssh' => 'ssh,ssh',
38
36
  'http' => 'http,http']
39
37
 
40
- configuration_option name, 'string',
41
- :default => options[:default],
42
- :doc => gitorious_long_doc do |value|
43
- if value =~ /,/
44
- value.split(',').each do |method|
45
- if !access_methods.has_key?(method)
46
- raise Autoproj::InputError, "#{method} is not a known access method"
47
- end
38
+ gitorious_long_doc = [
39
+ "How should I interact with #{base_url} (#{(access_methods.keys - disabled_methods).sort.join(", ")})",
40
+ "If you give two values, comma-separated, the first one will be",
41
+ "used for pulling and the second one for pushing"]
42
+
43
+ validator = lambda do |value|
44
+ if value =~ /,/
45
+ value.split(',').each do |method|
46
+ if !access_methods.has_key?(method)
47
+ raise Autoproj::InputError, "#{method} is not a known access method"
48
+ elsif disabled_methods.include?(method)
49
+ raise Autoproj::InputError, "#{method} is disabled on #{base_url}"
48
50
  end
49
- elsif !access_methods.has_key?(value)
50
- raise Autoproj::InputError, "#{value} is not a known access method"
51
51
  end
52
-
53
- value
52
+ elsif !access_methods.has_key?(value)
53
+ raise Autoproj::InputError, "#{value} is not a known access method"
54
+ elsif disabled_methods.include?(value)
55
+ raise Autoproj::InputError, "#{method} is disabled on #{base_url}"
54
56
  end
55
57
 
56
- access_mode = Autoproj.user_config(name)
58
+ value
59
+ end
60
+
61
+ configuration_option name, 'string',
62
+ :default => options[:default],
63
+ :doc => gitorious_long_doc, &validator
64
+
65
+ access_mode = Autoproj.config.get(name)
66
+ begin
67
+ validator[access_mode]
68
+ rescue Autoproj::InputError => e
69
+ Autoproj.warn e.message
70
+ Autoproj.config.reset(name)
71
+ access_mode = Autoproj.config.get(name)
72
+ end
57
73
  access_mode = access_methods[access_mode] || access_mode
58
74
  pull, push = access_mode.split(',')
59
75
  [[pull, "_ROOT"], [push, "_PUSH_ROOT"]].each do |method, var_suffix|
@@ -78,6 +94,6 @@ module Autoproj
78
94
  end
79
95
  end
80
96
 
81
- Autoproj.gitorious_server_configuration('GITORIOUS', 'gitorious.org')
97
+ Autoproj.gitorious_server_configuration('GITORIOUS', 'gitorious.org', :default => 'http,ssh', :disabled_methods => 'git')
82
98
  Autoproj.gitorious_server_configuration('GITHUB', 'github.com', :http_url => 'https://github.com', :default => 'http,ssh')
83
99
 
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.12.5"
2
+ VERSION = "1.12.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.5
4
+ version: 1.12.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rock Core Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-03 00:00:00.000000000 Z
11
+ date: 2015-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: autobuild
@@ -190,7 +190,6 @@ files:
190
190
  - test/data/test_manifest/autoproj/local_set/local.autobuild
191
191
  - test/data/test_manifest/autoproj/local_set/source.yml
192
192
  - test/data/test_manifest/autoproj/manifest
193
- - test/ops/test_configuration.rb
194
193
  - test/package_managers/apt-dpkg-status
195
194
  - test/package_managers/apt-dpkg-status.installed-last
196
195
  - test/package_managers/apt-dpkg-status.noninstalled-last
@@ -226,11 +225,4 @@ rubygems_version: 2.2.2
226
225
  signing_key:
227
226
  specification_version: 4
228
227
  summary: Easy installation and management of sets of software packages
229
- test_files:
230
- - test/package_managers/test_apt_dpkg_manager.rb
231
- - test/package_managers/test_gem.rb
232
- - test/package_managers/test_pip.rb
233
- - test/test_manifest.rb
234
- - test/test_package_manifest.rb
235
- - test/test_os_dependencies.rb
236
- - test/ops/test_configuration.rb
228
+ test_files: []
@@ -1,20 +0,0 @@
1
- require 'autoproj/test'
2
- require 'autoproj/ops/configuration'
3
-
4
- describe Autoproj::Ops::Configuration do
5
- describe "#sort_package_sets_by_import_order" do
6
- attr_reader :ops
7
-
8
- before do
9
- @ops = Autoproj::Ops::Configuration.new(nil, nil)
10
- end
11
-
12
- it "should handle standalone package sets that are both explicit and dependencies of other package sets gracefully (issue#30)" do
13
- pkg_set0 = flexmock('set0', imports: [], explicit?: true)
14
- pkg_set1 = flexmock('set1', imports: [pkg_set0], explicit?: true)
15
- root_pkg_set = flexmock('root', imports: [pkg_set0, pkg_set1], explicit?: true)
16
- assert_equal [pkg_set0, pkg_set1, root_pkg_set],
17
- ops.sort_package_sets_by_import_order([pkg_set1, pkg_set0], root_pkg_set)
18
- end
19
- end
20
- end