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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3c0f1c00d281ec7c20f73324169fb42c63b547d
4
- data.tar.gz: 81ec25a977ed01b7e7207f565831b540cceb1b7d
3
+ metadata.gz: 00554c21450f2fb83b864e5259f5d04a4bbf000c
4
+ data.tar.gz: e06ccb70a5ba708dfeb39fddea652f32d4083c50
5
5
  SHA512:
6
- metadata.gz: 5c30711f26308898095efa3f014a0497e0d6decee92c76d51499f90959c485a680f12e73d9c9614cc1a275401deedaa1fdd9a16b3d8841871e6d0f513e6acb82
7
- data.tar.gz: 75867773d3f3d87a46597f09fb5135570e4905af9cedd95be59cdc418c45f72a535c6cf3d19cfee917cf9caeaced6b409d47852cb07c49b7ed76f1a31896d91b
6
+ metadata.gz: d5c59315855b50659483ba004a1f3a3f7ca7ba1e292a3a5b10cd68aad53aa688a500ff64e4d4e314e5418779d939286bba35c76bda3444801390c6046515a74f
7
+ data.tar.gz: 98950c3c241657f9eb857411a023abe443a7c24770a78ccd28e9b0eddcf0c8ab1a6401f88858872ae42e76141c1d589db97a06cd2cbe8a198a5cec3fb57381d7
@@ -1,22 +1,43 @@
1
- module fbsimctl_rb
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
- sto, _ste, status = Open3.capture3(command.join(' '))
13
- status.success? sto : raise(stdo)
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, &block)
19
- run(%W(#{@fbsim_cmd} #{method}}) + *args)
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
@@ -1,3 +1,3 @@
1
1
  module FbsimctlRb
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-30 00:00:00.000000000 Z
11
+ date: 2017-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler