termodoro 0.1.9 → 0.2.5

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
  SHA1:
3
- metadata.gz: bedddd976063c2aff3aa487dc6040c547c062a9b
4
- data.tar.gz: 8e8f652f79d584c05cf98ffabd374b159cb6f80f
3
+ metadata.gz: e28ec45a4d531ae0799b06ce31cd75ec88edf3b7
4
+ data.tar.gz: a85d9385d4e7aaad04cfb9948c338066be54b27b
5
5
  SHA512:
6
- metadata.gz: a809c70f16150e9fb6abaffa20bfd56eef33973c104d2157ce3f88858eda9f3e827a62a9f21c80b8d48c3289e514f481d5230e39d598d911812b1edad2fccf3c
7
- data.tar.gz: ab177bd909c3a0f467fe099db214934d7a0f4a1489daabe450608b0d92e2191c578ee0d63722c94a443613666b1d6dbc80be9b6c9942e668e27f7c4d20e3ad0c
6
+ metadata.gz: 39845df2b62a2d2d28cd113e228b0d6dc2a9f08e9a4028265e2974fd32dcaafde1bf9b74996e66fd4f589400791be2e0532b14a37e77a81ddd51425da7e19096
7
+ data.tar.gz: 00966d8256cb2d33359e3aa8eb2be226da9884717327f6476f54b315072483dad8e4d077d5b2c21d394e33a139d95c04c70cbdf502cdc9f882ca0ea97cc20450
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+ termodoro-*
15
+ Gemfile.lock
16
+ pkg
17
+
18
+ # YARD artifacts
19
+ .yardoc
20
+ _yardoc
21
+ doc/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ # - "1.8.7"
4
+ - "1.9.2"
5
+ - "1.9.3"
6
+ # - jruby-18mode # JRuby in 1.8 mode
7
+ - jruby-19mode # JRuby in 1.9 mode
8
+ # - rbx-18mode
9
+ - rbx-19mode
10
+ # uncomment this line if your project needs to run something other than `rake`:
11
+ # script: bundle exec rspec spec
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ ### 0.2.5 (10/29/2013)
2
+
3
+ * Integrate Travis CI. Add Bundler and Rake. Add License. Minor changes to gemspec file. Add this changelog file.
4
+
5
+ ### 0.2.0 (10/29/2013)
6
+
7
+ * Adds [@scottcreynold](https://github.com/scottcreynolds)'s feature which allows for omitting the message. Also includes the first tests. - [@vcavallo](http://github.com/vcavallo)
8
+
9
+ ### 0.1.9 (10/24/2013)
10
+
11
+ * First working public release. - [@vcavallo](http://github.com/vcavallo)
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem "rspec"
6
+ gem "terminal-notifier"
7
+ gem "rake"
data/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # Termodoro
2
+
3
+ ## What is this?
4
+
5
+ ***Termodoro*** is an ultra-simple, frictionless BASH reminder / pomodoro timer ( in fact it's portmanteau of *terminal* and *[pomodoro](http://en.wikipedia.org/wiki/Pomodoro_Technique)* )
6
+ You pass it an amount of time and a message. After the specified amount of time elapses the message pops up. *Simple!*
7
+
8
+ ## Why would I use this?
9
+
10
+ Maybe you're hard at work coding and you realize that there's something you need to do in 10 minutes… Rather than try to remember on your own or risk derailing your excellent programming groove by firing up a bulky reminder app, just enter a simple command into your terminal (where you're probably staring anyway). Hit enter and quickly get back to what you were doing!
11
+
12
+ Perhaps you're pair-programming and you want to switch roles in a given amount of time… Throw a quick command in between `cd`s and `ls`s and be on your way. Zero distractions.
13
+
14
+ You're already busy. Don't also be forgetful.
15
+ Too often I avoid setting a simple reminder because I don't want to interrupt my current flow - that shouldn't be a thing, and now it doesn't have to be.
16
+
17
+ ## Useage
18
+
19
+ -----
20
+
21
+ ### Install:
22
+
23
+ `gem install termodoro`
24
+
25
+ ### Use:
26
+
27
+ `termodoro 40 minutes switch pairs`
28
+ `termodoro 5m make a commit`
29
+ `termodoro 1 hr remember to eat`
30
+ `termodoro 10 seconds test termodoro`
31
+
32
+ ..etc...
33
+
34
+ -----
35
+
36
+ ## A gentle warning…
37
+
38
+ This is the first gem I've built. I do not claim that it is perfect, nor that it follows best practices, nor that it is perfectly secure. Use at your own risk and feel free to fork this repo and improve any flaws you encounter. I'm wide open to suggestions for features as well.
39
+
40
+ ## Things I need to do:
41
+
42
+ - The biggest one:
43
+ - ~~[Make it a gem!](https://rubygems.org/gems/termodoro)~~
44
+ - After that:
45
+ - ~~Object-Orient (shame on me.) / Actually think about design.~~
46
+ - ~~Instead of getting input from `gets`, the duration and message should be able to be passed in as flags/options (I need to figure out the difference.)~~
47
+ - set defaults to something agreeable (like maybe 20 minutes and some generic 'do that thing you wanted to do' message) such that you could just do `termodoro` and it'll do that default.
48
+ - Make it useable in other shells and without the terminal-notifier gem.
49
+ - Sanitize the message so as to not cause bash issues
50
+ - Write good tests!
51
+ - Make sure to follow gem best-practices
52
+ - A bunch of other stuff I'll add here
53
+ - Make sure it persists through computer sleep
54
+ - Make sure I'm using ARGV properly and issuing the system command properly
55
+ - Generally revise to adhere to best practices.
56
+
57
+ ## Upcoming features:
58
+
59
+ - set your own global defaults and shortcuts
60
+ - option to set a reminder to repeat
61
+ - other stuff.. don't want it to get bloated though.
62
+
63
+ -----
64
+
65
+ ## Contributing:
66
+
67
+ You know the drill, right?
68
+
69
+ * Fork.
70
+ * Topic branches make puppies smile.
71
+ * Make your feature addition or bug fix and be sure to include tests.
72
+ * Update the CHANGELOG.md.
73
+ * Send a pull request.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ require 'rubygems'
2
+ require 'bundler/gem_tasks'
3
+ require 'rspec/core'
4
+ require 'rspec/core/rake_task'
5
+
6
+ Bundler.setup(:default, :development)
7
+
8
+ RSpec::Core::RakeTask.new(:spec) do |spec|
9
+ spec.pattern = FileList['spec/**/*_spec.rb']
10
+ end
11
+
12
+ task :default => :spec
data/bin/termodoro CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'termodoro'
3
+ require_relative '../config/environment'
4
+ # require 'termodoro'
4
5
 
5
6
  a = Termodoro.new(ARGV.join(" "))
6
7
  exec(a.command)
@@ -0,0 +1 @@
1
+ require_relative '../lib/termodoro/termodoro'
@@ -12,8 +12,14 @@ class Termodoro
12
12
  # title on/off -- probably going to drop this
13
13
  end
14
14
 
15
+ # parse class
16
+ # Parse.new(input)
17
+ #
18
+ # calculate class
19
+ # run clean_message
20
+
15
21
  def parse_time_part
16
- segment = @arguments.scan(/[\D]+[^\w]/).first.split(" ").first
22
+ segment = @arguments.match(/\D+/)[0].split(' ').first
17
23
  self.time_part = segment
18
24
  #=> hours/minutes/seconds, etc.
19
25
  end
@@ -26,8 +32,8 @@ class Termodoro
26
32
 
27
33
  def parse_message
28
34
  # .split(/[\d]+.[\w]+/).last
29
- parsed_message = @arguments.split(/^\s*[\d]+\s*[\w]+/).last.strip
30
- self.message = parsed_message
35
+ parsed_message = @arguments.split(/^\s*[\d]+\s*[\w]+/).last || 'Termodoro'
36
+ self.message = parsed_message.strip
31
37
  end
32
38
 
33
39
  def calculate_time
@@ -38,7 +44,7 @@ class Termodoro
38
44
  elsif seconds?
39
45
  seconds = parse_number_part
40
46
  end
41
-
47
+
42
48
  seconds #=> returns seconds
43
49
  end
44
50
 
@@ -69,8 +75,9 @@ class Termodoro
69
75
  def command
70
76
  # title = "title" -- leaving off title for now.
71
77
  # if title on/off call one or the other
72
-
73
- "sleep #{calculate_time} && terminal-notifier -message '#{parse_message}' -title 'Termodoro' & disown"
78
+ time_part = calculate_time
79
+ msg_part = parse_message
80
+ "sleep #{time_part} && terminal-notifier -message '#{msg_part}' -title 'Termodoro' & disown"
74
81
  #=> return the fully-formed command string for Bash
75
82
  end
76
83
 
data/license.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Vinney Cavallo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all 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,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ require_relative '../config/environment.rb'
2
+ # This file was generated by the `rspec --init` command. Conventionally, all
3
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
4
+ # Require this file using `require "spec_helper"` to ensure that it is only
5
+ # loaded once.
6
+ #
7
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
8
+ RSpec.configure do |config|
9
+ config.treat_symbols_as_metadata_keys_with_true_values = true
10
+ config.run_all_when_everything_filtered = true
11
+ config.filter_run :focus
12
+
13
+ # Run specs in random order to surface order dependencies. If you find an
14
+ # order dependency and want to debug it, you can fix the order by providing
15
+ # the seed, which is printed after each run.
16
+ # --seed 1234
17
+ config.order = 'random'
18
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'spec_helper'
2
+
3
+ describe "Termodoro" do
4
+ it "takes a well-formed time and message string" do
5
+ arg = "10 seconds do something"
6
+ term = Termodoro.new(arg)
7
+ term.command.should be_an_instance_of(String)
8
+ end
9
+
10
+ it "allows the message to be optional" do
11
+ arg = "10 seconds"
12
+ term = Termodoro.new(arg)
13
+ term.command.should be_an_instance_of(String)
14
+ end
15
+ end
data/termodoro.gemspec ADDED
@@ -0,0 +1,17 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'termodoro'
3
+ s.version = '0.2.5'
4
+ s.date = '2013-10-24'
5
+ s.summary = "A lightweight CL reminder app"
6
+ s.description = "Use this little utility to set simple reminders from the command line. See the github page below for more information"
7
+ s.authors = ["Vinney Cavallo"]
8
+ s.email = 'vcavallo@gmail.com'
9
+ s.files = `git ls-files`.split("\n")
10
+ s.executables << 'termodoro'
11
+ s.add_runtime_dependency "terminal-notifier"
12
+ s.homepage =
13
+ 'https://github.com/vcavallo/termodoro'
14
+ s.license = 'MIT'
15
+
16
+ s.add_development_dependency 'rspec'
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termodoro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vinney Cavallo
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: Use this little utility to set simple reminders from the command line.
28
42
  See the github page below for more information
29
43
  email: vcavallo@gmail.com
@@ -32,9 +46,20 @@ executables:
32
46
  extensions: []
33
47
  extra_rdoc_files: []
34
48
  files:
35
- - lib/termodoro.rb
36
- - lib/run.rb
49
+ - .gitignore
50
+ - .rspec
51
+ - .travis.yml
52
+ - CHANGELOG.md
53
+ - Gemfile
54
+ - README.md
55
+ - Rakefile
37
56
  - bin/termodoro
57
+ - config/environment.rb
58
+ - lib/termodoro/termodoro.rb
59
+ - license.md
60
+ - spec/spec_helper.rb
61
+ - spec/termodoro_spec.rb
62
+ - termodoro.gemspec
38
63
  homepage: https://github.com/vcavallo/termodoro
39
64
  licenses:
40
65
  - MIT
data/lib/run.rb DELETED
@@ -1,7 +0,0 @@
1
- require_relative './lib/termodoro'
2
-
3
- class Run
4
- def self.execute(input)
5
- a = Termodoro.new(input)
6
- exec(a.command)
7
- end