sesh 0.3.4 → 0.3.5

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: 45fa82a9c47d0cbdeef3e2e4559be075213997bb
4
- data.tar.gz: efc1cbf7895f51e8f22233159d1c9f010ce71c83
3
+ metadata.gz: 36c6a8e5a1802215f8320befafd49f5db4434be4
4
+ data.tar.gz: c6af33a578de3319671b4393b5608c66c3af5ed2
5
5
  SHA512:
6
- metadata.gz: e89fbf514e3327e0705f314511aafd0c5704f218e604f8f36d071ce97f581c079b922f958617e577e3dd12232fce642e6297b46b7600c027fb8e26fb2978e57d
7
- data.tar.gz: ee54d777d081611fd467cff0bc448352b7d9a8a2286a911d86fdc563cfbbfc27c4d5f2c01abcf7666a0223412f5d8e4a6f53e4e6863af2e480b65bb02b2e1bad
6
+ metadata.gz: adfaf130ee276f65aa942f2d388836ff4137196218e5e66c7878b492d00f51c4ee9171f82e368e762fb46af25ece9a8ee16434b29965c2b052fb88ad651db9b0
7
+ data.tar.gz: 390b4d6a19e0895ff3057b0ac2f6527d42a5f88b2675b9cb3a89f4533135502fe8b26e2775d93e34515bc780ea686ae731fb32c42061f583230e251b227e9686
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sesh (0.3.4)
4
+ sesh (0.3.5)
5
5
  awesome_print (~> 1.6)
6
6
  colorize (~> 0.7.7)
7
7
  deep_merge (~> 1.0)
data/Session.vim CHANGED
@@ -8,6 +8,53 @@ if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
8
8
  let s:wipebuf = bufnr('%')
9
9
  endif
10
10
  set shortmess=aoO
11
+ badd +13 ~/Sites/zip_search/zip_search.gemspec
12
+ badd +1 ~/Sites/zip_search/app/models/zip_search/zip_search.rb
13
+ badd +1 ~/Sites/zip_search/app/models/zip_search/location.rb
14
+ badd +8 ~/Sites/zip_search/lib/zip_search.rb
15
+ badd +7 ~/Sites/zip_search/lib/zip_search/engine.rb
16
+ badd +1 ~/Sites/zip_search/lib/zip_search/railtie.rb
17
+ badd +4 ~/Sites/zip_search/lib/zip_search/model_helpers.rb
18
+ badd +5 ~/Sites/zip_search/lib/zip_search/acts_as_location.rb
19
+ badd +5 ~/Sites/zip_search/lib/zip_search/strong_params_helper.rb
20
+ badd +4 ~/Sites/zip_search/test/dummy/config/routes.rb
21
+ badd +1 ~/Sites/zip_search/test/dummy/app/views/main/home.html.erb
22
+ badd +1 ~/Sites/zip_search/lib/zip_search/view_helpers.rb
23
+ badd +1 \'/Users/smit1625/Sites/zip_search/app/views/zip_search/locations/_search_field.html.erb\'
24
+ badd +9 ~/Sites/zip_search/app/views/zip_search/locations/_search_field.html.erb
25
+ badd +8 ~/Sites/zip_search/Gemfile
26
+ badd +8 ~/Sites/zip_search/app/assets/javascripts/zip_search/locations.coffee
27
+ badd +3 ~/Sites/zip_search/config/routes.rb
28
+ badd +1 ~/Sites/zip_search/test/dummy/app/assets/javascripts/application.js
29
+ badd +1 ~/Sites/zip_search/app/views/layouts/zip_search/application.html.erb
30
+ badd +1 ~/Sites/zip_search/test/dummy/app/views/layouts/application.html.erb
31
+ badd +1 \'/Users/smit1625/Sites/zip_search/app/assets/javascripts/zip_search/init.js\'
32
+ badd +3 ~/Sites/zip_search/app/controllers/zip_search/locations_controller.rb
33
+ badd +1 ~/Sites/zip_search/test/dummy/config/database.yml
34
+ badd +17 ~/Sites/zip_search/app/assets/stylesheets/zip_search/typeahead.scss
35
+ badd +1 ~/Sites/zip_search/test/dummy/app/models/house.rb
36
+ badd +14 ~/Sites/zip_search/test/dummy/app/controllers/houses_controller.rb
37
+ badd +1 ~/Sites/zip_search/test/dummy/app/views/houses/new.html.erb
38
+ badd +7 ~/Sites/zip_search/test/dummy/app/views/houses/_form.html.erb
39
+ badd +5 ~/Sites/zip_search/lib/zip_search/has_locations.rb
40
+ badd +1 ~/Sites/zip_search/test/dummy/config/environments/development.rb
41
+ badd +1 \'/Users/smit1625/Sites/zip_search/config/spring.rb\'
42
+ badd +1 ~/Sites/zip_search/config/spring.rb
43
+ badd +1 ~/Sites/zip_search/test/dummy/config/spring.rb
44
+ badd +1 ~/Sites/zip_search/config/application.rb
45
+ badd +1 ~/Sites/zip_search/test/dummy/config/application.rb
46
+ badd +1 ~/Sites/zip_search/test/dummy/Guardfile
47
+ badd +82 ~/Sites/zip_search/Guardfile
48
+ badd +1 \'/Users/smit1625/Sites/zip_search/zeus.json\'
49
+ badd +1 ~/Sites/zip_search/zeus.json
50
+ badd +1 \'/Users/smit1625/Sites/zip_search/engine_plan.rb\'
51
+ badd +1 ~/Sites/zip_search/engine_plan.rb
52
+ badd +10 ~/Sites/zip_search/lib/zip_search/controller_helpers.rb
53
+ badd +14 ~/Sites/zip_search/test/dummy/app/views/houses/show.html.erb
54
+ badd +1 ~/Sites/zip_search/app/assets/javascripts/zip_search/init.js
55
+ badd +6 ~/Sites/zip_search/lib/zip_search/simple_form_helper.rb
56
+ badd +1 \'/Users/smit1625/Sites/zip_search/app/views/zip_search/_simple_fields.html.erb\'
57
+ badd +1 ~/Sites/zip_search/app/views/zip_search/_simple_fields.html.erb
11
58
  badd +3 lib/sesh/version.rb
12
59
  badd +1 ~/Sites/energy_innovation_award/index.html
13
60
  badd +1 ~/Sites/energy_innovation_award/css/custom.css
@@ -274,9 +321,13 @@ badd +74 lib/sesh/tmux_control.rb
274
321
  badd +15 lib/sesh/ssh_control.rb
275
322
  badd +1 lib/sesh.rb
276
323
  badd +32 sesh.gemspec
324
+ badd +18 exe/return_to_sesh.applescript
325
+ badd +1 \'/Users/smit1625/Sites/sesh/exe/return_to_sesh.applescript\'
326
+ badd +2 exe/return_to_sesh
327
+ badd +0 exe/sesh
277
328
  argglobal
278
329
  silent! argdel *
279
- edit lib/sesh/version.rb
330
+ edit exe/sesh
280
331
  set splitbelow splitright
281
332
  wincmd _ | wincmd |
282
333
  split
@@ -302,18 +353,18 @@ set nosplitbelow
302
353
  set nosplitright
303
354
  wincmd t
304
355
  set winheight=1 winwidth=1
305
- exe '1resize ' . ((&lines * 16 + 25) / 50)
306
- exe 'vert 1resize ' . ((&columns * 72 + 73) / 146)
307
- exe '2resize ' . ((&lines * 15 + 25) / 50)
308
- exe 'vert 2resize ' . ((&columns * 72 + 73) / 146)
309
- exe '3resize ' . ((&lines * 16 + 25) / 50)
310
- exe 'vert 3resize ' . ((&columns * 73 + 73) / 146)
311
- exe '4resize ' . ((&lines * 15 + 25) / 50)
312
- exe 'vert 4resize ' . ((&columns * 73 + 73) / 146)
313
- exe '5resize ' . ((&lines * 15 + 25) / 50)
314
- exe 'vert 5resize ' . ((&columns * 73 + 73) / 146)
315
- exe '6resize ' . ((&lines * 15 + 25) / 50)
316
- exe 'vert 6resize ' . ((&columns * 72 + 73) / 146)
356
+ exe '1resize ' . ((&lines * 19 + 31) / 62)
357
+ exe 'vert 1resize ' . ((&columns * 102 + 136) / 272)
358
+ exe '2resize ' . ((&lines * 20 + 31) / 62)
359
+ exe 'vert 2resize ' . ((&columns * 102 + 136) / 272)
360
+ exe '3resize ' . ((&lines * 20 + 31) / 62)
361
+ exe 'vert 3resize ' . ((&columns * 169 + 136) / 272)
362
+ exe '4resize ' . ((&lines * 19 + 31) / 62)
363
+ exe 'vert 4resize ' . ((&columns * 169 + 136) / 272)
364
+ exe '5resize ' . ((&lines * 19 + 31) / 62)
365
+ exe 'vert 5resize ' . ((&columns * 101 + 136) / 272)
366
+ exe '6resize ' . ((&lines * 19 + 31) / 62)
367
+ exe 'vert 6resize ' . ((&columns * 170 + 136) / 272)
317
368
  argglobal
318
369
  setlocal fdm=manual
319
370
  setlocal fde=0
@@ -324,12 +375,12 @@ setlocal fml=1
324
375
  setlocal fdn=20
325
376
  setlocal fen
326
377
  silent! normal! zE
327
- let s:l = 3 - ((1 * winheight(0) + 8) / 16)
378
+ let s:l = 1 - ((0 * winheight(0) + 9) / 19)
328
379
  if s:l < 1 | let s:l = 1 | endif
329
380
  exe s:l
330
381
  normal! zt
331
- 3
332
- normal! 03|
382
+ 1
383
+ normal! 0
333
384
  wincmd w
334
385
  argglobal
335
386
  edit lib/sesh/tmux_control.rb
@@ -342,12 +393,12 @@ setlocal fml=1
342
393
  setlocal fdn=20
343
394
  setlocal fen
344
395
  silent! normal! zE
345
- let s:l = 113 - ((11 * winheight(0) + 7) / 15)
396
+ let s:l = 185 - ((9 * winheight(0) + 10) / 20)
346
397
  if s:l < 1 | let s:l = 1 | endif
347
398
  exe s:l
348
399
  normal! zt
349
- 113
350
- normal! 018|
400
+ 185
401
+ normal! 09|
351
402
  wincmd w
352
403
  argglobal
353
404
  edit lib/sesh/ssh_control.rb
@@ -360,7 +411,7 @@ setlocal fml=1
360
411
  setlocal fdn=20
361
412
  setlocal fen
362
413
  silent! normal! zE
363
- let s:l = 38 - ((10 * winheight(0) + 8) / 16)
414
+ let s:l = 38 - ((1 * winheight(0) + 10) / 20)
364
415
  if s:l < 1 | let s:l = 1 | endif
365
416
  exe s:l
366
417
  normal! zt
@@ -378,12 +429,12 @@ setlocal fml=1
378
429
  setlocal fdn=20
379
430
  setlocal fen
380
431
  silent! normal! zE
381
- let s:l = 22 - ((9 * winheight(0) + 7) / 15)
432
+ let s:l = 10 - ((9 * winheight(0) + 9) / 19)
382
433
  if s:l < 1 | let s:l = 1 | endif
383
434
  exe s:l
384
435
  normal! zt
385
- 22
386
- normal! 068|
436
+ 10
437
+ normal! 044|
387
438
  wincmd w
388
439
  argglobal
389
440
  edit lib/sesh.rb
@@ -396,12 +447,12 @@ setlocal fml=1
396
447
  setlocal fdn=20
397
448
  setlocal fen
398
449
  silent! normal! zE
399
- let s:l = 41 - ((11 * winheight(0) + 7) / 15)
450
+ let s:l = 45 - ((8 * winheight(0) + 9) / 19)
400
451
  if s:l < 1 | let s:l = 1 | endif
401
452
  exe s:l
402
453
  normal! zt
403
- 41
404
- normal! 023|
454
+ 45
455
+ normal! 031|
405
456
  wincmd w
406
457
  argglobal
407
458
  edit lib/sesh/cli.rb
@@ -414,26 +465,26 @@ setlocal fml=1
414
465
  setlocal fdn=20
415
466
  setlocal fen
416
467
  silent! normal! zE
417
- let s:l = 210 - ((1 * winheight(0) + 7) / 15)
468
+ let s:l = 94 - ((18 * winheight(0) + 9) / 19)
418
469
  if s:l < 1 | let s:l = 1 | endif
419
470
  exe s:l
420
471
  normal! zt
421
- 210
472
+ 94
422
473
  normal! 032|
423
474
  wincmd w
424
475
  2wincmd w
425
- exe '1resize ' . ((&lines * 16 + 25) / 50)
426
- exe 'vert 1resize ' . ((&columns * 72 + 73) / 146)
427
- exe '2resize ' . ((&lines * 15 + 25) / 50)
428
- exe 'vert 2resize ' . ((&columns * 72 + 73) / 146)
429
- exe '3resize ' . ((&lines * 16 + 25) / 50)
430
- exe 'vert 3resize ' . ((&columns * 73 + 73) / 146)
431
- exe '4resize ' . ((&lines * 15 + 25) / 50)
432
- exe 'vert 4resize ' . ((&columns * 73 + 73) / 146)
433
- exe '5resize ' . ((&lines * 15 + 25) / 50)
434
- exe 'vert 5resize ' . ((&columns * 73 + 73) / 146)
435
- exe '6resize ' . ((&lines * 15 + 25) / 50)
436
- exe 'vert 6resize ' . ((&columns * 72 + 73) / 146)
476
+ exe '1resize ' . ((&lines * 19 + 31) / 62)
477
+ exe 'vert 1resize ' . ((&columns * 102 + 136) / 272)
478
+ exe '2resize ' . ((&lines * 20 + 31) / 62)
479
+ exe 'vert 2resize ' . ((&columns * 102 + 136) / 272)
480
+ exe '3resize ' . ((&lines * 20 + 31) / 62)
481
+ exe 'vert 3resize ' . ((&columns * 169 + 136) / 272)
482
+ exe '4resize ' . ((&lines * 19 + 31) / 62)
483
+ exe 'vert 4resize ' . ((&columns * 169 + 136) / 272)
484
+ exe '5resize ' . ((&lines * 19 + 31) / 62)
485
+ exe 'vert 5resize ' . ((&columns * 101 + 136) / 272)
486
+ exe '6resize ' . ((&lines * 19 + 31) / 62)
487
+ exe 'vert 6resize ' . ((&columns * 170 + 136) / 272)
437
488
  tabnext 1
438
489
  if exists('s:wipebuf')
439
490
  silent exe 'bwipe ' . s:wipebuf
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ruby
2
+ system File.expand_path(File.join(__dir__, 'return_to_sesh.applescript'))
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env osascript
2
+
3
+ tell application "System Events"
4
+ set frontApp to the name of the first application process whose frontmost is true
5
+ end tell
6
+ if frontApp is "iTerm"
7
+ tell application "iTerm" to set frontWindow to the index of the front window
8
+ set loops to 0
9
+ tell application "System Events"
10
+ repeat until (loops > 20) or (name of first application process whose frontmost is true) is "Google Chrome"
11
+ set loops to (loops + 1)
12
+ delay 0.5
13
+ end repeat
14
+ end tell
15
+ if loops < 21
16
+ delay 0.5
17
+ tell application "iTerm"
18
+ activate
19
+ set index of window frontWindow to 1
20
+ end tell
21
+ tell application "System Events" to tell process "iTerm" to perform action "AXRaise" of the first window
22
+ end if
23
+ end if
24
+
data/lib/sesh/cli.rb CHANGED
@@ -81,6 +81,10 @@ module Sesh
81
81
  parsed_options[:shell][:pane] = v }
82
82
  opts.on('--spec-path=path', 'Path to Spec File to Run') {|v|
83
83
  parsed_options[:shell][:spec] = v }
84
+ opts.on('--rspec-prefix=prefix', 'Prefix for rspec command') {|v|
85
+ parsed_options[:shell][:rspec_prefix] = v }
86
+ opts.on('--and-return', 'Return after Execution') {|v|
87
+ parsed_options[:shell][:and_return] = true }
84
88
 
85
89
  # # target_opts = DEPLOYMENT_TARGETS.join '|'
86
90
  # opts.on("-T", "--target=target", 'Titanium Deployment Target') do |v|
@@ -160,6 +164,11 @@ module Sesh
160
164
  end
161
165
  end
162
166
  # TODO: parse a spec file
167
+ if @command == 'rspec' && @options[:shell][:spec].nil?
168
+ ARGV.each{|a| if a =~ /spec\//
169
+ @options[:shell][:spec] = a; break end } if ARGV.any?
170
+ @options[:shell][:spec] ||= 'spec'
171
+ end
163
172
  # This block should always go at the end because it eats the rest of ARGV.
164
173
  if %w(run).include?(@command) && @options[:shell][:command].nil?
165
174
  if ARGV.any?
@@ -233,10 +242,8 @@ module Sesh
233
242
  Logger.success "Sesh client connected successfully."
234
243
  else Logger.fatal 'Sesh client failed to connect.' end
235
244
  when 'begin' then @tmux_control.begin_tmuxinator_session!
236
- when 'run'
245
+ when 'run', 'rspec'
237
246
  @tmux_control.do_shell_operation! @options[:shell]
238
- when 'rspec'
239
- puts "Spec: #{@options[:shell][:spec]}"
240
247
  when 'detach' then @tmux_control.disconnect_client! ARGV.join(' ')
241
248
  else
242
249
  Logger.fatal "Command not recognized!"
@@ -176,7 +176,13 @@ module Sesh
176
176
  move_cursor_to_pane!(pane); send_interrupt! end
177
177
  def do_shell_operation!(options=DEFAULT_OPTIONS[:shell])
178
178
  unless options[:spec].nil?
179
- options[:command] ||= "spring rspec #{options[:spec]}" end
179
+ rspec_cmd = if options[:rspec_prefix].nil? then 'rspec'
180
+ else "#{options[:rspec_prefix]} rspec" end
181
+ options[:command] ||= "#{rspec_cmd} #{options[:spec]}"
182
+ end
183
+ if options[:and_return]
184
+ options[:command] = "return_to_sesh &; #{options[:command]}"
185
+ end
180
186
  if options[:pane].nil?
181
187
  interrupt_and_send_command_to_project! options[:command]
182
188
  else
data/lib/sesh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sesh
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.5'
3
3
  end
data/lib/sesh.rb CHANGED
@@ -34,7 +34,9 @@ module Sesh
34
34
  shell: {
35
35
  command: nil,
36
36
  pane: nil,
37
- spec: nil
37
+ spec: nil,
38
+ rspec_prefix: nil,
39
+ and_return: false
38
40
  },
39
41
  ssh: {
40
42
  local_addr: nil,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sesh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - MacKinley Smith
@@ -111,6 +111,8 @@ dependencies:
111
111
  description: Remote background sessions powered by tmux and tmuxinator.
112
112
  email: smithmackinley@gmail.com
113
113
  executables:
114
+ - return_to_sesh
115
+ - return_to_sesh.applescript
114
116
  - sesh
115
117
  extensions: []
116
118
  extra_rdoc_files: []
@@ -124,6 +126,8 @@ files:
124
126
  - Session.vim
125
127
  - bin/console
126
128
  - bin/setup
129
+ - exe/return_to_sesh
130
+ - exe/return_to_sesh.applescript
127
131
  - exe/sesh
128
132
  - lib/sesh.rb
129
133
  - lib/sesh/assets/sample.yml