tomate 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Tobias Bühlmann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Tomate [![Gem Version](https://badge.fury.io/rb/tomate.png)](http://badge.fury.io/rb/tomate) [![Dependency Status](https://gemnasium.com/tbuehlmann/tomate.png)](https://gemnasium.com/tbuehlmann/tomate)
2
+ A Ruby based Pomodoro timer.
3
+
4
+ ## Requirements
5
+ - Ruby ≥ 1.9.2
6
+ - libnotify-bin
7
+
8
+ ## Installation
9
+ ```sh
10
+ $ gem install tomate
11
+ ```
12
+
13
+ ## Usage
14
+ 25 minutes timer:
15
+ ```sh
16
+ $ tomate
17
+ ```
18
+
19
+ 10 seconds timer:
20
+ ```sh
21
+ $ tomate -d 10
22
+ ```
23
+
24
+ ## Contributing
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'tomate'
4
+
5
+ options = Slop.parse(help: true) do
6
+ banner 'Usage: tomate [options]'
7
+
8
+ on :d, :delay,
9
+ "Delay in seconds (default: #{Tomate::Timer::DEFAULT_DELAY})",
10
+ argument: true,
11
+ as: Integer
12
+ end
13
+
14
+ timer = Tomate::Timer.new(options[:delay])
15
+ timer.start
@@ -0,0 +1,9 @@
1
+ require 'slop'
2
+
3
+ module Tomate
4
+ require 'tomate/timer'
5
+ require 'tomate/version'
6
+
7
+ dir = File.dirname(File.realpath(__FILE__))
8
+ POMODORO_PNG = File.join(dir, 'tomate', 'images', 'pomodoro.png')
9
+ end
@@ -0,0 +1,19 @@
1
+ module Tomate
2
+ class Timer
3
+ DEFAULT_DELAY = 25*60
4
+
5
+ def initialize(delay)
6
+ @delay = Integer(delay || DEFAULT_DELAY)
7
+ end
8
+
9
+ def start
10
+ pid = fork do
11
+ Kernel.system('notify-send', '-i', POMODORO_PNG, 'Pomodoro', "Timer started: #{@delay} seconds.")
12
+ sleep @delay
13
+ Kernel.system('notify-send', '-u', 'critical', '-t', '60000', '-i',POMODORO_PNG, 'Pomodoro', 'Take a break, nerd!')
14
+ end
15
+
16
+ Process.detach(pid)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ module Tomate
2
+ VERSION = Gem::Version.new('0.0.1')
3
+ end
@@ -0,0 +1,24 @@
1
+ # encoding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'tomate/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'tomate'
8
+ spec.version = Tomate::VERSION
9
+ spec.authors = ['Tobias Bühlmann']
10
+ spec.email = ['tobias.buehlmann@gmx.de']
11
+ spec.summary = 'Ruby based Pomodoro timer.'
12
+ spec.description = 'Starts a Pomodoro timer and notifies via notify-send.'
13
+ spec.homepage = 'https://github.com/tbuelhmann/tomate'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.required_ruby_version = '>= 1.9.2'
22
+ spec.add_dependency('slop', '~> 3.4')
23
+ spec.add_development_dependency 'bundler', '~> 1.3'
24
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tomate
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Tobias Bühlmann
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: slop
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '3.4'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.4'
30
+ - !ruby/object:Gem::Dependency
31
+ name: bundler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.3'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.3'
46
+ description: Starts a Pomodoro timer and notifies via notify-send.
47
+ email:
48
+ - tobias.buehlmann@gmx.de
49
+ executables:
50
+ - tomate
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - Gemfile
56
+ - LICENSE
57
+ - README.md
58
+ - bin/tomate
59
+ - lib/tomate.rb
60
+ - lib/tomate/images/pomodoro.png
61
+ - lib/tomate/timer.rb
62
+ - lib/tomate/version.rb
63
+ - tomate.gemspec
64
+ homepage: https://github.com/tbuelhmann/tomate
65
+ licenses:
66
+ - MIT
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: 1.9.2
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 1.8.25
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: Ruby based Pomodoro timer.
89
+ test_files: []