ro_thor 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ro_thor.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dafa19021d16dbfe29bec34846f6bae9b936fd52
|
4
|
+
data.tar.gz: 5bcbe31bb1d3ea1679d55129d306ca643182d388
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee6c7e7127748ac8e8d668cfe02652722ae7b479aaae1f42afe7cc01415c94e90acad78614f772c18f91ad21dd818cbe268dc3af46cc11b41123eb5ea1d83258
|
7
|
+
data.tar.gz: 9728da772c41bf010ee5ff329f89e6de510a714dd9c5bb1a209d54322b0aa8a967bc111665ae49fcb5ea93e7d2c14398c0874f51f4cbc0b54f96fd4debaf6b8b
|
data/lib/ro_thor.rb
CHANGED
@@ -32,6 +32,10 @@ class RoThor < Thor
|
|
32
32
|
ENV['USER'] == 'root'
|
33
33
|
end
|
34
34
|
|
35
|
+
def vg?(*args, &blk)
|
36
|
+
ENV['USER'] == 'vagrant'
|
37
|
+
end
|
38
|
+
|
35
39
|
def read(f, *args, &blk)
|
36
40
|
if rt?
|
37
41
|
bash "sudo cp -f #{f} #{buffer}"
|
@@ -60,12 +64,12 @@ class RoThor < Thor
|
|
60
64
|
end
|
61
65
|
|
62
66
|
def write(f, *args, &blk)
|
63
|
-
if rt?
|
64
|
-
File.
|
67
|
+
if rt? or vg?
|
68
|
+
File.binwrite(buffer, *args, &blk)
|
65
69
|
pr = Pathname.new(f).parent
|
66
70
|
bash("sudo mkdir -p #{pr}; sudo cp -f #{buffer} #{f}")
|
67
71
|
else
|
68
|
-
File.
|
72
|
+
File.binwrite(f, *args, &blk)
|
69
73
|
end
|
70
74
|
end
|
71
75
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ro_thor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|