fbsimctl_rb 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fbsimctl_rb/command.rb +26 -5
- data/lib/fbsimctl_rb/version.rb +1 -1
- 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: 00554c21450f2fb83b864e5259f5d04a4bbf000c
|
4
|
+
data.tar.gz: e06ccb70a5ba708dfeb39fddea652f32d4083c50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5c59315855b50659483ba004a1f3a3f7ca7ba1e292a3a5b10cd68aad53aa688a500ff64e4d4e314e5418779d939286bba35c76bda3444801390c6046515a74f
|
7
|
+
data.tar.gz: 98950c3c241657f9eb857411a023abe443a7c24770a78ccd28e9b0eddcf0c8ab1a6401f88858872ae42e76141c1d589db97a06cd2cbe8a198a5cec3fb57381d7
|
data/lib/fbsimctl_rb/command.rb
CHANGED
@@ -1,22 +1,43 @@
|
|
1
|
-
module
|
1
|
+
module FbsimctlRb
|
2
2
|
class Cmd
|
3
3
|
attr_reader :fbsim
|
4
4
|
|
5
5
|
def initialize
|
6
|
+
validate_env
|
7
|
+
|
6
8
|
@fbsim = 'fbsimctl'
|
7
9
|
end
|
8
10
|
|
9
11
|
private
|
10
12
|
|
11
13
|
def run(*command)
|
12
|
-
|
13
|
-
status
|
14
|
+
cmd = command.join(' ')
|
15
|
+
sto, ste, status = Open3.capture3(cmd)
|
16
|
+
if status.success?
|
17
|
+
sto
|
18
|
+
else
|
19
|
+
puts ste
|
20
|
+
raise(sto)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def validate_env
|
25
|
+
return unless `which fbsimctl`.empty?
|
26
|
+
raise "You should install fbsimctl. Read https://github.com/facebook/FBSimulatorControl/tree/master/fbsimctl"
|
14
27
|
end
|
15
28
|
|
16
29
|
protected
|
17
30
|
|
18
|
-
def method_missing(method, *args, &
|
19
|
-
|
31
|
+
def method_missing(method, *args, &_block)
|
32
|
+
if respond_to_missing?
|
33
|
+
run(%W(#{@fbsim} #{method}) + args)
|
34
|
+
else
|
35
|
+
super
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def respond_to_missing?
|
40
|
+
true
|
20
41
|
end
|
21
42
|
end
|
22
43
|
end
|
data/lib/fbsimctl_rb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbsimctl_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|