summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--CHANGELOG2
-rw-r--r--README.markdown13
-rw-r--r--Rakefile27
-rw-r--r--VERSION1
-rwxr-xr-xbin/hcl2
-rw-r--r--hcl.gemspec68
-rw-r--r--lib/hcl.rb10
-rw-r--r--lib/hcl/app.rb10
-rw-r--r--lib/hcl/version.rb3
-rw-r--r--test/test_helper.rb2
11 files changed, 42 insertions, 97 deletions
diff --git a/.gitignore b/.gitignore
index 18004df..71fb1ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ doc
.yardoc
.rvmrc
.rvmrc.*
+*.gem
diff --git a/CHANGELOG b/CHANGELOG
index 93a4903..2077901 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,7 +2,7 @@
== v0.4.4
-* added completion command to output a Bash completion script
+* added completion command to output a Bash auto-complete script, closes #34
== v0.4.3
diff --git a/README.markdown b/README.markdown
index 959d6b9..b4394d1 100644
--- a/README.markdown
+++ b/README.markdown
@@ -10,20 +10,23 @@ HCl is a command-line tool for interacting with Harvest time sheets using the
You can install hcl directly from rubygems.org:
$ gem install hcl
- $ hcl show [date]
-or you can install from source using jeweler:
+or you can install from source:
- $ gem install jeweler
$ rake install
+If you're using HCl for the first time, the show command sets up your
+Harvest credentials:
+
+ $ hcl show
+
## Usage
- hcl [start] (@<task_alias> | <project_id> <task_id>) [+<time>] [<message>]
+ hcl [start] @<task_alias> [+<time>] [<message>]
hcl note <message>
hcl stop [message]
hcl resume [@<task_alias>]
- hcl log (@<task_alias> | <project_id> <task_id>) [+<time>] [<message>]
+ hcl log @<task_alias> [+<time>] [<message>]
hcl show [date]
hcl tasks
hcl alias <task_alias> <project_id> <task_id>
diff --git a/Rakefile b/Rakefile
index 984bcbd..95e995c 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,27 +1,14 @@
-require 'rake/testtask'
+$:.unshift(File.dirname(__FILE__) + '/lib')
+require 'hcl'
+require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << 'test'
t.test_files = FileList['test/*_test.rb']
end
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "hcl"
- gem.summary = "Harvest timesheets from the command-line"
- gem.description = "HCl is a command-line client for manipulating Harvest time sheets."
- gem.email = "zack@zackhobson.com"
- gem.homepage = "http://github.com/zenhob/hcl"
- gem.authors = ["Zack Hobson"]
- gem.license = "MIT"
- gem.add_dependency "trollop"
- gem.add_dependency "chronic"
- gem.add_dependency "highline"
- gem.add_development_dependency "shoulda"
- gem.add_development_dependency "mocha"
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler not available. Install it with: sudo gem install jeweler"
+task :install do
+ system 'gem build hcl.gemspec'
+ system "gem install hcl-#{HCl::VERSION}.gem"
end
+
diff --git a/VERSION b/VERSION
deleted file mode 100644
index 17b2ccd..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-0.4.3
diff --git a/bin/hcl b/bin/hcl
index 3037cf4..3581c46 100755
--- a/bin/hcl
+++ b/bin/hcl
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-require 'hcl/app'
+require 'hcl'
HCl::App.command *ARGV
diff --git a/hcl.gemspec b/hcl.gemspec
index 4dcd2df..67520ad 100644
--- a/hcl.gemspec
+++ b/hcl.gemspec
@@ -1,73 +1,25 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
-# -*- encoding: utf-8 -*-
+$:.unshift(File.dirname(__FILE__) + '/lib')
+require 'hcl'
Gem::Specification.new do |s|
s.name = "hcl"
- s.version = "0.4.3"
+ s.version = HCl::VERSION
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Zack Hobson"]
s.date = "2013-11-19"
s.description = "HCl is a command-line client for manipulating Harvest time sheets."
s.email = "zack@zackhobson.com"
s.executables = ["hcl"]
- s.extra_rdoc_files = [
- "LICENSE",
- "README.markdown"
- ]
- s.files = [
- ".document",
- "CHANGELOG",
- "HACKING.markdown",
- "LICENSE",
- "README.markdown",
- "Rakefile",
- "VERSION",
- "bin/hcl",
- "deps.rip",
- "hcl.gemspec",
- "lib/hcl/app.rb",
- "lib/hcl/commands.rb",
- "lib/hcl/day_entry.rb",
- "lib/hcl/project.rb",
- "lib/hcl/task.rb",
- "lib/hcl/timesheet_resource.rb",
- "lib/hcl/utility.rb",
- "test/app_test.rb",
- "test/day_entry_test.rb",
- "test/test_helper.rb",
- "test/utility_test.rb"
- ]
+ s.files = %w[CHANGELOG LICENSE Rakefile] + Dir['*.markdown'] +
+ Dir['bin/*'] + Dir['lib/**/*.rb'] + Dir['test/**/*.rb']
s.homepage = "http://github.com/zenhob/hcl"
s.licenses = ["MIT"]
- s.require_paths = ["lib"]
- s.rubygems_version = "2.0.3"
s.summary = "Harvest timesheets from the command-line"
- if s.respond_to? :specification_version then
- s.specification_version = 4
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<trollop>, [">= 0"])
- s.add_runtime_dependency(%q<chronic>, [">= 0"])
- s.add_runtime_dependency(%q<highline>, [">= 0"])
- s.add_development_dependency(%q<shoulda>, [">= 0"])
- s.add_development_dependency(%q<mocha>, [">= 0"])
- else
- s.add_dependency(%q<trollop>, [">= 0"])
- s.add_dependency(%q<chronic>, [">= 0"])
- s.add_dependency(%q<highline>, [">= 0"])
- s.add_dependency(%q<shoulda>, [">= 0"])
- s.add_dependency(%q<mocha>, [">= 0"])
- end
- else
- s.add_dependency(%q<trollop>, [">= 0"])
- s.add_dependency(%q<chronic>, [">= 0"])
- s.add_dependency(%q<highline>, [">= 0"])
- s.add_dependency(%q<shoulda>, [">= 0"])
- s.add_dependency(%q<mocha>, [">= 0"])
- end
+ s.add_runtime_dependency(%q<trollop>, [">= 0"])
+ s.add_runtime_dependency(%q<chronic>, [">= 0"])
+ s.add_runtime_dependency(%q<highline>, [">= 0"])
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
+ s.add_development_dependency(%q<mocha>, [">= 0"])
end
diff --git a/lib/hcl.rb b/lib/hcl.rb
new file mode 100644
index 0000000..8f7be26
--- /dev/null
+++ b/lib/hcl.rb
@@ -0,0 +1,10 @@
+module HCl
+ autoload :VERSION, 'hcl/version'
+ autoload :App, 'hcl/app'
+ autoload :Commands, 'hcl/commands'
+ autoload :TimesheetResource, 'hcl/timesheet_resource'
+ autoload :Utility, 'hcl/utility'
+ autoload :Project, 'hcl/project'
+ autoload :Task, 'hcl/task'
+ autoload :DayEntry, 'hcl/day_entry'
+end
diff --git a/lib/hcl/app.rb b/lib/hcl/app.rb
index 585ea79..f108087 100644
--- a/lib/hcl/app.rb
+++ b/lib/hcl/app.rb
@@ -10,14 +10,6 @@ require 'chronic'
require 'trollop'
require 'highline/import'
-## app dependencies
-require 'hcl/utility'
-require 'hcl/commands'
-require 'hcl/timesheet_resource'
-require 'hcl/project'
-require 'hcl/task'
-require 'hcl/day_entry'
-
# Workaround for annoying SSL warning:
# >> warning: peer certificate won't be verified in this SSL session
# http://www.5dollarwhitebox.org/drupal/node/64
@@ -31,8 +23,6 @@ class Net::HTTP
end
module HCl
- VERSION = "0.4.3"
-
class App
include HCl::Utility
include HCl::Commands
diff --git a/lib/hcl/version.rb b/lib/hcl/version.rb
new file mode 100644
index 0000000..5221433
--- /dev/null
+++ b/lib/hcl/version.rb
@@ -0,0 +1,3 @@
+module HCl
+ VERSION = '0.4.4'
+end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 9e12bac..450baa2 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -2,6 +2,6 @@ $:.unshift(File.dirname(__FILE__) + '/../lib')
require 'rubygems'
require 'test/unit'
-require 'hcl/app'
+require 'hcl'
require 'shoulda'
require 'mocha/setup'