thyme 0.0.4 → 0.0.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.
Files changed (3) hide show
  1. data/README.md +2 -2
  2. data/thyme.rb +5 -6
  3. metadata +1 -1
data/README.md CHANGED
@@ -33,7 +33,7 @@ Thyme is configurable and extensible. All configurations live in the
33
33
 
34
34
  set :timer, 25
35
35
  set :tmux, true
36
- set :seconds, true
36
+ set :interval, 1
37
37
 
38
38
  option :o, :open, 'open sheets' do
39
39
  `vim -O ~/.thyme-today.md ~/.thyme-records.md < \`tty\` > \`tty\``
@@ -51,7 +51,7 @@ The `set` method sets different configurations. There are only two:
51
51
 
52
52
  * `:timer` is the number of minutes to countdown from
53
53
  * `:tmux` is whether or not you want tmux integration on (off by default)
54
- * `:seconds` determines whether to refresh the timer every second or minute
54
+ * `:interval` is the refresh rate of the progress bar and tmux status in seconds
55
55
 
56
56
  The `option` method adds new options to the `thyme` command. In the above
57
57
  example, we can now execute `thyme -o`. Use `thyme -h` to see available
data/thyme.rb CHANGED
@@ -2,16 +2,16 @@ require 'ruby-progressbar'
2
2
  require 'date'
3
3
 
4
4
  class Thyme
5
- VERSION = '0.0.4'
5
+ VERSION = '0.0.5'
6
6
  CONFIG_FILE = "#{ENV['HOME']}/.thymerc"
7
7
  PID_FILE = "#{ENV['HOME']}/.thyme-pid"
8
8
  TMUX_FILE = "#{ENV['HOME']}/.thyme-tmux"
9
- OPTIONS = [:timer, :tmux, :seconds]
9
+ OPTIONS = [:timer, :tmux, :interval]
10
10
 
11
11
  def initialize
12
12
  @timer = 25
13
13
  @tmux = false
14
- @seconds = true
14
+ @interval = 1
15
15
  end
16
16
 
17
17
  def run
@@ -19,7 +19,6 @@ class Thyme
19
19
  seconds_start = @timer * 60
20
20
  seconds_left = seconds_start + 1
21
21
  start_time = DateTime.now
22
- delta = @seconds ? 1 : 60
23
22
  min_length = (seconds_left / 60).floor.to_s.length
24
23
  tmux_file = File.open(TMUX_FILE, "w")
25
24
  bar = ProgressBar.create(
@@ -40,7 +39,7 @@ class Thyme
40
39
  tmux_file.write("#[default]#[fg=#{fg}]#{title}#[default]")
41
40
  tmux_file.flush
42
41
  end
43
- sleep(delta)
42
+ sleep(@interval)
44
43
  end
45
44
  rescue SignalException => e
46
45
  puts ""
@@ -104,7 +103,7 @@ class Thyme
104
103
  lead = ' ' * (min_length - min.to_s.length)
105
104
  sec = (seconds % 60).floor
106
105
  sec = "0#{sec}" if sec.to_s.length == 1
107
- @seconds ?
106
+ @interval < 60 ?
108
107
  "#{lead}#{min}:#{sec}" :
109
108
  "#{lead}#{min}m"
110
109
  end
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.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: