giraffesoft-tempo_cli 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +22 -0
- data/README.rdoc +18 -0
- data/bin/tempo +7 -0
- data/lib/tempo_cli.rb +24 -0
- data/test/test_helper.rb +2 -0
- metadata +65 -0
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2008 James Golick, GiraffeSoft Inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
= Tempo CLI
|
2
|
+
|
3
|
+
This is a CLI for sending commands to the tempo time tracker (keeptempoapp.com)
|
4
|
+
|
5
|
+
== Configuration:
|
6
|
+
|
7
|
+
Add a file at ~/.tempo that contains your tempo credentials in YAML form.
|
8
|
+
|
9
|
+
i.e.
|
10
|
+
|
11
|
+
username: james
|
12
|
+
password: swordfish
|
13
|
+
|
14
|
+
== Usage:
|
15
|
+
|
16
|
+
$ tempo "command #project @tag"
|
17
|
+
|
18
|
+
Note: the syntax is defined by the app, not by the CLI.
|
data/bin/tempo
ADDED
data/lib/tempo_cli.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
$LOAD_PATH << File.dirname(__FILE__)
|
2
|
+
require 'rubygems'
|
3
|
+
require 'activesupport'
|
4
|
+
require 'rest_client'
|
5
|
+
|
6
|
+
module TempoCli
|
7
|
+
CONFIG_FILE = ENV['HOME']+'/.tempo'
|
8
|
+
|
9
|
+
class << self
|
10
|
+
attr_accessor :username, :password
|
11
|
+
|
12
|
+
def create_entry(command)
|
13
|
+
get_credentials!
|
14
|
+
resource = RestClient::Resource.new 'https://app.keeptempo.com/entries', username, password
|
15
|
+
resource.post({:command => command}.to_xml(:root => 'entry'), :content_type => 'application/xml', :accept => 'application/xml')
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_credentials!
|
19
|
+
abort "You must create a #{CONFIG_FILE} file to use this CLI." unless File.exist?(CONFIG_FILE)
|
20
|
+
config = YAML.load(File.read(CONFIG_FILE)).symbolize_keys
|
21
|
+
@username, @password = config[:username], config[:password]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: giraffesoft-tempo_cli
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Golick
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-07-29 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: adamwiggins-rest-client
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
version:
|
24
|
+
description: ""
|
25
|
+
email: james@giraffesoft.ca
|
26
|
+
executables:
|
27
|
+
- tempo
|
28
|
+
extensions: []
|
29
|
+
|
30
|
+
extra_rdoc_files: []
|
31
|
+
|
32
|
+
files:
|
33
|
+
- lib/tempo_cli.rb
|
34
|
+
- bin/tempo
|
35
|
+
- README.rdoc
|
36
|
+
- LICENSE
|
37
|
+
- test/test_helper.rb
|
38
|
+
has_rdoc: false
|
39
|
+
homepage: http://keeptempoapp.com
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: "0"
|
50
|
+
version:
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "0"
|
56
|
+
version:
|
57
|
+
requirements: []
|
58
|
+
|
59
|
+
rubyforge_project:
|
60
|
+
rubygems_version: 1.2.0
|
61
|
+
signing_key:
|
62
|
+
specification_version: 2
|
63
|
+
summary: CLI for starting and stopping time using the Tempo time tracker.
|
64
|
+
test_files: []
|
65
|
+
|