platinum-deployer 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0c75b8907062cc74597cf4adaefc0e8e07f6908
4
- data.tar.gz: 853bb29b8a9de3df4e6865345181ca90e3a765f8
3
+ metadata.gz: 3e4c251f627b925b7a3a2c56d9f3975f20378882
4
+ data.tar.gz: fe98de9575d56a6241e7177479ee0a3322d0fa10
5
5
  SHA512:
6
- metadata.gz: 66b87846a3ba89382e7a114d6fce637c26c2bf07faf55c36445819df4312809193318b07ce5048a51d40c946dbe3b4537732039e157feb3be6cd0d1943ce736a
7
- data.tar.gz: f9cecd3b2f668ea50be90d2205aef3aea4acf2053755cff8402178854ec0b324a7448e97f9152a34fbc805714878807148e602930db6d50f12d5f5f54fa1a24f
6
+ metadata.gz: deb36024af05e097111f3cac3fbee96afada405b00f87ef68d8ebbbf77c30791609e569a07fd87e3dcdc135dfbfa4e10084cad99ec3c04d976fee4bee2d6b63b
7
+ data.tar.gz: 4fdbe6ee0c125f84211c2bece6f69e25071a23885b43719cf11a5a07e281cd3a672b716a1a6145cbf1e6ba9bff219a8a0d5cdca4225dafe11cd8630e0efef1db
data/Session.vim ADDED
@@ -0,0 +1,138 @@
1
+ let SessionLoad = 1
2
+ if &cp | set nocp | endif
3
+ let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
4
+ let v:this_session=expand("<sfile>:p")
5
+ silent only
6
+ cd ~/Sites/platinum-deployer
7
+ if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
8
+ let s:wipebuf = bufnr('%')
9
+ endif
10
+ set shortmess=aoO
11
+ badd +46 platinum-deployer.gemspec
12
+ badd +5 lib/platinum/deployer/version.rb
13
+ badd +11 bin/setup
14
+ badd +1 \'/Users/smit1625/Sites/platinum-deployer/exe/platinum\'
15
+ badd +358 exe/platinum
16
+ badd +1 \'/Users/smit1625/Sites/platinum-deployer/exe/platinum-ios-simulate.js\'
17
+ badd +1 \'/Users/smit1625/Sites/platinum-deployer/exe/platinum-ios-simulate\'
18
+ badd +19 exe/platinum-ios-simulate.js
19
+ badd +68 exe/platinum-appicon
20
+ badd +18 README.md
21
+ argglobal
22
+ silent! argdel *
23
+ edit lib/platinum/deployer/version.rb
24
+ set splitbelow splitright
25
+ wincmd _ | wincmd |
26
+ split
27
+ wincmd _ | wincmd |
28
+ split
29
+ 2wincmd k
30
+ wincmd _ | wincmd |
31
+ vsplit
32
+ 1wincmd h
33
+ wincmd w
34
+ wincmd w
35
+ wincmd w
36
+ set nosplitbelow
37
+ set nosplitright
38
+ wincmd t
39
+ set winheight=1 winwidth=1
40
+ exe '1resize ' . ((&lines * 19 + 30) / 60)
41
+ exe 'vert 1resize ' . ((&columns * 67 + 67) / 135)
42
+ exe '2resize ' . ((&lines * 19 + 30) / 60)
43
+ exe 'vert 2resize ' . ((&columns * 67 + 67) / 135)
44
+ exe '3resize ' . ((&lines * 18 + 30) / 60)
45
+ exe '4resize ' . ((&lines * 19 + 30) / 60)
46
+ argglobal
47
+ setlocal fdm=manual
48
+ setlocal fde=0
49
+ setlocal fmr={{{,}}}
50
+ setlocal fdi=#
51
+ setlocal fdl=0
52
+ setlocal fml=1
53
+ setlocal fdn=20
54
+ setlocal fen
55
+ silent! normal! zE
56
+ let s:l = 3 - ((2 * winheight(0) + 9) / 19)
57
+ if s:l < 1 | let s:l = 1 | endif
58
+ exe s:l
59
+ normal! zt
60
+ 3
61
+ normal! 020|
62
+ wincmd w
63
+ argglobal
64
+ edit bin/setup
65
+ setlocal fdm=manual
66
+ setlocal fde=0
67
+ setlocal fmr={{{,}}}
68
+ setlocal fdi=#
69
+ setlocal fdl=0
70
+ setlocal fml=1
71
+ setlocal fdn=20
72
+ setlocal fen
73
+ silent! normal! zE
74
+ let s:l = 11 - ((10 * winheight(0) + 9) / 19)
75
+ if s:l < 1 | let s:l = 1 | endif
76
+ exe s:l
77
+ normal! zt
78
+ 11
79
+ normal! 028|
80
+ wincmd w
81
+ argglobal
82
+ edit exe/platinum-ios-simulate.js
83
+ setlocal fdm=manual
84
+ setlocal fde=0
85
+ setlocal fmr={{{,}}}
86
+ setlocal fdi=#
87
+ setlocal fdl=0
88
+ setlocal fml=1
89
+ setlocal fdn=20
90
+ setlocal fen
91
+ silent! normal! zE
92
+ let s:l = 13 - ((12 * winheight(0) + 9) / 18)
93
+ if s:l < 1 | let s:l = 1 | endif
94
+ exe s:l
95
+ normal! zt
96
+ 13
97
+ normal! 043|
98
+ wincmd w
99
+ argglobal
100
+ edit exe/platinum
101
+ setlocal fdm=manual
102
+ setlocal fde=0
103
+ setlocal fmr={{{,}}}
104
+ setlocal fdi=#
105
+ setlocal fdl=0
106
+ setlocal fml=1
107
+ setlocal fdn=20
108
+ setlocal fen
109
+ silent! normal! zE
110
+ let s:l = 474 - ((12 * winheight(0) + 9) / 19)
111
+ if s:l < 1 | let s:l = 1 | endif
112
+ exe s:l
113
+ normal! zt
114
+ 474
115
+ normal! 016|
116
+ wincmd w
117
+ 4wincmd w
118
+ exe '1resize ' . ((&lines * 19 + 30) / 60)
119
+ exe 'vert 1resize ' . ((&columns * 67 + 67) / 135)
120
+ exe '2resize ' . ((&lines * 19 + 30) / 60)
121
+ exe 'vert 2resize ' . ((&columns * 67 + 67) / 135)
122
+ exe '3resize ' . ((&lines * 18 + 30) / 60)
123
+ exe '4resize ' . ((&lines * 19 + 30) / 60)
124
+ tabnext 1
125
+ if exists('s:wipebuf')
126
+ silent exe 'bwipe ' . s:wipebuf
127
+ endif
128
+ unlet! s:wipebuf
129
+ set winheight=1 winwidth=20 shortmess=filnxtToOc
130
+ let s:sx = expand("<sfile>:p:r")."x.vim"
131
+ if file_readable(s:sx)
132
+ exe "source " . fnameescape(s:sx)
133
+ endif
134
+ let &so = s:so_save | let &siso = s:siso_save
135
+ doautoall SessionLoadPost
136
+ let g:this_obsession = v:this_session
137
+ unlet SessionLoad
138
+ " vim: set ft=vim :
data/exe/platinum CHANGED
@@ -12,8 +12,15 @@ require 'colorize'
12
12
  require 'pty'
13
13
  require 'expect'
14
14
  require 'highline/import'
15
+ require 'platinum/deployer'
15
16
 
16
17
  @base_command = File.basename $0
18
+
19
+ puts
20
+ puts "Platinum Deployer v#{Platinum::Deployer::VERSION}".green
21
+ puts "========================".green
22
+ puts
23
+
17
24
  help_banner = <<-HELP
18
25
  Compiles CoffeeScript/HAML in ./app_src to JS/XML in ./app.
19
26
  Developed by MacKinley Smith
@@ -29,7 +36,7 @@ platinum list Lists available simulators and devices.
29
36
 
30
37
  HELP
31
38
  if ARGV.empty? or ARGV.include? '-h' or ARGV.include? '--help'
32
- puts help_banner
39
+ puts help_banner.blue
33
40
  exit
34
41
  end
35
42
 
@@ -60,6 +67,10 @@ DEFAULT_OPTIONS = {
60
67
  :testfairy => {
61
68
  :api_key => nil,
62
69
  :upload_url => 'http://app.testfairy.com/api/upload'
70
+ },
71
+ :satellite_mode => {
72
+ :enabled => false,
73
+ :app_src_source => nil
63
74
  }
64
75
  }
65
76
  DEPLOYMENT_PLATFORMS = %w(ios android)
@@ -155,9 +166,21 @@ end
155
166
  #
156
167
 
157
168
  # Load config from a YAML file in the project root if available.
158
- @config_filepath = File.join(Dir.pwd, 'compile_config.yml')
169
+ POSSIBLE_CONFIG_LOCATIONS =
170
+ %w( platinum_config.yml config/platinum.yml compile_config.yml )
171
+ @config_filepath = nil
172
+ @config_friendly_filepath = nil
173
+ POSSIBLE_CONFIG_LOCATIONS.each do |path|
174
+ fullpath = File.join Dir.pwd, path
175
+ next unless File.exists? fullpath
176
+ @config_filepath = fullpath
177
+ @config_friendly_filepath = path
178
+ break
179
+ end
159
180
  @defaults = DEFAULT_OPTIONS.dup
160
- if File.exists? @config_filepath
181
+ if @config_filepath.nil?
182
+ @config_friendly_filepath = POSSIBLE_CONFIG_LOCATIONS[0]
183
+ else
161
184
  loaded_config = deep_symbolize YAML::load_file(@config_filepath)
162
185
  @defaults.deep_merge! loaded_config
163
186
  end
@@ -224,7 +247,7 @@ end.parse!
224
247
 
225
248
  def compile_source!
226
249
  if @options[:skip_compile]; log_info 'Skipping compilation.'; return true end
227
- puts; log_info 'Compiling project source...'
250
+ log_info 'Compiling project source...'
228
251
  return false unless compile_coffeescript_files! && compile_haml_files!
229
252
  log_success 'Compilation complete!'; true
230
253
  end
@@ -274,7 +297,7 @@ end
274
297
 
275
298
  def build!
276
299
  if @options[:skip_compile]; log_info 'Skipping build.'; return true end
277
- puts; log_info 'Building Titanium project...'; puts
300
+ log_info 'Building Titanium project...'; puts
278
301
  build_success = case build_cmd_opts[:target]
279
302
  when 'device' then build_for_device!
280
303
  when 'emulator', 'simulator' then build_for_emulator!
@@ -323,7 +346,7 @@ end
323
346
  #
324
347
 
325
348
  def deploy!
326
- puts; log_info 'Deploying application...'; puts
349
+ log_info 'Deploying application...'; puts
327
350
  deploy_success = case build_cmd_opts[:target]
328
351
  when 'device' then deploy_to_device!
329
352
  when 'emulator', 'simulator' then deploy_to_emulator!
@@ -427,12 +450,55 @@ def attach_tf_comment_from_git
427
450
  end
428
451
 
429
452
  def list_things!
430
- puts; log_info 'Listing things...'; puts
453
+ log_info 'Listing things...'; puts
431
454
 
432
- log_info 'Simulators'
433
- log_info '=========='; puts
434
455
  sim_list = get_simjs_sims
435
- ap sim_list; puts
456
+ if sim_list.any?
457
+ log_info 'Simulators'
458
+ log_info '=========='; puts
459
+ ap sim_list; puts
460
+ else
461
+ warn 'No simulators found!'; puts
462
+ end
463
+ end
464
+
465
+ def create_satellite!
466
+ log_info 'Creating satellite installation...'
467
+ log_success 'Satellite installation created!'; puts
468
+ end
469
+ def update_satellite!
470
+ satellite_opts = @options[:satellite_mode]
471
+ unless satellite_opts[:enabled]
472
+ warn 'You must enable Satellite Mode to use this feature.'
473
+ warn "Add the following to your #{@config_friendly_filepath} to enable it:"
474
+ puts
475
+ puts 'satellite_mode:'
476
+ puts ' enabled: true'
477
+ puts ' app_src_source: [SSH path to the remote app_src]'
478
+ puts
479
+ fatal 'Satellite Mode is required!'
480
+ end
481
+ unless satellite_opts[:app_src_source]
482
+ warn 'You must set your app_src_source to use this feature.'
483
+ warn "Add the following to your #{@config_friendly_filepath} to enable it:"
484
+ puts
485
+ puts 'satellite_mode:'
486
+ puts ' enabled: true'
487
+ puts ' app_src_source: [SSH path to the remote app_src]'
488
+ puts
489
+ fatal 'Satellite Mode requires app_src_source to be set!'
490
+ end
491
+ log_info 'Updating satellite installation...'; puts
492
+
493
+ app_src_fullpath = File.expand_path File.join(Dir.pwd, 'app_src')
494
+ system "diskutil unmount \"#{app_src_fullpath}\""
495
+ git = Git.open '.'
496
+ git.reset_hard
497
+ git.pull
498
+ FileUtils.rm_rf File.join(Dir.pwd, 'app_src', '*')
499
+ system "sudo sshfs #{satellite_opts[:app_src_source]} app_src -oallow_other"
500
+
501
+ log_success 'Satellite installation updated!'; puts
436
502
  end
437
503
 
438
504
  if @command
@@ -444,6 +510,16 @@ if @command
444
510
  force_git_commit! if build_cmd_opts[:target] =~ /^dist/
445
511
  deploy! if compile_source! && build! # Compile, build and deploy.
446
512
  when 'list' then list_things!
513
+ when 'satellite'
514
+ unless ARGV.any?
515
+ fatal 'A satellite command is required!'
516
+ end
517
+ @subcommand = ARGV.shift
518
+ case @subcommand
519
+ when 'create' then create_satellite!
520
+ when 'update' then update_satellite!
521
+ else fatal "Satellite command not recognized: #{@subcommand}"
522
+ end
447
523
  else fatal "Command not recognized: #{@command}"
448
524
  end
449
525
  exit 0
@@ -1,5 +1,5 @@
1
1
  module Platinum
2
2
  module Deployer
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platinum-deployer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MacKinley Smith
@@ -196,6 +196,7 @@ files:
196
196
  - LICENSE.txt
197
197
  - README.md
198
198
  - Rakefile
199
+ - Session.vim
199
200
  - bin/console
200
201
  - bin/setup
201
202
  - exe/platinum