platinum-deployer 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/bin/setup +4 -0
- data/exe/platinum +46 -28
- data/lib/platinum/deployer/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: a0c75b8907062cc74597cf4adaefc0e8e07f6908
|
4
|
+
data.tar.gz: 853bb29b8a9de3df4e6865345181ca90e3a765f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66b87846a3ba89382e7a114d6fce637c26c2bf07faf55c36445819df4312809193318b07ce5048a51d40c946dbe3b4537732039e157feb3be6cd0d1943ce736a
|
7
|
+
data.tar.gz: f9cecd3b2f668ea50be90d2205aef3aea4acf2053755cff8402178854ec0b324a7448e97f9152a34fbc805714878807148e602930db6d50f12d5f5f54fa1a24f
|
data/bin/setup
CHANGED
data/exe/platinum
CHANGED
@@ -18,13 +18,14 @@ help_banner = <<-HELP
|
|
18
18
|
Compiles CoffeeScript/HAML in ./app_src to JS/XML in ./app.
|
19
19
|
Developed by MacKinley Smith
|
20
20
|
|
21
|
-
Usage:
|
21
|
+
Usage: platinum [command]
|
22
22
|
|
23
|
-
Commands:
|
23
|
+
Avaliable Commands:
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
platinum compile Compiles app_src files only.
|
26
|
+
platinum build Compiles app_src files and builds Titanium project.
|
27
|
+
platinum deploy Compiles and builds Titanium project, then deploys.
|
28
|
+
platinum list Lists available simulators and devices.
|
28
29
|
|
29
30
|
HELP
|
30
31
|
if ARGV.empty? or ARGV.include? '-h' or ARGV.include? '--help'
|
@@ -106,7 +107,9 @@ rescue => e; warn e.message; false end
|
|
106
107
|
def run_titanium_cmd(cmd)
|
107
108
|
exit_status = nil
|
108
109
|
Open3.popen2e(cmd) do |i, oe, thread|
|
109
|
-
oe.each
|
110
|
+
oe.each do |line|
|
111
|
+
puts line
|
112
|
+
end
|
110
113
|
exit_status = thread.value
|
111
114
|
end
|
112
115
|
exit_status.success?
|
@@ -126,6 +129,19 @@ def bundle_path
|
|
126
129
|
File.expand_path path
|
127
130
|
end
|
128
131
|
|
132
|
+
def force_git_commit!
|
133
|
+
git = Git.open '.'
|
134
|
+
status = git.status
|
135
|
+
change_count = status.changed.count + status.added.count +
|
136
|
+
status.deleted.count + status.untracked.count
|
137
|
+
if change_count > 0
|
138
|
+
puts
|
139
|
+
unless system 'git add .; git commit'
|
140
|
+
fatal('You must commit your work before deploying to TestFairy.') end
|
141
|
+
puts
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
129
145
|
def deep_symbolize(obj)
|
130
146
|
return obj.inject({}){|memo, (k,v)|
|
131
147
|
memo[k.to_sym] = deep_symbolize(v); memo } if obj.is_a? Hash
|
@@ -321,13 +337,9 @@ def deploy!
|
|
321
337
|
end
|
322
338
|
def deploy_to_emulator!
|
323
339
|
sim_opts = @options[:ios_simulator]
|
324
|
-
|
325
|
-
File.join(__dir__, 'platinum-ios-simulate.js'))
|
326
|
-
base_cmd = "node #{path_to_sim_script}"
|
340
|
+
base_cmd = base_cmd_for_simjs
|
327
341
|
if sim_opts[:udid].nil?
|
328
|
-
|
329
|
-
begin sim_list = JSON.parse json_sim_list
|
330
|
-
rescue => e; fatal e.message; end
|
342
|
+
sim_list = get_simjs_sims
|
331
343
|
# ap sim_list; puts
|
332
344
|
sim_choices = {}
|
333
345
|
sim_list.each {|ios_version, simulators|
|
@@ -335,8 +347,8 @@ def deploy_to_emulator!
|
|
335
347
|
sim_choices[s['udid']] = "#{s['name']} running iOS #{ios_version}" } }
|
336
348
|
if sim_choices.keys.any?
|
337
349
|
choose do |menu|
|
338
|
-
menu.header =
|
339
|
-
menu.prompt =
|
350
|
+
menu.header = 'Installed iOS Simulators'
|
351
|
+
menu.prompt = 'Please choose a simulator to deploy to: '
|
340
352
|
|
341
353
|
sim_choices.each {|udid, name|
|
342
354
|
menu.choice(name) {|choice| sim_opts[:udid] = udid } }
|
@@ -349,6 +361,14 @@ def deploy_to_emulator!
|
|
349
361
|
cmd << " simUDID=#{sim_opts[:udid]}"
|
350
362
|
system cmd
|
351
363
|
end
|
364
|
+
@path_to_sim_script = File.expand_path(
|
365
|
+
File.join(__dir__, 'platinum-ios-simulate.js'))
|
366
|
+
def base_cmd_for_simjs; "node #{@path_to_sim_script}" end
|
367
|
+
def get_simjs_sims
|
368
|
+
json_sim_list = `#{base_cmd_for_simjs} command=list 2>&1`.strip
|
369
|
+
begin return JSON.parse json_sim_list
|
370
|
+
rescue => e; fatal e.message; end
|
371
|
+
end
|
352
372
|
def deploy_to_device!
|
353
373
|
cmd = "ios-deploy --debug --bundle #{bundle_path}"
|
354
374
|
# system cmd
|
@@ -405,27 +425,25 @@ def attach_tf_comment_from_git
|
|
405
425
|
git = Git.open '.'
|
406
426
|
git.log.first.message
|
407
427
|
end
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
unless system 'git add .; git commit'
|
417
|
-
fatal('You must commit your work before deploying to TestFairy.') end
|
418
|
-
puts
|
419
|
-
end
|
428
|
+
|
429
|
+
def list_things!
|
430
|
+
puts; log_info 'Listing things...'; puts
|
431
|
+
|
432
|
+
log_info 'Simulators'
|
433
|
+
log_info '=========='; puts
|
434
|
+
sim_list = get_simjs_sims
|
435
|
+
ap sim_list; puts
|
420
436
|
end
|
421
437
|
|
422
438
|
if @command
|
423
439
|
case @command
|
424
440
|
when 'compile' then compile_source!
|
425
|
-
when 'build' then build! if compile_source!
|
441
|
+
when 'build' then build! if compile_source! # Compile and build.
|
426
442
|
when 'deploy'
|
443
|
+
# Force a git commit upfront.
|
427
444
|
force_git_commit! if build_cmd_opts[:target] =~ /^dist/
|
428
|
-
deploy! if compile_source! && build!
|
445
|
+
deploy! if compile_source! && build! # Compile, build and deploy.
|
446
|
+
when 'list' then list_things!
|
429
447
|
else fatal "Command not recognized: #{@command}"
|
430
448
|
end
|
431
449
|
exit 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: platinum-deployer
|
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
|
- MacKinley Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|