chake 0.90.1 → 0.90.2

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
  SHA256:
3
- metadata.gz: aea493f81d004a6dbcc2ccb1657dd6705d538512e0d7522d9db7e4a7483846fb
4
- data.tar.gz: e8a6f9c7e034e95f536361b58ce5083d9f3f3d3037d90e82f7d79ff4c8b389e5
3
+ metadata.gz: c094249a63d6302e4b53969fcb103595aca7da88a1a1c3c6355d0facc9a55061
4
+ data.tar.gz: 8ebdd02f879e7f5dfdf083e985a81745e62df3102c5c3c972c89a96e2058873c
5
5
  SHA512:
6
- metadata.gz: e93294e8a34232bd6e709440f3384223e2171a93a280708568e019dbbcaeeeac75de1d0d933e1ccbfd720a34e835a211bf6f51cd707fe241f0a04e2e44f8700f
7
- data.tar.gz: 04e65daf9f089b5b9a63e2d097c6a178b0362cf433698310cf9858085967ef026ab2c5775f8eb4eb9339298e1c6281062c05b9a59413b59075fdfb378eec286d
6
+ metadata.gz: 19730aecf31f2f6f2d2564d247e17f7e26cce70673a37430793628e31a20a038e1f1f25bf9a290c5540798143390ae8100a8dcb186eac1355aef02f460735b82
7
+ data.tar.gz: f595aa58c562160b6944927f9c2ede9a58ee32a9cedcd436895140fe011316d2bcb7755d2449b0a49f78eff2ce4e9f3a0752b6611b9cacd0ffe760fdc4e58c77
data/.rubocop.yml CHANGED
@@ -53,3 +53,6 @@ Style/SymbolArray:
53
53
 
54
54
  Gemspec/RequiredRubyVersion:
55
55
  Enabled: false
56
+
57
+ Gemspec/DeprecatedAttributeAssignment:
58
+ Enabled: false
data/ChangeLog.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.90.2
2
+
3
+ - upload: make sure to reupload on config manager changes
4
+ - Apply suggestions by rubocop 1.39.0
5
+ - Chake::Connection: avoid setting constant inside of block
6
+ - rubocop: keep assignment to `test_files` in the gemspec
7
+ - gemspec: set `spec.metadata['rubygems_mfa_required']`
8
+
1
9
  # 0.90.1
2
10
 
3
11
  * Fix loading node data under ruby < 3.1
data/Rakefile CHANGED
@@ -74,12 +74,10 @@ end
74
74
 
75
75
  desc 'checks if the latest release is properly documented in ChangeLog.md'
76
76
  task :check_changelog do
77
- begin
78
- sh 'grep', "^#\\s*#{pkg.version}", 'ChangeLog.md'
79
- rescue StandardError
80
- puts "Version #{pkg.version} not documented in ChangeLog.md!"
81
- raise
82
- end
77
+ sh 'grep', "^#\\s*#{pkg.version}", 'ChangeLog.md'
78
+ rescue StandardError
79
+ puts "Version #{pkg.version} not documented in ChangeLog.md!"
80
+ raise
83
81
  end
84
82
 
85
83
  desc 'Updates manifest file'
@@ -87,7 +85,7 @@ task :manifest do
87
85
  manifest = File.read('.manifest')
88
86
  git = `git ls-files`
89
87
  if manifest != git
90
- File.open('.manifest', 'w') { |f| f.write(git) }
88
+ File.write('.manifest', git)
91
89
  sh 'git commit .manifest -m "Update manifest"'
92
90
  end
93
91
  end
data/chake.gemspec CHANGED
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'simplecov'
25
25
 
26
26
  spec.add_dependency 'rake'
27
+ spec.metadata['rubygems_mfa_required'] = 'true'
27
28
  end
data/lib/chake/config.rb CHANGED
@@ -9,7 +9,7 @@ end
9
9
 
10
10
  nodes_file = ENV['CHAKE_NODES'] || 'nodes.yaml'
11
11
  nodes_directory = ENV['CHAKE_NODES_D'] || 'nodes.d'
12
- nodes = File.exist?(nodes_file) && Chake::YAML.load_file(nodes_file) || {}
12
+ nodes = (File.exist?(nodes_file) && Chake::YAML.load_file(nodes_file)) || {}
13
13
  nodes.values.each do |node|
14
14
  node['chake_metadata'] = { 'definition_file' => nodes_file }
15
15
  end
@@ -28,7 +28,7 @@ module Chake
28
28
  end
29
29
 
30
30
  def logging
31
- node.silent && '-l fatal' || ''
31
+ (node.silent && '-l fatal') || ''
32
32
  end
33
33
  end
34
34
  end
@@ -44,7 +44,7 @@ module Chake
44
44
  end
45
45
 
46
46
  def ssh_config
47
- File.exist?(ssh_config_file) && ['-F', ssh_config_file] || []
47
+ (File.exist?(ssh_config_file) && ['-F', ssh_config_file]) || []
48
48
  end
49
49
 
50
50
  def ssh_config_file
@@ -60,11 +60,11 @@ module Chake
60
60
  end
61
61
 
62
62
  def ssh_options
63
- node.port && ['-p', node.port.to_s] || []
63
+ (node.port && ['-p', node.port.to_s]) || []
64
64
  end
65
65
 
66
66
  def scp_options
67
- node.port && ['-P', node.port.to_s] || []
67
+ (node.port && ['-P', node.port.to_s]) || []
68
68
  end
69
69
  end
70
70
  end
@@ -1,5 +1,6 @@
1
1
  module Chake
2
- Connection = Struct.new(:node) do
2
+ Connection = Struct.new(:node)
3
+ class Connection
3
4
  class CommandFailed < RuntimeError
4
5
  end
5
6
 
data/lib/chake/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chake
2
- VERSION = '0.90.1'.freeze
2
+ VERSION = '0.90.2'.freeze
3
3
  end
data/lib/chake.rb CHANGED
@@ -59,6 +59,7 @@ def if_files_changed(node, group_name, files)
59
59
  return if files.empty?
60
60
 
61
61
  hash_io = IO.popen(%w[xargs sha1sum], 'w+')
62
+ hash_io.puts(File.join(Chake.tmpdir, "#{node}.bootstrap"))
62
63
  files.sort.each { |f| hash_io.puts(f) }
63
64
  hash_io.close_write
64
65
  current_hash = hash_io.read
@@ -69,9 +70,7 @@ def if_files_changed(node, group_name, files)
69
70
 
70
71
  yield if current_hash != hash_on_disk
71
72
  FileUtils.mkdir_p(File.dirname(hash_file))
72
- File.open(hash_file, 'w') do |f|
73
- f.write(current_hash)
74
- end
73
+ File.write(hash_file, current_hash)
75
74
  end
76
75
 
77
76
  def write_json_file(file, data)
@@ -111,9 +110,7 @@ Chake.nodes.each do |node|
111
110
  if !File.exist?(bootstrap_script) || File.read(bootstrap_script) != bootstrap_code
112
111
 
113
112
  # create bootstrap script
114
- File.open(bootstrap_script, 'w') do |f|
115
- f.write(bootstrap_code)
116
- end
113
+ File.write(bootstrap_script, bootstrap_code)
117
114
  chmod 0o755, bootstrap_script
118
115
 
119
116
  # copy bootstrap script over
@@ -131,7 +128,7 @@ Chake.nodes.each do |node|
131
128
  end
132
129
 
133
130
  desc "upload data to #{hostname}"
134
- task "upload:#{hostname}" => :upload_common do
131
+ task "upload:#{hostname}" => ["bootstrap:#{hostname}", :upload_common] do
135
132
  next unless node.needs_upload?
136
133
 
137
134
  encrypted = encrypted_for(hostname)
@@ -142,7 +139,7 @@ Chake.nodes.each do |node|
142
139
  rsync_excludes << '--exclude' << 'local-mode-cache/'
143
140
 
144
141
  rsync = node.rsync + ['-avp'] + ENV.fetch('CHAKE_RSYNC_OPTIONS', '').split
145
- rsync_logging = Rake.application.options.silent && '--quiet' || '--verbose'
142
+ rsync_logging = (Rake.application.options.silent && '--quiet') || '--verbose'
146
143
 
147
144
  hash_files = Dir.glob(File.join(Chake.tmpdir, '*.sha1sum'))
148
145
  files = Dir.glob('**/*').reject { |f| File.directory?(f) } - encrypted.keys - encrypted.values - hash_files
data/man/Rakefile CHANGED
@@ -21,9 +21,9 @@ MANPAGES.each do |man|
21
21
  end
22
22
 
23
23
  task install: MANPAGES do
24
- prefix = ENV['PREFIX'] || File.exist?('debian/rules') && '/usr' || '/usr/local'
25
- man1 = File.join(*[ENV['DESTDIR'], prefix, 'share/man/man1'].compact)
26
- man7 = File.join(*[ENV['DESTDIR'], prefix, 'share/man/man7'].compact)
24
+ prefix = ENV['PREFIX'] || (File.exist?('debian/rules') && '/usr') || '/usr/local'
25
+ man1 = File.join(*[ENV.fetch('DESTDIR', nil), prefix, 'share/man/man1'].compact)
26
+ man7 = File.join(*[ENV.fetch('DESTDIR', nil), prefix, 'share/man/man7'].compact)
27
27
  target = { '.1' => man1, '.7' => man7 }
28
28
  sh 'install', '-d', '-m', '0755', man1
29
29
  sh 'install', '-d', '-m', '0755', man7
@@ -7,8 +7,8 @@ describe 'Chake' do
7
7
 
8
8
  def sh(*args)
9
9
  cmd = Shellwords.join(args)
10
- lib = [Pathname.new(__FILE__).parent.parent / 'lib', ENV['RUBYLIB']].compact.join(':')
11
- path = [Pathname.new(__FILE__).parent.parent / 'bin', ENV['PATH']].join(':')
10
+ lib = [Pathname.new(__FILE__).parent.parent / 'lib', ENV.fetch('RUBYLIB', nil)].compact.join(':')
11
+ path = [Pathname.new(__FILE__).parent.parent / 'bin', ENV.fetch('PATH', nil)].join(':')
12
12
  env = {
13
13
  'RUBYLIB' => lib,
14
14
  'PATH' => path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.90.1
4
+ version: 0.90.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Terceiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-18 00:00:00.000000000 Z
11
+ date: 2023-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -182,7 +182,8 @@ files:
182
182
  homepage: https://gitlab.com/terceiro/chake
183
183
  licenses:
184
184
  - MIT
185
- metadata: {}
185
+ metadata:
186
+ rubygems_mfa_required: 'true'
186
187
  post_install_message:
187
188
  rdoc_options: []
188
189
  require_paths: