itamae 1.9.12 → 1.9.13

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: 8d9449b41e179eee46bdba56f3c099d58c652d48116f7927f7cc12fcf6d0f015
4
- data.tar.gz: 63f4dd7419342509efa326830783d421d97c1295074c231b7f8de854fab47f87
3
+ metadata.gz: d31a078719d6c81a81538a9018dd038502f5b70b05918927bc3a97e6afdf8ebb
4
+ data.tar.gz: 23e7489bd095e53a783be646ba54c9d88dad035eb00248528126fb35f03a50ac
5
5
  SHA512:
6
- metadata.gz: e1925e7d871bc4622c9c10ce086d735e203093a3b533a348cff643912aa9798cc26561a46cc4e6b9245b1c5ccfa93199b9e8df4c9e3a0a4b2f258c9297c79ef5
7
- data.tar.gz: 18649f349ddb64abfb85215a00ea56b9aeca3ee809916853aa3f10a461e2dbfe0acc2bd5ca9b1bed077c64aa634b3e6277d8cc54015d51e31bd49a1afdb3abc2
6
+ metadata.gz: a00853cae59ed87678e3351a3888d352c372c03d8cd6ebbe1491df525648440efb69ed8c67611dce68a41681ea8782d263feec21b87c229df5d646bfb16997c8
7
+ data.tar.gz: c5315707855dce49e9470a6c9723ecb537fd1b117cc29ea755bf023c320fe5aedb2d1d1882e173509cf68ed1e502c9728451471bb810ea4bbdf520ccb2f2e63b
@@ -1,6 +1,13 @@
1
1
  ## Unreleased
2
2
  [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.9.12...master)
3
3
 
4
+ ## v1.9.13
5
+ [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.9.11...v1.9.12)
6
+
7
+ Bugfixes
8
+
9
+ - [Fixed. Can not create empty file](https://github.com/itamae-kitchen/itamae/pull/269)
10
+
4
11
  ## v1.9.12
5
12
  [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.9.11...v1.9.12)
6
13
 
data/Rakefile CHANGED
@@ -22,12 +22,14 @@ namespace :spec do
22
22
  task target => ["docker:#{target}", "provision:#{target}", "serverspec:#{target}"]
23
23
 
24
24
  namespace :docker do
25
+ desc "Run docker for #{target}"
25
26
  task target do
26
27
  sh "docker run --privileged -d --name itamae #{target} /sbin/init"
27
28
  end
28
29
  end
29
30
 
30
31
  namespace :provision do
32
+ desc "Run itamae to #{target}"
31
33
  task target do
32
34
  suites = [
33
35
  [
@@ -118,6 +118,13 @@ module Itamae
118
118
  return
119
119
  end
120
120
 
121
+ # When the path currently doesn't exist yet, :change_file_xxx should be performed against `@temppath`.
122
+ # Checking that by `diff -q /dev/null xxx` doesn't work when xxx's content is "", because /dev/null's content is also "".
123
+ if !current.exist && attributes.exist
124
+ attributes.modified = true
125
+ return
126
+ end
127
+
121
128
  case run_command(["diff", "-q", compare_to, @temppath], error: false).exit_status
122
129
  when 1
123
130
  # diff found
@@ -1,3 +1,3 @@
1
1
  module Itamae
2
- VERSION = "1.9.12"
2
+ VERSION = "1.9.13"
3
3
  end
@@ -303,3 +303,21 @@ end
303
303
  describe file('/tmp/subscribed_from_parent') do
304
304
  it { should be_file }
305
305
  end
306
+
307
+ describe file('/tmp/empty_file1') do
308
+ it { should exist }
309
+ it { should be_file }
310
+ its(:content) { should eq "" }
311
+ end
312
+
313
+ describe file('/tmp/empty_file2') do
314
+ it { should exist }
315
+ it { should be_file }
316
+ its(:content) { should eq "" }
317
+ end
318
+
319
+ describe file('/tmp/empty_file3') do
320
+ it { should exist }
321
+ it { should be_file }
322
+ its(:content) { should eq "" }
323
+ end
@@ -271,14 +271,14 @@ end
271
271
 
272
272
  ######
273
273
 
274
- execute "mkdir /tmp/link-force-no-dereference1"
274
+ execute "mkdir -p /tmp/link-force-no-dereference1"
275
275
  link "link-force-no-dereference" do
276
276
  cwd "/tmp"
277
277
  to "link-force-no-dereference1"
278
278
  force true
279
279
  end
280
280
 
281
- execute "mkdir /tmp/link-force-no-dereference2"
281
+ execute "mkdir -p /tmp/link-force-no-dereference2"
282
282
  link "link-force-no-dereference" do
283
283
  cwd "/tmp"
284
284
  to "link-force-no-dereference2"
@@ -556,6 +556,20 @@ end
556
556
 
557
557
  ###
558
558
 
559
+ file "/tmp/empty_file1" do
560
+ content ""
561
+ end
562
+
563
+ remote_file "/tmp/empty_file2" do
564
+ source "files/empty_file"
565
+ end
566
+
567
+ template "/tmp/empty_file3" do
568
+ source "templates/empty_file.erb"
569
+ end
570
+
571
+ ###
572
+
559
573
  v1 = node.memory.total
560
574
  v2 = node[:memory][:total]
561
575
  v3 = node['memory']['total']
@@ -20,8 +20,8 @@ module Itamae
20
20
  expect(handler).to receive(:event).with(:name_started, :arg)
21
21
  expect(handler).to receive(:event).with(:name_failed, :arg)
22
22
  expect {
23
- subject.event(:name, :arg) { raise }
24
- }.to raise_error
23
+ subject.event(:name, :arg) { raise "name is failed" }
24
+ }.to raise_error "name is failed"
25
25
  end
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.12
4
+ version: 1.9.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-10-16 00:00:00.000000000 Z
13
+ date: 2018-10-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -275,12 +275,14 @@ files:
275
275
  - spec/integration/recipes/define/default.rb
276
276
  - spec/integration/recipes/define/files/remote_file_in_definition
277
277
  - spec/integration/recipes/dry_run.rb
278
+ - spec/integration/recipes/files/empty_file
278
279
  - spec/integration/recipes/files/remote_file_auto
279
280
  - spec/integration/recipes/hello.erb
280
281
  - spec/integration/recipes/hello.txt
281
282
  - spec/integration/recipes/included.rb
282
283
  - spec/integration/recipes/node.json
283
284
  - spec/integration/recipes/redefine.rb
285
+ - spec/integration/recipes/templates/empty_file.erb
284
286
  - spec/integration/recipes/templates/template_auto.erb
285
287
  - spec/integration/spec_helper.rb
286
288
  - spec/unit/lib/itamae/backend_spec.rb
@@ -329,12 +331,14 @@ test_files:
329
331
  - spec/integration/recipes/define/default.rb
330
332
  - spec/integration/recipes/define/files/remote_file_in_definition
331
333
  - spec/integration/recipes/dry_run.rb
334
+ - spec/integration/recipes/files/empty_file
332
335
  - spec/integration/recipes/files/remote_file_auto
333
336
  - spec/integration/recipes/hello.erb
334
337
  - spec/integration/recipes/hello.txt
335
338
  - spec/integration/recipes/included.rb
336
339
  - spec/integration/recipes/node.json
337
340
  - spec/integration/recipes/redefine.rb
341
+ - spec/integration/recipes/templates/empty_file.erb
338
342
  - spec/integration/recipes/templates/template_auto.erb
339
343
  - spec/integration/spec_helper.rb
340
344
  - spec/unit/lib/itamae/backend_spec.rb