hcl 0.4.13 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +5 -0
- data/README.markdown +9 -1
- data/Rakefile +7 -0
- data/lib/hcl/app.rb +1 -2
- data/lib/hcl/harvest_middleware.rb +1 -1
- data/lib/hcl/net.rb +2 -3
- data/lib/hcl/version.rb +1 -1
- data/man/hcl.1 +2 -2
- data/test/app_test.rb +1 -1
- data/test/net_test.rb +0 -1
- data/test/test_helper.rb +1 -2
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fbbcf4c5e000a50c1543411c0077e55d8b4cb1b
|
4
|
+
data.tar.gz: 1b3853aa178ef5b8cd40f55e00a5bc8fc084a6ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20f0adb8c4324efd9f459aa974d2b18b7dc49c5248dd6d3665efb2a7a56ce8a94beb2f30b1a6b76564b7ddd878d1247f29977f589c3368cd581c8a4a7673aaf1
|
7
|
+
data.tar.gz: 321aa709d99680d1d3c9f17bf1345a16098110c4157604fdc39dd2efec593f300048f89b812e5e9639b8179d3c3796e40356b2038d467855ee88be007c49a42c
|
data/CHANGELOG.markdown
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Recent Changes in HCl
|
2
2
|
|
3
|
+
## v0.4.14 2014-04-21
|
4
|
+
|
5
|
+
* remove the non-SSL option as it's no longer needed, closes #57
|
6
|
+
* add a dependency on `gem-man` and instructions for use
|
7
|
+
|
3
8
|
## v0.4.13 2014-02-04
|
4
9
|
|
5
10
|
* oops, fixed a syntax error that was accidentally committed before release!
|
data/README.markdown
CHANGED
@@ -21,6 +21,14 @@ or you can install from source:
|
|
21
21
|
|
22
22
|
rake install
|
23
23
|
|
24
|
+
Once installed, you can view this README as a man page:
|
25
|
+
|
26
|
+
gem man hcl
|
27
|
+
|
28
|
+
I recommend aliasing your `man` command to additionally load gem man pages:
|
29
|
+
|
30
|
+
alias man="gem man -ls"
|
31
|
+
|
24
32
|
## SYNOPSIS
|
25
33
|
|
26
34
|
hcl [start] @<task_alias> [+<time>] [<message>]
|
@@ -114,7 +122,7 @@ the same arguments as start:
|
|
114
122
|
|
115
123
|
The above starts and immediately stops a one-hour timer with the given note.
|
116
124
|
|
117
|
-
##
|
125
|
+
## ADVANCED USAGE
|
118
126
|
|
119
127
|
### Bash Auto-completion of Task Aliases
|
120
128
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
require 'rubygems/tasks'
|
2
2
|
Gem::Tasks.new
|
3
3
|
|
4
|
+
# I am dumb and keep forgetting to update the bundle before releasing
|
5
|
+
task :update_bundle do
|
6
|
+
system("bundle")
|
7
|
+
system("git ci -am 'update gemfile.lock'")
|
8
|
+
end
|
9
|
+
task :release => :update_bundle
|
10
|
+
|
4
11
|
require 'fileutils'
|
5
12
|
task :clean do
|
6
13
|
FileUtils.rm_rf %w[ pkg coverage doc man/hcl.1 ]
|
data/lib/hcl/app.rb
CHANGED
@@ -169,7 +169,6 @@ EOM
|
|
169
169
|
config['login'] = ask("Email Address: ").to_s
|
170
170
|
config['password'] = ask("Password: ") { |q| q.echo = false }.to_s
|
171
171
|
config['subdomain'] = ask("Subdomain: ").to_s
|
172
|
-
config['ssl'] = /^y/.match(ask("Use SSL? (y/n): ").downcase)
|
173
172
|
@http = HCl::Net.new config
|
174
173
|
write_config config
|
175
174
|
end
|
@@ -209,7 +208,7 @@ EOM
|
|
209
208
|
end
|
210
209
|
|
211
210
|
def has_security_command?
|
212
|
-
if @has_security.nil?
|
211
|
+
if @has_security.nil?
|
213
212
|
@has_security = File.exists?('/usr/bin/security') &&
|
214
213
|
(`/usr/bin/security error 1` =~ /CSSM_ERRCODE_INTERNAL_ERROR/)
|
215
214
|
else
|
@@ -25,7 +25,7 @@ class HCl::HarvestMiddleware < Faraday::Request::BasicAuthentication
|
|
25
25
|
env[:body]
|
26
26
|
end
|
27
27
|
when 300..399
|
28
|
-
raise Failure, "Redirected!
|
28
|
+
raise Failure, "Redirected!"
|
29
29
|
when 400..499
|
30
30
|
raise AuthFailure, "Login failed."
|
31
31
|
when 503
|
data/lib/hcl/net.rb
CHANGED
@@ -4,7 +4,7 @@ require 'faraday'
|
|
4
4
|
module HCl
|
5
5
|
class Net
|
6
6
|
# configuration accessors
|
7
|
-
CONFIG_VARS = [ :login, :password, :subdomain
|
7
|
+
CONFIG_VARS = [ :login, :password, :subdomain ].freeze.
|
8
8
|
each { |config_var| attr_reader config_var }
|
9
9
|
|
10
10
|
def config_hash
|
@@ -15,9 +15,8 @@ module HCl
|
|
15
15
|
@login = opts['login'].freeze
|
16
16
|
@password = opts['password'].freeze
|
17
17
|
@subdomain = opts['subdomain'].freeze
|
18
|
-
@ssl = !!opts['ssl']
|
19
18
|
@http = Faraday.new(
|
20
|
-
"
|
19
|
+
"https://#{subdomain}.harvestapp.com"
|
21
20
|
) do |f|
|
22
21
|
f.use :harvest, login, password
|
23
22
|
f.adapter Faraday.default_adapter
|
data/lib/hcl/version.rb
CHANGED
data/man/hcl.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "HCL" "1" "
|
4
|
+
.TH "HCL" "1" "April 2014" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBhcl\fR \- Track time with Harvest time sheets
|
@@ -157,7 +157,7 @@ hcl log @xdev +1 Worked for an hour\.
|
|
157
157
|
.P
|
158
158
|
The above starts and immediately stops a one\-hour timer with the given note\.
|
159
159
|
.
|
160
|
-
.SH "
|
160
|
+
.SH "ADVANCED USAGE"
|
161
161
|
.
|
162
162
|
.SS "Bash Auto\-completion of Task Aliases"
|
163
163
|
You can enable auto\-completion of task aliases by adding this to your shell configuration (note the backticks inside the double quotes):
|
data/test/app_test.rb
CHANGED
@@ -50,7 +50,7 @@ class AppTest < HCl::TestCase
|
|
50
50
|
app = HCl::App.new
|
51
51
|
configured = states('configured').starts_as(false)
|
52
52
|
app.expects(:show).raises(HCl::HarvestMiddleware::AuthFailure).when(configured.is(false))
|
53
|
-
app.expects(:ask).returns('xxx').times(
|
53
|
+
app.expects(:ask).returns('xxx').times(3).when(configured.is(false))
|
54
54
|
app.expects(:write_config).then(configured.is(true))
|
55
55
|
app.expects(:show).when(configured.is(true))
|
56
56
|
app.process_args('show').run
|
data/test/net_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zack Hobson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: gem-man
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.3.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.3.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: trollop
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -261,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
275
|
version: '0'
|
262
276
|
requirements: []
|
263
277
|
rubyforge_project:
|
264
|
-
rubygems_version: 2.0.
|
278
|
+
rubygems_version: 2.0.14
|
265
279
|
signing_key:
|
266
280
|
specification_version: 4
|
267
281
|
summary: Harvest timesheets from the command-line
|