itamae 1.10.5 → 1.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/lib/itamae/backend.rb +6 -1
- data/lib/itamae/version.rb +1 -1
- data/spec/unit/lib/itamae/backend_spec.rb +10 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 970a26489acd9ea22bf195f85ab44de09e0dcc9a332903b8b5a604eec57369dc
|
4
|
+
data.tar.gz: d31dd215ffcc046c7f1f6d3010b304b02797d049ef482c6e16c19d801812fae3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 879ee326cf3867a88b80d6ea2f4f54e37d62c97834628169e76488439e95a4795e44b80883abe550128452967b633f5bfe772e432aaf7cccaae331a8abc1dd26
|
7
|
+
data.tar.gz: e127f11a419f00b80ac3e019d48121972f66f65535d8e16ef92d7f1c627ef75c409c977d812cff7a8a1462febc5941ab77a606a5e2b8ba5f2b5c5a6ccdb1b993
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.
|
2
|
+
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.6...master)
|
3
|
+
|
4
|
+
## v1.10.6
|
5
|
+
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.5...v1.10.6)
|
6
|
+
|
7
|
+
Improvements
|
8
|
+
|
9
|
+
- [Don't use `sudo` when `--no-sudo` is passed](https://github.com/itamae-kitchen/itamae/pull/302)
|
3
10
|
|
4
11
|
## v1.10.5
|
5
12
|
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.4...v1.10.5)
|
data/lib/itamae/backend.rb
CHANGED
@@ -188,7 +188,7 @@ module Itamae
|
|
188
188
|
end
|
189
189
|
|
190
190
|
user = options[:user]
|
191
|
-
if user
|
191
|
+
if user && use_sudo?
|
192
192
|
command = "cd ~#{user.shellescape} ; #{command}"
|
193
193
|
command = "sudo -H -u #{user.shellescape} -- #{shell.shellescape} -c #{command.shellescape}"
|
194
194
|
end
|
@@ -196,6 +196,11 @@ module Itamae
|
|
196
196
|
command
|
197
197
|
end
|
198
198
|
|
199
|
+
def use_sudo?
|
200
|
+
return true unless @options.key?(:sudo)
|
201
|
+
!!@options[:sudo]
|
202
|
+
end
|
203
|
+
|
199
204
|
def shell
|
200
205
|
@options[:shell] || '/bin/sh'
|
201
206
|
end
|
data/lib/itamae/version.rb
CHANGED
@@ -17,38 +17,38 @@ module Itamae
|
|
17
17
|
|
18
18
|
describe ".send_file" do
|
19
19
|
context "the source file doesn't exist" do
|
20
|
-
subject {
|
21
|
-
it { expect
|
20
|
+
subject { itamae_backend.send_file("src", "dst") }
|
21
|
+
it { expect{ subject }.to raise_error(Itamae::Backend::SourceNotExistError, "The file 'src' doesn't exist.") }
|
22
22
|
end
|
23
23
|
|
24
24
|
context "the source file exist, but it is not a regular file" do
|
25
25
|
before { Dir.mkdir("src") }
|
26
|
-
subject {
|
27
|
-
it { expect
|
26
|
+
subject { itamae_backend.send_file("src", "dst") }
|
27
|
+
it { expect{ subject }.to raise_error(Itamae::Backend::SourceNotExistError, "'src' is not a file.") }
|
28
28
|
end
|
29
29
|
|
30
30
|
context "the source file is a regular file" do
|
31
31
|
before { FileUtils.touch("src") }
|
32
|
-
subject {
|
32
|
+
subject { itamae_backend.send_file("src", "dst") }
|
33
33
|
it { expect { subject }.not_to raise_error }
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
describe ".send_directory" do
|
38
38
|
context "the source directory doesn't exist" do
|
39
|
-
subject {
|
40
|
-
it { expect
|
39
|
+
subject { itamae_backend.send_directory("src", "dst") }
|
40
|
+
it { expect{ subject }.to raise_error(Itamae::Backend::SourceNotExistError, "The directory 'src' doesn't exist.") }
|
41
41
|
end
|
42
42
|
|
43
43
|
context "the source directory exist, but it is not a directory" do
|
44
44
|
before { FileUtils.touch("src") }
|
45
|
-
subject {
|
46
|
-
it { expect
|
45
|
+
subject { itamae_backend.send_directory("src", "dst") }
|
46
|
+
it { expect{ subject }.to raise_error(Itamae::Backend::SourceNotExistError, "'src' is not a directory.") }
|
47
47
|
end
|
48
48
|
|
49
49
|
context "the source directory is a directory" do
|
50
50
|
before { Dir.mkdir("src") }
|
51
|
-
subject {
|
51
|
+
subject { itamae_backend.send_directory("src", "dst") }
|
52
52
|
it { expect { subject }.not_to raise_error }
|
53
53
|
end
|
54
54
|
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.10.
|
4
|
+
version: 1.10.6
|
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: 2019-
|
13
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
329
|
- !ruby/object:Gem::Version
|
330
330
|
version: '0'
|
331
331
|
requirements: []
|
332
|
-
rubygems_version: 3.0.
|
332
|
+
rubygems_version: 3.0.3
|
333
333
|
signing_key:
|
334
334
|
specification_version: 4
|
335
335
|
summary: Simple Configuration Management Tool
|