tickspot-rb 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.md +9 -3
- data/lib/tickspot/client.rb +41 -43
- data/lib/tickspot/version.rb +1 -1
- metadata +42 -25
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
Y2I2NDRmNTFmMGMzNTM0MDViMDQ4NzY2YTdiMjc0MDBhYjk2NjUyNQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZTQ3NzI0MWZhZTljNWU0MTI2ZTJkOTUyMzAxYjY2MjkwYjRkM2M5YQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NDRhZDVlMTRmNzYxMTdlZDA3YWJmMWJlZGQ3NTk4MTA4MjIzOGVhNDU3ZWE0
|
10
|
+
NGE1YjhkNDQ1NGM3NDljMzE4NjQzMzViNGI1Mzg5YzIxMjZhY2I1OTRjYzQ2
|
11
|
+
MjIxZTA4NGMyYmViYjkwYzQ2YmUwYzRmODc4ODdjZGRlMWI0ZTM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OGQ0N2I3YmM1MDBkNWE2MDc3MDJjYWE4M2NhM2NjZTIxNTA5NTZhZDYxY2Uy
|
14
|
+
Yjg1MTc4YWJhNTIwNjAwODZkMzI2MDdhNzJlMDY5NGU2N2UwNmI0ZThkNWNl
|
15
|
+
ODcyZjEwOTQ1NTk1ZjEzYjM1Y2U5NDc5ZTFmZGQxMDliMjRiM2I=
|
data/README.md
CHANGED
@@ -1,16 +1,22 @@
|
|
1
1
|
# Tickspot-rb
|
2
2
|
|
3
|
+
[![Code Climate](https://codeclimate.com/github/cmason/tickspot-rb.png)](https://codeclimate.com/github/cmason/tickspot-rb)
|
4
|
+
|
3
5
|
Ruby wrapper for the [Tick API](http://www.tickspot.com/api/).
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
$ gem install tickspot-rb
|
8
10
|
|
11
|
+
## Bundler
|
12
|
+
|
13
|
+
gem "tickspot-rb", :require => 'tickspot'
|
14
|
+
|
9
15
|
## Example Usage
|
10
16
|
|
11
17
|
require 'tickspot'
|
12
|
-
|
13
|
-
tick = Tickspot::Client.new('myCompanyName', 'myemail@example.com', 'myTickPassword')
|
18
|
+
|
19
|
+
tick = Tickspot::Client.new('myCompanyName', 'myemail@example.com', 'myTickPassword')
|
14
20
|
tick.clients
|
15
21
|
|
16
22
|
=> [{"id"=>123, "name"=>"Acme"}, {"id"=>231, "name"=>"Sterling Cooper"}, {"id"=>321, "name"=>"Justice League"}]
|
@@ -23,7 +29,7 @@ You can also initialize the client with a configuration block:
|
|
23
29
|
config.email = 'wilie@acme.com'
|
24
30
|
config.password = 'secret'
|
25
31
|
end
|
26
|
-
|
32
|
+
|
27
33
|
# elsewhere
|
28
34
|
client = Tickspot::Client.new
|
29
35
|
|
data/lib/tickspot/client.rb
CHANGED
@@ -11,22 +11,21 @@ module Tickspot
|
|
11
11
|
@company = company
|
12
12
|
@email = email
|
13
13
|
@password = password
|
14
|
-
|
14
|
+
|
15
15
|
self.class.base_uri "https://#{@company}.tickspot.com/api"
|
16
16
|
end
|
17
|
-
# The clients method will return a list of all clients
|
17
|
+
# The clients method will return a list of all clients
|
18
18
|
# and can only be accessed by admins on the subscription.
|
19
19
|
#
|
20
20
|
# Optional paramaters:
|
21
21
|
# open => [true|false]
|
22
22
|
#
|
23
23
|
def clients(options = {})
|
24
|
-
options.
|
25
|
-
self.class.post("/clients", :query => options)["clients"].map {|obj| Hashie::Mash.new obj }
|
24
|
+
post("/clients", options)["clients"].map {|obj| Hashie::Mash.new obj }
|
26
25
|
end
|
27
|
-
|
28
|
-
# The projects method will return projects filtered by the parameters provided.
|
29
|
-
# Admin can see all projects on the subscription,
|
26
|
+
|
27
|
+
# The projects method will return projects filtered by the parameters provided.
|
28
|
+
# Admin can see all projects on the subscription,
|
30
29
|
# while non-admins can only access the projects they are assigned.
|
31
30
|
#
|
32
31
|
# Optional parameters:
|
@@ -35,11 +34,10 @@ module Tickspot
|
|
35
34
|
# project_billable [true|false]
|
36
35
|
#
|
37
36
|
def projects(options = {})
|
38
|
-
options.
|
39
|
-
self.class.post("/projects", :query => options)["projects"].map {|obj| Hashie::Mash.new obj }
|
37
|
+
post("/projects", options)["projects"].map {|obj| Hashie::Mash.new obj }
|
40
38
|
end
|
41
39
|
|
42
|
-
# The tasks method will return a list of all the current tasks for a specified project
|
40
|
+
# The tasks method will return a list of all the current tasks for a specified project
|
43
41
|
# and can only be accessed by admins on the subscription.
|
44
42
|
#
|
45
43
|
# Required parameters:
|
@@ -51,27 +49,26 @@ module Tickspot
|
|
51
49
|
# task_billable [true|false]
|
52
50
|
#
|
53
51
|
def tasks(options = {})
|
54
|
-
options.
|
55
|
-
self.class.post("/tasks", :query => options)["tasks"].map {|obj| Hashie::Mash.new obj }
|
52
|
+
post("/tasks", options)["tasks"].map {|obj| Hashie::Mash.new obj }
|
56
53
|
end
|
57
|
-
|
58
|
-
# The method will return a list of all clients, projects, and tasks
|
54
|
+
|
55
|
+
# The method will return a list of all clients, projects, and tasks
|
59
56
|
# that are assigned to the user and available for time entries (open).
|
60
57
|
#
|
61
58
|
def clients_projects_tasks
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
# The entries method will return a list of all entries that meet the provided criteria.
|
66
|
-
# Either a start and end date have to be provided or an updated_at time.
|
67
|
-
# The entries will be in the start and end date range or they will be after
|
68
|
-
# the updated_at time depending on what criteria is provided.
|
69
|
-
# Each of the optional parameters will further filter the response.
|
59
|
+
post("/clients_projects_tasks")["clients"].map {|obj| Hashie::Mash.new obj }
|
60
|
+
end
|
61
|
+
|
62
|
+
# The entries method will return a list of all entries that meet the provided criteria.
|
63
|
+
# Either a start and end date have to be provided or an updated_at time.
|
64
|
+
# The entries will be in the start and end date range or they will be after
|
65
|
+
# the updated_at time depending on what criteria is provided.
|
66
|
+
# Each of the optional parameters will further filter the response.
|
70
67
|
#
|
71
68
|
# Required parameters:
|
72
69
|
# start_date
|
73
|
-
# end_date
|
74
|
-
# OR
|
70
|
+
# end_date
|
71
|
+
# OR
|
75
72
|
# updated_at
|
76
73
|
#
|
77
74
|
# Optional Parameters:
|
@@ -84,28 +81,26 @@ module Tickspot
|
|
84
81
|
# billed [true|false]
|
85
82
|
#
|
86
83
|
def entries(options = {})
|
87
|
-
options.
|
88
|
-
self.class.post("/entries", :query => options)["entries"].map {|obj| Hashie::Mash.new obj }
|
84
|
+
post("/entries", options)["entries"].map {|obj| Hashie::Mash.new obj }
|
89
85
|
end
|
90
|
-
|
91
|
-
# The users method will return a list of the most recently used tasks.
|
86
|
+
|
87
|
+
# The users method will return a list of the most recently used tasks.
|
92
88
|
# This is useful for generating quick links for a user to select a task they have been using recently.
|
93
89
|
#
|
94
90
|
def recent_tasks
|
95
|
-
|
91
|
+
post("/recent_tasks")['recent_tasks'].map {|obj| Hashie::Mash.new obj }
|
96
92
|
end
|
97
|
-
|
93
|
+
|
98
94
|
# The users method will return a list of users.
|
99
95
|
#
|
100
96
|
# Optional parameters:
|
101
97
|
# project_id
|
102
98
|
#
|
103
99
|
def users(options = {})
|
104
|
-
options.
|
105
|
-
self.class.post("/users", :query => options)['users'].map {|obj| Hashie::Mash.new obj }
|
100
|
+
post("/users", options)['users'].map {|obj| Hashie::Mash.new obj }
|
106
101
|
end
|
107
|
-
|
108
|
-
# The create_entry method will accept a time entry for a specified task_id
|
102
|
+
|
103
|
+
# The create_entry method will accept a time entry for a specified task_id
|
109
104
|
# and return the created entry along with the task and project stats.
|
110
105
|
#
|
111
106
|
# Require parameters:
|
@@ -117,14 +112,13 @@ module Tickspot
|
|
117
112
|
# notes
|
118
113
|
#
|
119
114
|
def create_entry(options = {})
|
120
|
-
|
121
|
-
self.class.post("/create_entry", :query => options)
|
115
|
+
post("/create_entry", options)
|
122
116
|
end
|
123
|
-
|
124
|
-
# The update_entry method will allow you to modify attributes of an existing entry.
|
125
|
-
# The only required parameter is the id of the entry.
|
126
|
-
# Additional parameters must be provided for any attribute that you wish to update.
|
127
|
-
# For example, if you are only changing the billed attribute,
|
117
|
+
|
118
|
+
# The update_entry method will allow you to modify attributes of an existing entry.
|
119
|
+
# The only required parameter is the id of the entry.
|
120
|
+
# Additional parameters must be provided for any attribute that you wish to update.
|
121
|
+
# For example, if you are only changing the billed attribute,
|
128
122
|
# your post should only include the required parameters and the billed parameter.
|
129
123
|
#
|
130
124
|
# Require parameters:
|
@@ -139,8 +133,12 @@ module Tickspot
|
|
139
133
|
# notes
|
140
134
|
#
|
141
135
|
def update_entry(options = {})
|
142
|
-
|
143
|
-
|
136
|
+
post("/update_entry", options)
|
137
|
+
end
|
138
|
+
|
139
|
+
private
|
140
|
+
def post(path, options={})
|
141
|
+
self.class.post(path, :query => options.merge!(:email => @email, :password => @password))
|
144
142
|
end
|
145
143
|
end
|
146
144
|
end
|
data/lib/tickspot/version.rb
CHANGED
metadata
CHANGED
@@ -1,82 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tickspot-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Chris Mason
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: hashie
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: httparty
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
31
|
- - ! '>='
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: '0'
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
42
|
name: rake
|
38
|
-
requirement:
|
39
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
45
|
- - ! '>='
|
42
46
|
- !ruby/object:Gem::Version
|
43
47
|
version: '0'
|
44
48
|
type: :development
|
45
49
|
prerelease: false
|
46
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
47
55
|
- !ruby/object:Gem::Dependency
|
48
56
|
name: rspec
|
49
|
-
requirement:
|
50
|
-
none: false
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
51
58
|
requirements:
|
52
59
|
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
type: :development
|
56
63
|
prerelease: false
|
57
|
-
version_requirements:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: simplecov
|
60
|
-
requirement:
|
61
|
-
none: false
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
62
72
|
requirements:
|
63
73
|
- - ! '>='
|
64
74
|
- !ruby/object:Gem::Version
|
65
75
|
version: '0'
|
66
76
|
type: :development
|
67
77
|
prerelease: false
|
68
|
-
version_requirements:
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: webmock
|
71
|
-
requirement:
|
72
|
-
none: false
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
73
86
|
requirements:
|
74
87
|
- - ! '>='
|
75
88
|
- !ruby/object:Gem::Version
|
76
89
|
version: '0'
|
77
90
|
type: :development
|
78
91
|
prerelease: false
|
79
|
-
version_requirements:
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
80
97
|
description: Ruby wrapper for the Tick API http://tickspot.com/api
|
81
98
|
email:
|
82
99
|
- chris@chaione.com
|
@@ -104,27 +121,26 @@ files:
|
|
104
121
|
- tickspot-rb.gemspec
|
105
122
|
homepage: https://github.com/cmason/tickspot-rb
|
106
123
|
licenses: []
|
124
|
+
metadata: {}
|
107
125
|
post_install_message:
|
108
126
|
rdoc_options: []
|
109
127
|
require_paths:
|
110
128
|
- lib
|
111
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
-
none: false
|
113
130
|
requirements:
|
114
131
|
- - ! '>='
|
115
132
|
- !ruby/object:Gem::Version
|
116
133
|
version: '0'
|
117
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
-
none: false
|
119
135
|
requirements:
|
120
136
|
- - ! '>='
|
121
137
|
- !ruby/object:Gem::Version
|
122
138
|
version: '0'
|
123
139
|
requirements: []
|
124
140
|
rubyforge_project: tickspot-rb
|
125
|
-
rubygems_version:
|
141
|
+
rubygems_version: 2.0.0
|
126
142
|
signing_key:
|
127
|
-
specification_version:
|
143
|
+
specification_version: 4
|
128
144
|
summary: Ruby wrapper for the Tick API http://tickspot.com/api
|
129
145
|
test_files:
|
130
146
|
- spec/client_spec.rb
|
@@ -135,3 +151,4 @@ test_files:
|
|
135
151
|
- spec/fixtures/users.xml
|
136
152
|
- spec/spec_helper.rb
|
137
153
|
- spec/tickspot_spec.rb
|
154
|
+
has_rdoc:
|