tomatos 0.1.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -13
- data/exe/tomatos +3 -7
- data/lib/tomatos/version.rb +1 -1
- data/lib/tomatos.rb +4 -6
- data/tomatos.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e99507d8e5d3c89b3dd67c78751829110196bde001944970ca2fddda06829326
|
4
|
+
data.tar.gz: 22bd65a3d68c41ee9754947b253c1f624222f45e448b70cfc944a9cb794833c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4557e6a37e4aedceaf00e7f9342321ac75c566ba864b8681e44db6a040dd7bd30bbf787b5eea63497011ca382a551686143b84f5b6897325030091d5bfdc0b5
|
7
|
+
data.tar.gz: f410631830d49647ec587bdf8dec3784027e547b64f55ccf743d1d2f51dd54b3f0079793bf0a2bc07ddd6ba5c63241033c641c68c8a0534585793609a8a22e59
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Tomatos
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Command line Tomato Clock for Mac OS terminal
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,17 +20,12 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
23
|
+
```
|
24
|
+
Usage: tomatos [options]
|
25
|
+
-t, --time=TIME Time delta: `15m` means 15 min, `30s` means 30 sec, default use 15min
|
26
|
+
-m, --message=MESSAGE Message for this time task
|
34
27
|
|
35
|
-
|
28
|
+
```
|
36
29
|
|
37
30
|
## License
|
38
31
|
|
data/exe/tomatos
CHANGED
@@ -8,19 +8,15 @@ require 'optparse'
|
|
8
8
|
stop_follow = lambda { puts 'See you later :D' }
|
9
9
|
trap("INT") {
|
10
10
|
stop_follow.call
|
11
|
-
exit
|
12
|
-
}
|
13
|
-
|
14
|
-
at_exit {
|
15
|
-
stop_follow.call
|
11
|
+
exit
|
16
12
|
}
|
17
13
|
|
18
14
|
|
19
15
|
options = {}
|
20
16
|
OptionParser.new do |parser|
|
21
|
-
parser.banner = "Usage:
|
17
|
+
parser.banner = "Usage: tomatos [options]"
|
22
18
|
|
23
|
-
parser.on("-tTIME", "--time=TIME", "Time delta: `15m` means
|
19
|
+
parser.on("-tTIME", "--time=TIME", "Time delta: `15m` means 15 min, `30s` means 30 sec, default use 15min ") do |v|
|
24
20
|
options[:time] = v
|
25
21
|
end
|
26
22
|
parser.on("-mMESSAGE", "--message=MESSAGE", "Message for this time task") do |v|
|
data/lib/tomatos/version.rb
CHANGED
data/lib/tomatos.rb
CHANGED
@@ -4,13 +4,12 @@ require_relative "tomatos/version"
|
|
4
4
|
|
5
5
|
module Tomatos
|
6
6
|
class Error < StandardError; end
|
7
|
-
# Your code goes here...
|
8
7
|
end
|
9
8
|
|
10
9
|
module Tomatos
|
11
10
|
class App
|
12
11
|
def initialize(options)
|
13
|
-
@title = 'Tomatos'
|
12
|
+
@title = 'Tomatos Clock'
|
14
13
|
@time_delta = options[:time] || '15m'
|
15
14
|
@time_value = 0
|
16
15
|
@unit = 'm'
|
@@ -56,15 +55,14 @@ module Tomatos
|
|
56
55
|
|
57
56
|
self.notice("Start: #{@time_value} #{unit_text}", @title, @message)
|
58
57
|
count_down = total_secs.dup
|
59
|
-
|
58
|
+
while count_down > 0 do
|
60
59
|
sleep(1)
|
61
60
|
system('clear')
|
62
61
|
count_down -= 1
|
63
|
-
puts
|
62
|
+
puts @title
|
64
63
|
puts "@time: #{self.count_down_text(count_down)}"
|
65
|
-
puts "@message: #{@message}"
|
64
|
+
puts "@message: #{@message}" if @message
|
66
65
|
end
|
67
|
-
sleep(total_secs)
|
68
66
|
self.notice("#{@time_value} #{unit_text} Finished", @title, @message)
|
69
67
|
end
|
70
68
|
end
|
data/tomatos.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Mark24"]
|
9
9
|
spec.email = ["mark.zhangyoung@qq.com"]
|
10
10
|
|
11
|
-
spec.summary = "Tomato
|
12
|
-
spec.description = "Tomato
|
11
|
+
spec.summary = "Command line Tomato Clock for Mac OS terminal"
|
12
|
+
spec.description = "Command line Tomato Clock for Mac OS terminal"
|
13
13
|
spec.homepage = "https://github.com/Mark24Code/tomatos"
|
14
14
|
spec.license = "MIT"
|
15
15
|
spec.required_ruby_version = ">= 2.6.0"
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomatos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark24
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Tomato
|
13
|
+
description: Command line Tomato Clock for Mac OS terminal
|
14
14
|
email:
|
15
15
|
- mark.zhangyoung@qq.com
|
16
16
|
executables:
|
@@ -55,5 +55,5 @@ requirements: []
|
|
55
55
|
rubygems_version: 3.3.3
|
56
56
|
signing_key:
|
57
57
|
specification_version: 4
|
58
|
-
summary: Tomato
|
58
|
+
summary: Command line Tomato Clock for Mac OS terminal
|
59
59
|
test_files: []
|