public this repo is viewable by everyone
Description: A gem that provides a ruby wrapper around the tickspot.com api
Homepage: http://tickspot.com/api/
Clone URL: git://github.com/bricooke/tickspot-ruby.git
support empty return sets and fix issue where you couldnt filter users by 
project_id
bricooke (author)
about 1 month ago
commit  902f5346e5483546f854e6709611fa12a3a310be
tree    e50f06f7053390c1916757a1c1d79b10b9431435
parent  2466c32e5d29875b2583cefb4dad53ac094aefec
...
13
14
15
16
17
18
 
 
 
19
20
21
22
23
 
24
25
26
27
28
 
29
30
31
32
33
 
34
35
36
...
13
14
15
 
 
 
16
17
18
19
20
21
22
 
23
24
25
26
27
 
28
29
30
31
32
 
33
34
35
36
0
@@ -13,24 +13,24 @@ class Tickspot
0
     @password = password
0
   end
0
 
0
- def users
0
- te = request("users")
0
- te.users
0
+ def users(params={})
0
+ te = request("users", params)
0
+ te.empty? ? [] : te.users
0
   end
0
 
0
   def projects
0
     te = request("projects")
0
- te.projects
0
+ te.empty? ? [] : te.projects
0
   end
0
 
0
   def tasks(project_id)
0
     te = request("tasks", :project_id => project_id)
0
- te.tasks
0
+ te.empty? ? [] : te.tasks
0
   end
0
 
0
   def entries(start_date, end_date, params={})
0
     te = request("entries", params.merge({:start_date => start_date, :end_date => end_date}))
0
- te.entries
0
+ te.empty? ? [] : te.entries
0
   end
0
 
0
 private
...
7
8
9
10
 
 
 
 
 
 
 
 
 
11
12
13
...
7
8
9
 
10
11
12
13
14
15
16
17
18
19
20
21
0
@@ -7,7 +7,15 @@ class TickspotEntry
0
     self.method_missing(:id)
0
   end
0
   
0
- def method_missing(method, *args)
0
+ def empty?
0
+ if @hash["type"] == "array" && @hash["content"] == "\n"
0
+ true
0
+ else
0
+ false
0
+ end
0
+ end
0
+
0
+ def method_missing(method, *args)
0
     if @hash.has_key?(method.to_s.singularize)
0
       entry = @hash[method.to_s.singularize]
0
       if method.to_s.pluralize == method.to_s && entry.class == Array

Comments

    No one has commented yet.