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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 169f7f8359fecd3538137b143d68793523327a4eb18a5dd1db26cfe95b3ac2f3
4
- data.tar.gz: e8af5dc12aca6d64dd56b74617599d50ed6ba423ee07108ad7df35926859b2df
3
+ metadata.gz: e99507d8e5d3c89b3dd67c78751829110196bde001944970ca2fddda06829326
4
+ data.tar.gz: 22bd65a3d68c41ee9754947b253c1f624222f45e448b70cfc944a9cb794833c2
5
5
  SHA512:
6
- metadata.gz: 81934dacfe59b6d5faccc350c2dbcb2bfdeb5dd94ae4b57d39ba7adb5b217b3be6f790738bfc8099afcfeaa8089849d78524189cff7b9b27451162c66380f6ae
7
- data.tar.gz: 69e3e21c061292c6d39176f16a2d1b3344f44c5de0ea1a3501b5bdf820bad16afdac1b254844c3fe105da49537da26b9f7cfcc2de47b12e35dd7896be1325cb9
6
+ metadata.gz: b4557e6a37e4aedceaf00e7f9342321ac75c566ba864b8681e44db6a040dd7bd30bbf787b5eea63497011ca382a551686143b84f5b6897325030091d5bfdc0b5
7
+ data.tar.gz: f410631830d49647ec587bdf8dec3784027e547b64f55ccf743d1d2f51dd54b3f0079793bf0a2bc07ddd6ba5c63241033c641c68c8a0534585793609a8a22e59
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Tomatos
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tomatos`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
26
-
27
- ## Development
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
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tomatos.
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: tomato.rb [options]"
17
+ parser.banner = "Usage: tomatos [options]"
22
18
 
23
- parser.on("-tTIME", "--time=TIME", "Time delta: `15m` means 15mins, `30s` means 30secs, default use mins ") do |v|
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|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tomatos
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.1"
5
5
  end
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
- total_secs.times do
58
+ while count_down > 0 do
60
59
  sleep(1)
61
60
  system('clear')
62
61
  count_down -= 1
63
- puts "Tomato:"
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 click for mac terminal"
12
- spec.description = "Tomato click for mac terminal"
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.0
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-07 00:00:00.000000000 Z
11
+ date: 2022-03-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Tomato click for mac terminal
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 click for mac terminal
58
+ summary: Command line Tomato Clock for Mac OS terminal
59
59
  test_files: []