hcl 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -0
- data/README.markdown +15 -6
- data/Rakefile +8 -20
- data/bin/hcl +1 -1
- data/lib/hcl.rb +10 -0
- data/lib/hcl/app.rb +1 -29
- data/lib/hcl/commands.rb +7 -0
- data/lib/hcl/day_entry.rb +1 -0
- data/lib/hcl/task.rb +1 -0
- data/lib/hcl/timesheet_resource.rb +15 -0
- data/lib/hcl/version.rb +3 -0
- data/test/test_helper.rb +1 -1
- metadata +36 -12
- data/.document +0 -1
- data/VERSION +0 -1
- data/deps.rip +0 -3
- data/hcl.gemspec +0 -73
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8860d754ce1f11debeb1148da0dfe589df72aff
|
4
|
+
data.tar.gz: 8135fb56ef40b3d6966d31551d842f43182c3192
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dac13754647a2858e99a0d38b276f02e75f0a7140cfb4859f8bfd94231e5b0372865256628ff6c274f7af7162ddc18baf4ac0a5b633063b6bb38d388405ca613
|
7
|
+
data.tar.gz: a4d934b2cb3435cfa90f6caf243f18e4b42a37f428d113044623d6c900750af602182c4b6e54bc73f7b818903881ede611f38c2946774ce90ce7b390990aff0c
|
data/CHANGELOG
CHANGED
data/README.markdown
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Harvest Command Line
|
2
2
|
|
3
3
|
HCl is a command-line tool for interacting with Harvest time sheets using the
|
4
4
|
[Harvest time tracking API][htt].
|
@@ -10,20 +10,23 @@ HCl is a command-line tool for interacting with Harvest time sheets using the
|
|
10
10
|
You can install hcl directly from rubygems.org:
|
11
11
|
|
12
12
|
$ gem install hcl
|
13
|
-
$ hcl show [date]
|
14
13
|
|
15
|
-
or you can install from source
|
14
|
+
or you can install from source:
|
16
15
|
|
17
|
-
$ gem install jeweler
|
18
16
|
$ rake install
|
19
17
|
|
18
|
+
If you're using HCl for the first time, the show command sets up your
|
19
|
+
Harvest credentials:
|
20
|
+
|
21
|
+
$ hcl show
|
22
|
+
|
20
23
|
## Usage
|
21
24
|
|
22
|
-
hcl [start]
|
25
|
+
hcl [start] @<task_alias> [+<time>] [<message>]
|
23
26
|
hcl note <message>
|
24
27
|
hcl stop [message]
|
25
28
|
hcl resume [@<task_alias>]
|
26
|
-
hcl log
|
29
|
+
hcl log @<task_alias> [+<time>] [<message>]
|
27
30
|
hcl show [date]
|
28
31
|
hcl tasks
|
29
32
|
hcl alias <task_alias> <project_id> <task_id>
|
@@ -96,6 +99,12 @@ the same arguments as start:
|
|
96
99
|
|
97
100
|
The above starts and immediately stops a one-hour timer with the given note.
|
98
101
|
|
102
|
+
### Bash Auto-completion of Task Aliases
|
103
|
+
|
104
|
+
You can enable auto-completion of task aliases by adding this to your bashrc:
|
105
|
+
|
106
|
+
eval `hcl completion`
|
107
|
+
|
99
108
|
### Date Formats
|
100
109
|
|
101
110
|
Dates can be expressed in a variety of ways. See the [Chronic documentation][cd]
|
data/Rakefile
CHANGED
@@ -1,27 +1,15 @@
|
|
1
|
-
require '
|
1
|
+
require 'rubygems/tasks'
|
2
|
+
Gem::Tasks.new
|
2
3
|
|
4
|
+
require 'rake/testtask'
|
3
5
|
Rake::TestTask.new do |t|
|
4
6
|
t.libs << 'test'
|
5
7
|
t.test_files = FileList['test/*_test.rb']
|
6
8
|
end
|
9
|
+
task :default => :test
|
7
10
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
gem.name = "hcl"
|
12
|
-
gem.summary = "Harvest timesheets from the command-line"
|
13
|
-
gem.description = "HCl is a command-line client for manipulating Harvest time sheets."
|
14
|
-
gem.email = "zack@zackhobson.com"
|
15
|
-
gem.homepage = "http://github.com/zenhob/hcl"
|
16
|
-
gem.authors = ["Zack Hobson"]
|
17
|
-
gem.license = "MIT"
|
18
|
-
gem.add_dependency "trollop"
|
19
|
-
gem.add_dependency "chronic"
|
20
|
-
gem.add_dependency "highline"
|
21
|
-
gem.add_development_dependency "shoulda"
|
22
|
-
gem.add_development_dependency "mocha"
|
23
|
-
end
|
24
|
-
Jeweler::GemcutterTasks.new
|
25
|
-
rescue LoadError
|
26
|
-
puts "Jeweler not available. Install it with: sudo gem install jeweler"
|
11
|
+
require 'yard'
|
12
|
+
YARD::Rake::YardocTask.new do |t|
|
13
|
+
t.options = %w[--files CHANGELOG]
|
27
14
|
end
|
15
|
+
|
data/bin/hcl
CHANGED
data/lib/hcl.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
module HCl
|
2
|
+
autoload :VERSION, 'hcl/version'
|
3
|
+
autoload :App, 'hcl/app'
|
4
|
+
autoload :Commands, 'hcl/commands'
|
5
|
+
autoload :TimesheetResource, 'hcl/timesheet_resource'
|
6
|
+
autoload :Utility, 'hcl/utility'
|
7
|
+
autoload :Project, 'hcl/project'
|
8
|
+
autoload :Task, 'hcl/task'
|
9
|
+
autoload :DayEntry, 'hcl/day_entry'
|
10
|
+
end
|
data/lib/hcl/app.rb
CHANGED
@@ -1,38 +1,10 @@
|
|
1
|
-
## stdlib dependencies
|
2
1
|
require 'yaml'
|
3
|
-
require 'rexml/document'
|
4
|
-
require 'net/http'
|
5
|
-
require 'net/https'
|
6
2
|
require 'fileutils'
|
7
3
|
|
8
|
-
## gem dependencies
|
9
|
-
require 'chronic'
|
10
4
|
require 'trollop'
|
11
|
-
require 'highline
|
12
|
-
|
13
|
-
## app dependencies
|
14
|
-
require 'hcl/utility'
|
15
|
-
require 'hcl/commands'
|
16
|
-
require 'hcl/timesheet_resource'
|
17
|
-
require 'hcl/project'
|
18
|
-
require 'hcl/task'
|
19
|
-
require 'hcl/day_entry'
|
20
|
-
|
21
|
-
# Workaround for annoying SSL warning:
|
22
|
-
# >> warning: peer certificate won't be verified in this SSL session
|
23
|
-
# http://www.5dollarwhitebox.org/drupal/node/64
|
24
|
-
class Net::HTTP
|
25
|
-
alias_method :old_initialize, :initialize
|
26
|
-
def initialize(*args)
|
27
|
-
old_initialize(*args)
|
28
|
-
@ssl_context = OpenSSL::SSL::SSLContext.new
|
29
|
-
@ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
30
|
-
end
|
31
|
-
end
|
5
|
+
require 'highline'
|
32
6
|
|
33
7
|
module HCl
|
34
|
-
VERSION = "0.4.3"
|
35
|
-
|
36
8
|
class App
|
37
9
|
include HCl::Utility
|
38
10
|
include HCl::Commands
|
data/lib/hcl/commands.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'chronic'
|
2
|
+
require 'highline'
|
3
|
+
|
1
4
|
module HCl
|
2
5
|
module Commands
|
3
6
|
def tasks
|
@@ -62,6 +65,10 @@ module HCl
|
|
62
65
|
end
|
63
66
|
end
|
64
67
|
|
68
|
+
def completion
|
69
|
+
%[complete -W "#{aliases.join ' '}" hcl]
|
70
|
+
end
|
71
|
+
|
65
72
|
def aliases
|
66
73
|
@settings.keys.select { |s| s =~ /^task\./ }.map { |s| "@"+s.slice(5..-1) }
|
67
74
|
end
|
data/lib/hcl/day_entry.rb
CHANGED
data/lib/hcl/task.rb
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'net/https'
|
3
|
+
|
4
|
+
# Workaround for annoying SSL warning:
|
5
|
+
# >> warning: peer certificate won't be verified in this SSL session
|
6
|
+
# http://www.5dollarwhitebox.org/drupal/node/64
|
7
|
+
class Net::HTTP
|
8
|
+
alias_method :old_initialize, :initialize
|
9
|
+
def initialize(*args)
|
10
|
+
old_initialize(*args)
|
11
|
+
@ssl_context = OpenSSL::SSL::SSLContext.new
|
12
|
+
@ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
1
16
|
module HCl
|
2
17
|
class TimesheetResource
|
3
18
|
class Failure < StandardError; end
|
data/lib/hcl/version.rb
ADDED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hcl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zack Hobson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trollop
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubygems-tasks
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: shoulda
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,25 +94,33 @@ dependencies:
|
|
80
94
|
- - '>='
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: yard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
description: HCl is a command-line client for manipulating Harvest time sheets.
|
84
112
|
email: zack@zackhobson.com
|
85
113
|
executables:
|
86
114
|
- hcl
|
87
115
|
extensions: []
|
88
|
-
extra_rdoc_files:
|
89
|
-
- LICENSE
|
90
|
-
- README.markdown
|
116
|
+
extra_rdoc_files: []
|
91
117
|
files:
|
92
|
-
- .document
|
93
118
|
- CHANGELOG
|
94
|
-
- HACKING.markdown
|
95
119
|
- LICENSE
|
96
|
-
- README.markdown
|
97
120
|
- Rakefile
|
98
|
-
-
|
121
|
+
- HACKING.markdown
|
122
|
+
- README.markdown
|
99
123
|
- bin/hcl
|
100
|
-
- deps.rip
|
101
|
-
- hcl.gemspec
|
102
124
|
- lib/hcl/app.rb
|
103
125
|
- lib/hcl/commands.rb
|
104
126
|
- lib/hcl/day_entry.rb
|
@@ -106,11 +128,13 @@ files:
|
|
106
128
|
- lib/hcl/task.rb
|
107
129
|
- lib/hcl/timesheet_resource.rb
|
108
130
|
- lib/hcl/utility.rb
|
131
|
+
- lib/hcl/version.rb
|
132
|
+
- lib/hcl.rb
|
109
133
|
- test/app_test.rb
|
110
134
|
- test/day_entry_test.rb
|
111
135
|
- test/test_helper.rb
|
112
136
|
- test/utility_test.rb
|
113
|
-
homepage: http://
|
137
|
+
homepage: http://zackhobson.com/hcl/
|
114
138
|
licenses:
|
115
139
|
- MIT
|
116
140
|
metadata: {}
|
data/.document
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--files CHANGELOG
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.4.3
|
data/deps.rip
DELETED
data/hcl.gemspec
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = "hcl"
|
8
|
-
s.version = "0.4.3"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Zack Hobson"]
|
12
|
-
s.date = "2013-11-19"
|
13
|
-
s.description = "HCl is a command-line client for manipulating Harvest time sheets."
|
14
|
-
s.email = "zack@zackhobson.com"
|
15
|
-
s.executables = ["hcl"]
|
16
|
-
s.extra_rdoc_files = [
|
17
|
-
"LICENSE",
|
18
|
-
"README.markdown"
|
19
|
-
]
|
20
|
-
s.files = [
|
21
|
-
".document",
|
22
|
-
"CHANGELOG",
|
23
|
-
"HACKING.markdown",
|
24
|
-
"LICENSE",
|
25
|
-
"README.markdown",
|
26
|
-
"Rakefile",
|
27
|
-
"VERSION",
|
28
|
-
"bin/hcl",
|
29
|
-
"deps.rip",
|
30
|
-
"hcl.gemspec",
|
31
|
-
"lib/hcl/app.rb",
|
32
|
-
"lib/hcl/commands.rb",
|
33
|
-
"lib/hcl/day_entry.rb",
|
34
|
-
"lib/hcl/project.rb",
|
35
|
-
"lib/hcl/task.rb",
|
36
|
-
"lib/hcl/timesheet_resource.rb",
|
37
|
-
"lib/hcl/utility.rb",
|
38
|
-
"test/app_test.rb",
|
39
|
-
"test/day_entry_test.rb",
|
40
|
-
"test/test_helper.rb",
|
41
|
-
"test/utility_test.rb"
|
42
|
-
]
|
43
|
-
s.homepage = "http://github.com/zenhob/hcl"
|
44
|
-
s.licenses = ["MIT"]
|
45
|
-
s.require_paths = ["lib"]
|
46
|
-
s.rubygems_version = "2.0.3"
|
47
|
-
s.summary = "Harvest timesheets from the command-line"
|
48
|
-
|
49
|
-
if s.respond_to? :specification_version then
|
50
|
-
s.specification_version = 4
|
51
|
-
|
52
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
53
|
-
s.add_runtime_dependency(%q<trollop>, [">= 0"])
|
54
|
-
s.add_runtime_dependency(%q<chronic>, [">= 0"])
|
55
|
-
s.add_runtime_dependency(%q<highline>, [">= 0"])
|
56
|
-
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
57
|
-
s.add_development_dependency(%q<mocha>, [">= 0"])
|
58
|
-
else
|
59
|
-
s.add_dependency(%q<trollop>, [">= 0"])
|
60
|
-
s.add_dependency(%q<chronic>, [">= 0"])
|
61
|
-
s.add_dependency(%q<highline>, [">= 0"])
|
62
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
63
|
-
s.add_dependency(%q<mocha>, [">= 0"])
|
64
|
-
end
|
65
|
-
else
|
66
|
-
s.add_dependency(%q<trollop>, [">= 0"])
|
67
|
-
s.add_dependency(%q<chronic>, [">= 0"])
|
68
|
-
s.add_dependency(%q<highline>, [">= 0"])
|
69
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
70
|
-
s.add_dependency(%q<mocha>, [">= 0"])
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|