android-sdk-installer 0.0.7 → 1.0.0

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-sdk-installer.rb +13 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9cda68cb222bbab1fec842df4c573eccfa361934
4
- data.tar.gz: 85478a9635602e49dc2c62e40a32b8862cfc02a6
3
+ metadata.gz: 1eba68eb1cab830def8a6eae35945af1d5714b97
4
+ data.tar.gz: e2359275e7f4718b102f801772fc6ebfe2b1d07a
5
5
  SHA512:
6
- metadata.gz: b75ee4e1d09fa1a4c0a4ce598361c9ea0ff9ff5c47c6b788527cf0d6d09a77a7bbf5cd246eb6ccc9ceaaf37941ad9034cbeca76e300c68177840c9240abed35f
7
- data.tar.gz: 551bac066b8e8af57012b5f26bc9fe078ab320433a5423ffeb2a7f8ba80a8b5a7b76384f6a3c796e709a21df7b0d03a537e82489cfa0dbf2ced15530ce52abdc
6
+ metadata.gz: d8945a448fcaed362c01ea70c692ced0c8566757fe56a70ef072abd1743fdea054f8143238ab1b25d7133bccf5ec098a2c375dcbe68bbafc8985e005c995940f
7
+ data.tar.gz: b0075cdf29a289874461335f396ddf05f9f15389b91791d8e12508d0e8011dc532ad710a4086bb450154eac54f57ab75103d0d64620d3dc6209f7b7b0b603a26
@@ -14,12 +14,16 @@ module AndroidInstaller
14
14
  CONFIG_FILE = 'android-sdk-installer.yml'
15
15
  REPOSITORIES_CONFIG_FILE = '~/.android/repositories.cfg'
16
16
  ANDROID_DIR = '~/.android'
17
+ DEFAULT_PLATFORM = 'linux'
18
+ DEFAULT_VERSION = '3859397'
17
19
 
18
20
  def initialize(arguments)
19
21
  @logger = Logger.new(STDOUT)
20
22
  @logger.level = Logger::WARN
21
23
 
22
24
  @ignore_existing = false
25
+ @platform = DEFAULT_PLATFORM
26
+ @version = DEFAULT_VERSION
23
27
  create_options_parser(arguments)
24
28
  end
25
29
 
@@ -31,6 +35,12 @@ module AndroidInstaller
31
35
  opts.on('-i', '--ignore', 'Ignore existing Android SDK, denoted by the existence of the ANDROID_HOME env variable') do
32
36
  @ignore_existing = true
33
37
  end
38
+ opts.on('-p PLATFORM', '--platform PLATFORM', 'Set the platform. Must be one of linux or darwin') do |platform|
39
+ @platform = platform
40
+ end
41
+ opts.on('-v VERSION', 'Set the version of the sdk to install') do |version|
42
+ @version = version
43
+ end
34
44
  opts.on('-h', '--help', 'Displays help') do
35
45
  puts opts.help
36
46
  exit
@@ -72,18 +82,16 @@ module AndroidInstaller
72
82
  else
73
83
  config = Psych.load("foo: true\nbar: false")
74
84
  end
75
- version = '3859397'
76
85
  if config.has_key?('version')
77
- version = config['version']
86
+ @version = config['version']
78
87
  end
79
88
  if config['debug']
80
89
  @logger.level = Logger::DEBUG
81
90
  @logger.debug('We are in debug mode')
82
91
  end
83
92
 
84
- platform = 'linux'
85
93
  if config.has_key?('platform')
86
- platform = config['platform']
94
+ @platform = config['platform']
87
95
  end
88
96
 
89
97
  if config.has_key?('ignore_existing')
@@ -93,7 +101,7 @@ module AndroidInstaller
93
101
 
94
102
  should_install = ENV['ANDROID_HOME'].nil? || @ignore_existing
95
103
  if should_install
96
- install_command_line_sdk(platform, version)
104
+ install_command_line_sdk(@platform, @version)
97
105
  else
98
106
  @logger.debug('ANDROID_HOME already set. Skipping command line tools install')
99
107
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: android-sdk-installer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Commit 451
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-06-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: