cake 0.5.5 → 0.5.6

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 (4) hide show
  1. data/bin/cake +13 -40
  2. data/lib/bake.jar +0 -0
  3. data/lib/cake.jar +0 -0
  4. metadata +4 -4
data/bin/cake CHANGED
@@ -189,11 +189,7 @@ def verbose?
189
189
  end
190
190
 
191
191
  def restart?
192
- $opts[:r] or $opts[:restart] or [:stop, :restart].include?($command)
193
- end
194
-
195
- def admin_command?
196
- [:start, :stop, :reload, :restart].include?($command)
192
+ $opts[:r] or $opts[:restart]
197
193
  end
198
194
 
199
195
  def log(command, *messages)
@@ -373,7 +369,7 @@ class JVM
373
369
  end
374
370
 
375
371
  def with_restart
376
- stop
372
+ kill
377
373
  yield
378
374
  start
379
375
  end
@@ -388,7 +384,7 @@ class JVM
388
384
  else
389
385
  inspect(socket) if debug?
390
386
  log(:reload, "unable to reload all #{type} files, restarting") if verbose?
391
- stop(:reload)
387
+ kill
392
388
  end
393
389
  end
394
390
  end
@@ -420,26 +416,6 @@ class JVM
420
416
  retry
421
417
  end
422
418
 
423
- def stop(mode = :stop)
424
- return unless running?
425
- with_socket(nil) do |socket|
426
- action = mode == :reload ? 'quit' : 'force-quit'
427
- log(mode, "sending #{action} to #{type} jvm on port #{port}") if debug?
428
- socket.write(":#{action} {}")
429
- if socket.eof?
430
- log(mode, "#{type} jvm stopped") if restart?
431
- reset!
432
- else
433
- inspect(socket)
434
- if mode == :stop
435
- log(mode, "error stopping #{type} jvm, try 'cake kill' or 'cake kill -9'")
436
- else
437
- log(mode, "close active connections or use 'cake stop' to force quit")
438
- end
439
- end
440
- end || (log(mode, "#{type} jvm not running") if $command == :stop)
441
- end
442
-
443
419
  def kill(force = $opts[:"9"])
444
420
  if pid
445
421
  signal = force ? KILL : TERM
@@ -814,7 +790,8 @@ if $command == :default and $opts[:version]
814
790
  exit
815
791
  elsif $command == :killall or $command == :kill
816
792
  if $opts[:all] or $opts[:kill] == ['all'] or $command == :killall
817
- puts "'cake kill --all' is deprecated, in the future use 'cake kill all' instead" if $opts[:all]
793
+ puts "'cake kill --all' is deprecated, in the future use 'cake killall' instead" if $opts[:all]
794
+ puts "'cake kill all' is deprecated, in the future use 'cake killall' instead" if $opts[:kill] == ['all']
818
795
  num = ps.each do |line|
819
796
  pid = line.split(' ').first.to_i
820
797
  Process.kill($opts[:"9"] ? KILL : TERM, pid)
@@ -834,14 +811,13 @@ elsif $command == :restart and $opts[:restart] == ["project"]
834
811
  bake.init
835
812
  exit
836
813
  elsif restart?
837
- cake.stop
838
- bake.stop
839
- exit if $command == :stop
814
+ cake.kill
815
+ bake.kill
840
816
  end
841
817
 
842
818
  cake.init
843
819
  if [:deps, :clean].include?($command)
844
- bake.stop
820
+ bake.kill
845
821
  elsif File.exists?('project.clj')
846
822
  if not bake.enabled?
847
823
  cake.send_command(:deps)
@@ -857,14 +833,9 @@ if [:repl, :eval, :filter, :run].include?($command)
857
833
  else
858
834
  bake.send($command)
859
835
  end
860
- elsif [:start, :reload, :restart].include?($command)
861
- if $opts[:l] or $opts[:log]
862
- system("touch .cake/project.log")
863
- system("tail -f .cake/project.log")
864
- else
865
- cake.ping
866
- bake.ping
867
- end
836
+ elsif [:reload].include?($command)
837
+ cake.ping
838
+ bake.ping
868
839
  else
869
840
  if $command == :autotest
870
841
  cake.send_command(:test)
@@ -880,3 +851,5 @@ else
880
851
  cake.send_command($command)
881
852
  end
882
853
  end
854
+
855
+ system("tail -n0 -f .cake/project.log") if $opts[:l] or $opts[:log]
data/lib/bake.jar CHANGED
Binary file
data/lib/cake.jar CHANGED
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cake
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 5
10
- version: 0.5.5
9
+ - 6
10
+ version: 0.5.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Balthrop
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-07 00:00:00 -07:00
19
+ date: 2010-11-10 00:00:00 -08:00
20
20
  default_executable: cake
21
21
  dependencies: []
22
22