android-cli 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/android-cli.rb +19 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13e68783a000aa2d2ddeec7fc0531df9bab610fa
4
- data.tar.gz: b55838d6c441005d1354de6e667c034b6305f17a
3
+ metadata.gz: 505ceced13698d11bc1a5706f7034adb1f7a94a9
4
+ data.tar.gz: 495491d72a2ed9312d35582029bf0afb84cd5646
5
5
  SHA512:
6
- metadata.gz: 70b8525b9067ec7208433fe232aec007ca214d23d698261ee76e080b98237daf8afa80624f819e0206a65fb0936c062b391a9ed874bd68090cd94bc662863a38
7
- data.tar.gz: e71d312ce0a41f8b0a6ed9ae62dc0d2c27950c70cda05218b2701b035984923e2dfdb28b1ece3af9acda74719cfbcc9e3cb5d7d300e25705f220873d5b233cbc
6
+ metadata.gz: ef05b729df53f635085e48a2578a6a87a1528806bc1b1a0825e6c0716cebdcda3168c524ee6326e683c89f4f79706205447544bada7110499f52c94495ca67c6
7
+ data.tar.gz: 87ed03f2da0ce1b06386ba27aad153eec47154389cdb5d86beeed2d2db0549eb2e87c4ce3172a06687055fb850f97478ccc28ef742e573668f2b7491a2457792
@@ -4,17 +4,33 @@
4
4
 
5
5
  class AndroidCLI
6
6
 
7
+ @@sdkPath = nil
8
+
9
+ def self.setSDKPath(path)
10
+ @@sdkPath = path
11
+ end
12
+
13
+ def self.getSDKPath
14
+ return File.dirname(`which android`.strip) if @@sdkPath.nil?
15
+ @@sdkPath
16
+ end
17
+
7
18
  # Determines if android is installed
8
19
  # @return BOOLEAN
9
20
  def self.installed?
10
- return system("which android")
21
+ return system("which #{getSDKPath}/android")
22
+ end
23
+
24
+ def self.getCMD
25
+ raise "Android not installed" unless installed?
26
+ return "#{getSDKPath}/android"
11
27
  end
12
28
 
13
29
  # Runs`android list targets`
14
30
  #
15
31
  # @return STDOUT `android list targets`
16
32
  def self.listTargets
17
- `android list targets`
33
+ `#{getCMD} list targets`
18
34
  end
19
35
 
20
36
  # Determines the Android SDK ID
@@ -38,7 +54,7 @@ class AndroidCLI
38
54
  # @param [Integer] target target ID from android list targets
39
55
  # @return [Boolean] did it update the project successfully
40
56
  def self.updateProject(targetId)
41
- system("android update project -p . --subprojects --target #{targetId}")
57
+ system("#{getCMD} update project -p . --subprojects --target #{targetId}")
42
58
  end
43
59
 
44
60
  # Updates a project based in a human readable target
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: android-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thys Ballard