ro_thor 0.5.8 → 0.7.3
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/lib/ro_thor/sh.rb +11 -4
- 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: badb9e4c63810fa7f088e670062b32985f26e553
|
4
|
+
data.tar.gz: b41774fd34f8e974a7b8bcbf26978873d86e3c1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 695cb0099bf5ed5c4d3f95e91ff9400e6fb4f6d09c13a53a2aa3b5afef9f32074fa3e63b0518f15560bf4f9a1f1cca033a11485af1888fc3be27cbff70794cf6
|
7
|
+
data.tar.gz: 5875e679e27f078b8a1a3186f3bff52c81407dbdf4ff37e2cd5054e40d636061feb6a4f6925e05a00a23d4c1cbe36393e8aa91772ee987d2a5cc2e53a8c636a4
|
data/lib/ro_thor/sh.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require 'thor'
|
2
|
+
require_relative 'array'
|
2
3
|
class RoThor < Thor
|
3
4
|
module Sh
|
4
|
-
class
|
5
|
+
class Err < StandardError
|
5
6
|
end
|
6
7
|
|
7
8
|
def sh_shutup(*args, &blk)
|
@@ -9,8 +10,8 @@ class RoThor < Thor
|
|
9
10
|
end
|
10
11
|
|
11
12
|
def sh(*args, &blk)
|
12
|
-
opts = args.
|
13
|
-
cmd = args.join("")
|
13
|
+
args, opts = args.ro_opts
|
14
|
+
cmd = args.join(" ")
|
14
15
|
puts "run '#{cmd}'"
|
15
16
|
out, err, status = Open3.capture3(cmd)
|
16
17
|
|
@@ -19,12 +20,18 @@ class RoThor < Thor
|
|
19
20
|
end
|
20
21
|
|
21
22
|
unless status.success?
|
22
|
-
raise
|
23
|
+
raise Err, err
|
23
24
|
end
|
24
25
|
|
25
26
|
out
|
26
27
|
end
|
27
28
|
|
29
|
+
def sys(*args, &blk)
|
30
|
+
cmd = args.join(' ')
|
31
|
+
puts cmd
|
32
|
+
system cmd
|
33
|
+
end
|
34
|
+
|
28
35
|
def exist_p?(pid)
|
29
36
|
begin
|
30
37
|
_pid = pid.to_i
|
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.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|