chake 0.90 → 0.90.1

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: 73bba733109589908cc9fe35b4f009f105cdac398b8e2eeb4a6ca3638f328276
4
- data.tar.gz: 715c2eb00007ced85da48fd4c5c4d4ec6c508627494a87aaeb0e25e1dea3968e
3
+ metadata.gz: aea493f81d004a6dbcc2ccb1657dd6705d538512e0d7522d9db7e4a7483846fb
4
+ data.tar.gz: e8a6f9c7e034e95f536361b58ce5083d9f3f3d3037d90e82f7d79ff4c8b389e5
5
5
  SHA512:
6
- metadata.gz: d04fcefd02e1fe73eba0941f2d1dda595f28e1c40067daf74defac1020039812c58740769bebbdcc92f6414c9d49da3b0753f4e088bb4cefaed295432910f1d2
7
- data.tar.gz: 717537aa7effd7371cc23ba4e1fcaa80fb1a0a47fe97d5123abe69488b4b193b61afb34be806a8314234e2257b60081a4c2229a8c93880977609f1fdea69bea5
6
+ metadata.gz: e93294e8a34232bd6e709440f3384223e2171a93a280708568e019dbbcaeeeac75de1d0d933e1ccbfd720a34e835a211bf6f51cd707fe241f0a04e2e44f8700f
7
+ data.tar.gz: 04e65daf9f089b5b9a63e2d097c6a178b0362cf433698310cf9858085967ef026ab2c5775f8eb4eb9339298e1c6281062c05b9a59413b59075fdfb378eec286d
data/.manifest CHANGED
@@ -56,6 +56,7 @@ lib/chake/readline.rb
56
56
  lib/chake/tmpdir.rb
57
57
  lib/chake/version.rb
58
58
  lib/chake/wipe.rb
59
+ lib/chake/yaml.rb
59
60
  man/.gitignore
60
61
  man/Rakefile
61
62
  man/readme2man.sed
@@ -68,4 +69,5 @@ spec/chake/config_manager/itamae_spec.rb
68
69
  spec/chake/config_manager/shell_spec.rb
69
70
  spec/chake/config_manager_spec.rb
70
71
  spec/chake/node_spec.rb
72
+ spec/integration_tests_spec.rb
71
73
  spec/spec_helper.rb
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.90.1
2
+
3
+ * Fix loading node data under ruby < 3.1
4
+
1
5
  # 0.90
2
6
 
3
7
  * itamae: use --sudo when root for local backend
data/lib/chake/config.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'chake/node'
2
+ require 'chake/yaml'
2
3
 
3
4
  module Chake
4
5
  class << self
@@ -8,12 +9,12 @@ end
8
9
 
9
10
  nodes_file = ENV['CHAKE_NODES'] || 'nodes.yaml'
10
11
  nodes_directory = ENV['CHAKE_NODES_D'] || 'nodes.d'
11
- nodes = File.exist?(nodes_file) && YAML.load_file(nodes_file, aliases: true) || {}
12
+ nodes = File.exist?(nodes_file) && Chake::YAML.load_file(nodes_file) || {}
12
13
  nodes.values.each do |node|
13
14
  node['chake_metadata'] = { 'definition_file' => nodes_file }
14
15
  end
15
16
  Dir.glob(File.join(nodes_directory, '*.yaml')).sort.each do |f|
16
- file_nodes = YAML.load_file(f, aliases: true)
17
+ file_nodes = Chake::YAML.load_file(f)
17
18
  file_nodes.values.each do |node|
18
19
  node['chake_metadata'] = { 'definition_file' => f }
19
20
  end
data/lib/chake/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chake
2
- VERSION = '0.90'.freeze
2
+ VERSION = '0.90.1'.freeze
3
3
  end
data/lib/chake/yaml.rb ADDED
@@ -0,0 +1,13 @@
1
+ require 'yaml'
2
+
3
+ module Chake
4
+ module YAML
5
+ def self.load_file(filename)
6
+ if RUBY_VERSION >= '3.1'
7
+ ::YAML.load_file(filename, aliases: true)
8
+ else
9
+ ::YAML.load_file(filename)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,48 @@
1
+ require 'fileutils'
2
+ require 'pathname'
3
+ require 'tmpdir'
4
+
5
+ describe 'Chake' do
6
+ include FileUtils
7
+
8
+ def sh(*args)
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(':')
12
+ env = {
13
+ 'RUBYLIB' => lib,
14
+ 'PATH' => path
15
+ }
16
+ unless system(env, *args, out: ['.out', 'w'], err: ['.err', 'w'])
17
+ out = File.read('.out')
18
+ err = File.read('.err')
19
+ raise "Command [#{cmd}] failed with exit status #{$CHILD_STATUS} (PATH = #{path}, RUBYLIB = #{lib}).\nstdout:\n#{out}\nstderr:\n#{err}"
20
+ end
21
+ rm_f '.log'
22
+ end
23
+
24
+ def chake(*args)
25
+ cmd = [Gem.ruby, '-S', 'chake'] + args
26
+ sh(*cmd)
27
+ end
28
+
29
+ def rake(*args)
30
+ cmd = [Gem.ruby, '-S', 'rake'] + args
31
+ sh(*cmd)
32
+ end
33
+
34
+ def project
35
+ Dir.mktmpdir do |dir|
36
+ Dir.chdir(dir) do
37
+ yield dir
38
+ end
39
+ end
40
+ end
41
+
42
+ it 'loads node information' do
43
+ project do
44
+ chake 'init'
45
+ rake 'nodes'
46
+ end
47
+ end
48
+ end
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'
4
+ version: 0.90.1
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-09 00:00:00.000000000 Z
11
+ date: 2022-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -164,6 +164,7 @@ files:
164
164
  - lib/chake/tmpdir.rb
165
165
  - lib/chake/version.rb
166
166
  - lib/chake/wipe.rb
167
+ - lib/chake/yaml.rb
167
168
  - man/.gitignore
168
169
  - man/Rakefile
169
170
  - man/readme2man.sed
@@ -176,6 +177,7 @@ files:
176
177
  - spec/chake/config_manager/shell_spec.rb
177
178
  - spec/chake/config_manager_spec.rb
178
179
  - spec/chake/node_spec.rb
180
+ - spec/integration_tests_spec.rb
179
181
  - spec/spec_helper.rb
180
182
  homepage: https://gitlab.com/terceiro/chake
181
183
  licenses:
@@ -210,4 +212,5 @@ test_files:
210
212
  - spec/chake/config_manager/shell_spec.rb
211
213
  - spec/chake/config_manager_spec.rb
212
214
  - spec/chake/node_spec.rb
215
+ - spec/integration_tests_spec.rb
213
216
  - spec/spec_helper.rb