task_time 0.0.1.pre.alpha → 0.0.1.pre.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -3
- data/.ruby-version +1 -1
- data/Gemfile +4 -0
- data/bin/task_time +85 -1
- data/lib/task_time/helpers.rb +18 -0
- data/lib/task_time/version.rb +1 -1
- data/lib/task_time.rb +14 -28
- data/sample.task_time_rc.yaml +41 -0
- data/task_time.gemspec +2 -1
- metadata +7 -6
- data/Gemfile.lock +0 -106
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 187bec98557e2c146473a696f19fee26e577ebd3
|
4
|
+
data.tar.gz: 901e0236d23a991d492c4830dbe687ddc50331b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d14cffd0267efa4b972edee01507f3a96d0b1dd3122175985ecaabdeda074ed235e2f96cf6d5096c9c5610e71e3cd7419fecdf4397fc0902699d2a71eeb3bdd0
|
7
|
+
data.tar.gz: ff273d2cdc61dfd91533787d897e06f186de9981df3311a6ca51de5d65efff5f75b4a9f6f631e6201fc4caf914d09b7474a26ceeb9b6faeb152349ad741fdd37
|
data/.gitignore
CHANGED
@@ -26,9 +26,9 @@ build/
|
|
26
26
|
|
27
27
|
# for a library or gem, you might want to ignore these files since the code is
|
28
28
|
# intended to run in multiple environments; otherwise, check them in:
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
Gemfile.lock
|
30
|
+
.ruby-version
|
31
|
+
.ruby-gemset
|
32
32
|
|
33
33
|
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
34
|
.rvmrc
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.2.2
|
data/Gemfile
CHANGED
data/bin/task_time
CHANGED
@@ -1,5 +1,89 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'gli'
|
3
4
|
require_relative "../lib/task_time"
|
4
5
|
|
5
|
-
|
6
|
+
include GLI::App
|
7
|
+
|
8
|
+
program_desc "An addon to TaskWarrior that allows time tracking and reporting"
|
9
|
+
|
10
|
+
version TaskTime::VERSION
|
11
|
+
|
12
|
+
subcommand_option_handling :normal
|
13
|
+
arguments :strict
|
14
|
+
|
15
|
+
# desc 'Describe some switch here'
|
16
|
+
# switch [:s,:switch]
|
17
|
+
|
18
|
+
desc 'Specify where the task_time config file is located'
|
19
|
+
arg 'config', :optional
|
20
|
+
default_value File.join(ENV['HOME'], '.task_time_rc.yaml')
|
21
|
+
flag [:c, :config]
|
22
|
+
|
23
|
+
desc "Start a timer on the specified task"
|
24
|
+
arg_name 'Describe arguments to start here'
|
25
|
+
command :start do |c|
|
26
|
+
c.desc 'Describe a switch to start'
|
27
|
+
c.switch :s
|
28
|
+
|
29
|
+
c.desc 'Describe a flag to start'
|
30
|
+
c.default_value 'default'
|
31
|
+
c.flag :f
|
32
|
+
c.action do |global_options,options,args|
|
33
|
+
|
34
|
+
# Your command logic here
|
35
|
+
|
36
|
+
# If you have any errors, just raise them
|
37
|
+
# raise "that command made no sense"
|
38
|
+
|
39
|
+
puts "start command ran"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Stop the timer on the specified task"
|
44
|
+
arg_name 'Describe arguments to stop here'
|
45
|
+
command :stop do |c|
|
46
|
+
c.action do |global_options,options,args|
|
47
|
+
puts "stop command ran"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
desc 'Describe toggle here'
|
52
|
+
arg_name 'Describe arguments to toggle here'
|
53
|
+
command :toggle do |c|
|
54
|
+
c.action do |global_options,options,args|
|
55
|
+
puts "toggle command ran"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
desc 'Describe report here'
|
60
|
+
arg_name 'Describe arguments to report here'
|
61
|
+
command :report do |c|
|
62
|
+
c.action do |global_options,options,args|
|
63
|
+
puts "report command ran"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
pre do |global,command,options,args|
|
68
|
+
# Pre logic here
|
69
|
+
# Return true to proceed; false to abort and not call the
|
70
|
+
# chosen command
|
71
|
+
# Use skips_pre before a command to skip this block
|
72
|
+
# on that command only
|
73
|
+
$tt = TaskTime::TT.new(global[:config])
|
74
|
+
true
|
75
|
+
end
|
76
|
+
|
77
|
+
post do |global,command,options,args|
|
78
|
+
# Post logic here
|
79
|
+
# Use skips_post before a command to skip this
|
80
|
+
# block on that command only
|
81
|
+
end
|
82
|
+
|
83
|
+
on_error do |exception|
|
84
|
+
# Error logic here
|
85
|
+
# return false to skip default error handling
|
86
|
+
true
|
87
|
+
end
|
88
|
+
|
89
|
+
exit run(ARGV)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module TaskTime
|
4
|
+
|
5
|
+
module Helpers
|
6
|
+
# make this module a stateless, singleton
|
7
|
+
extend self
|
8
|
+
|
9
|
+
# Read a configuration file into a hash and merge it with a default hash
|
10
|
+
def read_config file_path, defaults=TaskTime::DEFAULTS
|
11
|
+
if File.exists? file_path
|
12
|
+
config = YAML.load_file(file_path)
|
13
|
+
defaults = defaults.merge(config)
|
14
|
+
end
|
15
|
+
defaults
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/task_time/version.rb
CHANGED
data/lib/task_time.rb
CHANGED
@@ -1,37 +1,23 @@
|
|
1
1
|
require_relative "task_time/version"
|
2
|
-
|
2
|
+
require_relative "task_time/helpers"
|
3
|
+
require "gli"
|
4
|
+
require "rtasklib"
|
3
5
|
|
4
6
|
module TaskTime
|
7
|
+
DEFAULTS = {
|
8
|
+
task_data: "#{Dir.home}/.task"
|
9
|
+
}
|
5
10
|
|
6
|
-
|
11
|
+
UDAS = [ "timestamps", "time-spent", "time-est",
|
12
|
+
"time-prog", "progress", "client" ]
|
7
13
|
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
|
12
|
-
desc "stop", "Stop the timer on the specified task"
|
13
|
-
def stop(filter)
|
14
|
-
end
|
15
|
-
|
16
|
-
desc "toggle", ""
|
17
|
-
def toggle(filter)
|
18
|
-
end
|
19
|
-
|
20
|
-
desc "edit", ""
|
21
|
-
def edit(filter)
|
22
|
-
end
|
23
|
-
|
24
|
-
desc "modify", ""
|
25
|
-
def modify(filter)
|
26
|
-
end
|
14
|
+
class TT
|
15
|
+
attr_accessor :config, :tw
|
27
16
|
|
28
|
-
|
29
|
-
|
17
|
+
def initialize config
|
18
|
+
@config = Helpers.read_config(config)
|
19
|
+
@tw = Rtasklib::TW.new(config["data_location"])
|
20
|
+
puts tw.all
|
30
21
|
end
|
31
|
-
|
32
|
-
desc "export", ""
|
33
|
-
def export(filter, format)
|
34
|
-
end
|
35
|
-
|
36
22
|
end
|
37
23
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# This example shows all default options that mean something to task_time
|
2
|
+
# Arbitrary configs set here will be available in the custom reports
|
3
|
+
#
|
4
|
+
# Configure TaskWarrior so rtasklib knows where to look for your data
|
5
|
+
task_data: "~/.task"
|
6
|
+
|
7
|
+
# Set global defaults for generating billing reports
|
8
|
+
currency_marker: "$"
|
9
|
+
hourly_rate: "50"
|
10
|
+
rounding?: true
|
11
|
+
rounding_minutes: 15
|
12
|
+
|
13
|
+
# describe yourself
|
14
|
+
you:
|
15
|
+
first_name: "Will"
|
16
|
+
middle_name: "Henry"
|
17
|
+
last_name: "Paul"
|
18
|
+
|
19
|
+
address: "847 Coopers Dr"
|
20
|
+
city: "Rochester"
|
21
|
+
state: "Minnesota"
|
22
|
+
zip: "14892"
|
23
|
+
|
24
|
+
# describe your clients, note that you can override global defaults on a
|
25
|
+
# per client basis
|
26
|
+
clients:
|
27
|
+
- sample_client:
|
28
|
+
client_name: "Company, inc."
|
29
|
+
contact_first_name: "John"
|
30
|
+
contact_last_name: "Smith"
|
31
|
+
|
32
|
+
address: "847 Coopers Dr"
|
33
|
+
city: "Rochester"
|
34
|
+
state: "Minnesota"
|
35
|
+
zip: "14892"
|
36
|
+
|
37
|
+
hourly_rate: "25"
|
38
|
+
|
39
|
+
projects:
|
40
|
+
- "RMA"
|
41
|
+
- "SYN"
|
data/task_time.gemspec
CHANGED
@@ -18,8 +18,9 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "thor"
|
21
|
+
# spec.add_dependency "thor"
|
22
22
|
spec.add_dependency "rtasklib"
|
23
|
+
spec.add_dependency "gli"
|
23
24
|
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.7"
|
25
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: task_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.pre.
|
4
|
+
version: 0.0.1.pre.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rtasklib
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: gli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -153,7 +153,6 @@ files:
|
|
153
153
|
- ".ruby-version"
|
154
154
|
- ".travis.yml"
|
155
155
|
- Gemfile
|
156
|
-
- Gemfile.lock
|
157
156
|
- Guardfile
|
158
157
|
- LICENSE
|
159
158
|
- README.md
|
@@ -162,7 +161,9 @@ files:
|
|
162
161
|
- bin/setup
|
163
162
|
- bin/task_time
|
164
163
|
- lib/task_time.rb
|
164
|
+
- lib/task_time/helpers.rb
|
165
165
|
- lib/task_time/version.rb
|
166
|
+
- sample.task_time_rc.yaml
|
166
167
|
- spec/spec_helper.rb
|
167
168
|
- spec/task_time_spec.rb
|
168
169
|
- task_time.gemspec
|
@@ -186,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
187
|
version: 1.3.1
|
187
188
|
requirements: []
|
188
189
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.
|
190
|
+
rubygems_version: 2.4.5
|
190
191
|
signing_key:
|
191
192
|
specification_version: 4
|
192
193
|
summary: A taskwarrior plugin that adds time tracking and reporting features.
|
data/Gemfile.lock
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
task_time (0.0.1)
|
5
|
-
rtasklib
|
6
|
-
thor
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
celluloid (0.16.0)
|
12
|
-
timers (~> 4.0.0)
|
13
|
-
coderay (1.1.0)
|
14
|
-
coveralls (0.7.11)
|
15
|
-
multi_json (~> 1.10)
|
16
|
-
rest-client (>= 1.6.8, < 2)
|
17
|
-
simplecov (~> 0.9.1)
|
18
|
-
term-ansicolor (~> 1.3)
|
19
|
-
thor (~> 0.19.1)
|
20
|
-
diff-lcs (1.2.5)
|
21
|
-
docile (1.1.5)
|
22
|
-
ffi (1.9.6)
|
23
|
-
formatador (0.2.5)
|
24
|
-
guard (2.12.4)
|
25
|
-
formatador (>= 0.2.4)
|
26
|
-
listen (~> 2.7)
|
27
|
-
lumberjack (~> 1.0)
|
28
|
-
nenv (~> 0.1)
|
29
|
-
notiffany (~> 0.0)
|
30
|
-
pry (>= 0.9.12)
|
31
|
-
shellany (~> 0.0)
|
32
|
-
thor (>= 0.18.1)
|
33
|
-
guard-compat (1.2.1)
|
34
|
-
guard-rspec (4.5.0)
|
35
|
-
guard (~> 2.1)
|
36
|
-
guard-compat (~> 1.1)
|
37
|
-
rspec (>= 2.99.0, < 4.0)
|
38
|
-
hitimes (1.2.2)
|
39
|
-
listen (2.8.5)
|
40
|
-
celluloid (>= 0.15.2)
|
41
|
-
rb-fsevent (>= 0.9.3)
|
42
|
-
rb-inotify (>= 0.9)
|
43
|
-
lumberjack (1.0.9)
|
44
|
-
method_source (0.8.2)
|
45
|
-
mime-types (2.4.3)
|
46
|
-
multi_json (1.10.1)
|
47
|
-
nenv (0.2.0)
|
48
|
-
netrc (0.10.3)
|
49
|
-
notiffany (0.0.6)
|
50
|
-
nenv (~> 0.1)
|
51
|
-
shellany (~> 0.0)
|
52
|
-
pry (0.10.1)
|
53
|
-
coderay (~> 1.1.0)
|
54
|
-
method_source (~> 0.8.1)
|
55
|
-
slop (~> 3.4)
|
56
|
-
rake (10.4.2)
|
57
|
-
rb-fsevent (0.9.4)
|
58
|
-
rb-inotify (0.9.5)
|
59
|
-
ffi (>= 0.5.0)
|
60
|
-
rest-client (1.7.3)
|
61
|
-
mime-types (>= 1.16, < 3.0)
|
62
|
-
netrc (~> 0.7)
|
63
|
-
rspec (3.2.0)
|
64
|
-
rspec-core (~> 3.2.0)
|
65
|
-
rspec-expectations (~> 3.2.0)
|
66
|
-
rspec-mocks (~> 3.2.0)
|
67
|
-
rspec-core (3.2.1)
|
68
|
-
rspec-support (~> 3.2.0)
|
69
|
-
rspec-expectations (3.2.0)
|
70
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
71
|
-
rspec-support (~> 3.2.0)
|
72
|
-
rspec-mocks (3.2.1)
|
73
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
-
rspec-support (~> 3.2.0)
|
75
|
-
rspec-nc (0.2.0)
|
76
|
-
rspec (>= 2.9)
|
77
|
-
terminal-notifier (>= 1.4)
|
78
|
-
rspec-support (3.2.2)
|
79
|
-
rtasklib (0.1.0)
|
80
|
-
shellany (0.0.1)
|
81
|
-
simplecov (0.9.2)
|
82
|
-
docile (~> 1.1.0)
|
83
|
-
multi_json (~> 1.0)
|
84
|
-
simplecov-html (~> 0.9.0)
|
85
|
-
simplecov-html (0.9.0)
|
86
|
-
slop (3.6.0)
|
87
|
-
term-ansicolor (1.3.0)
|
88
|
-
tins (~> 1.0)
|
89
|
-
terminal-notifier (1.6.2)
|
90
|
-
thor (0.19.1)
|
91
|
-
timers (4.0.1)
|
92
|
-
hitimes
|
93
|
-
tins (1.3.4)
|
94
|
-
|
95
|
-
PLATFORMS
|
96
|
-
ruby
|
97
|
-
|
98
|
-
DEPENDENCIES
|
99
|
-
bundler (~> 1.7)
|
100
|
-
coveralls
|
101
|
-
guard
|
102
|
-
guard-rspec
|
103
|
-
rake (~> 10.0)
|
104
|
-
rspec
|
105
|
-
rspec-nc
|
106
|
-
task_time!
|