thyme 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/thyme.rb +7 -8
  2. metadata +2 -2
data/thyme.rb CHANGED
@@ -2,7 +2,7 @@ require 'ruby-progressbar'
2
2
  require 'date'
3
3
 
4
4
  class Thyme
5
- VERSION = '0.0.6'
5
+ VERSION = '0.0.7'
6
6
  CONFIG_FILE = "#{ENV['HOME']}/.thymerc"
7
7
  PID_FILE = "#{ENV['HOME']}/.thyme-pid"
8
8
  TMUX_FILE = "#{ENV['HOME']}/.thyme-tmux"
@@ -49,18 +49,17 @@ class Thyme
49
49
  puts ""
50
50
  ensure
51
51
  tmux_file.close
52
- stop
52
+ File.delete(TMUX_FILE) if File.exists?(TMUX_FILE)
53
+ File.delete(PID_FILE) if File.exists?(PID_FILE)
53
54
  seconds_left = [seconds_start - seconds_since(start_time), 0].max
54
55
  @after.call(seconds_left) if @after
55
56
  end
56
57
 
57
58
  def stop
58
- File.delete(TMUX_FILE) if File.exists?(TMUX_FILE)
59
- if File.exists?(PID_FILE)
60
- pid = File.read(PID_FILE).to_i
61
- File.delete(PID_FILE)
62
- Process.kill('TERM', pid) if pid > 1
63
- end
59
+ return if !File.exists?(PID_FILE)
60
+ pid = File.read(PID_FILE).to_i
61
+ File.delete(PID_FILE)
62
+ Process.kill('TERM', pid) if pid > 1
64
63
  end
65
64
 
66
65
  def daemonize!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thyme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: .
11
11
  cert_chain: []
12
- date: 2013-06-21 00:00:00.000000000 Z
12
+ date: 2013-06-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-progressbar