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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ro_thor.rb +7 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6409305a5eb246a6af170de8b82064cd686a73d8
4
- data.tar.gz: eff93c389e0d8938ad1bace5cfa523701e91d2ba
3
+ metadata.gz: dafa19021d16dbfe29bec34846f6bae9b936fd52
4
+ data.tar.gz: 5bcbe31bb1d3ea1679d55129d306ca643182d388
5
5
  SHA512:
6
- metadata.gz: b4017f1772fb91a8ba2d972a1a881a06ec5014707c1d544cb68856c2ed412f3eb6020e9087a42da4ad9233344753631c8f2bc033d72b3116c8c884b2a2dd7b7c
7
- data.tar.gz: e8b060eadfc4303e8ae481cbcfba2fc0c4d18475e8fe510fa6e52784ed41274ad6af8a83c0d450f004341b82b416ff13e186bdb7c9a5a233576eacf1378d0358
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.write(buffer, *args, &blk)
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.write(f, *args, &blk)
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.6
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-02-26 00:00:00.000000000 Z
11
+ date: 2015-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor