termodoro 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/termodoro +0 -0
  3. data/lib/termodoro.rb +47 -0
  4. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9e4ebbfb72e22d4974341164d6f1ca7cd441de64
4
+ data.tar.gz: 8b94ab4236537bd8b739644a7d378a4c0146edc0
5
+ SHA512:
6
+ metadata.gz: 81f8c03114d91aedfc60309d93d43dc44938f4eaa4a49c4db104d3320f665b6b0d185e5f19a62d14dd1c834cff2597f250a5cc96fd7410c484366751bb7fb222
7
+ data.tar.gz: 0f1e2cc0f3a4f31cd5ff2258abcc493f10f516374e98f4fa5e3ad1e3653651e8eb0c9a1342683ee8d8135da7b700213a0f2bef022278edf47eca6093c7dcf19a
data/bin/termodoro ADDED
File without changes
data/lib/termodoro.rb ADDED
@@ -0,0 +1,47 @@
1
+ require 'pry'
2
+
3
+ class Termodoro
4
+
5
+ def initialize
6
+ # duration
7
+ # message
8
+ # title on/off
9
+ end
10
+
11
+ def parse_time
12
+ # take duration and make into seconds
13
+ # return total seconds
14
+ end
15
+
16
+ def run
17
+ # system call
18
+ # if title on/off call one or the other
19
+ end
20
+
21
+ end
22
+
23
+ puts "how long? (write only a number for minutes)"
24
+ length_response = gets.chomp
25
+ number = length_response.split(" ").first.to_i
26
+ segment = length_response.split(" ").last
27
+ duration = 5
28
+
29
+ if segment == "seconds" || segment == "sec" || segment == "secs" || segment == "s"
30
+ duration = number
31
+ elsif segment == "m" || segment == "min" || segment == "mins" || segment == "minutes" || segment == ""
32
+ duration = number * 60
33
+ elsif segment == "h" || segment == "hour" || segment == "hours"
34
+ duration = number * 3600
35
+ end
36
+
37
+ puts "what message?"
38
+ message = gets.chomp
39
+ puts "enter a title here if you want one,"
40
+ puts "otherwise, just hit enter"
41
+ title = gets.chomp
42
+
43
+ if title == ""
44
+ system("sleep #{duration} && terminal-notifier -message '#{message}' & disown && exit")
45
+ else
46
+ system("sleep #{duration} && terminal-notifier -message '#{message}' -title '#{title}' & disown && exit")
47
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: termodoro
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Vinney Cavallo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-22 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Description coming...
14
+ email: vcavallo@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/termodoro.rb
20
+ - bin/termodoro
21
+ homepage: http://rubygems.org/gems/termodoro
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.0.6
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Lightweight CL reminder/timer app
45
+ test_files: []