mite-rb 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +5 -0
- data/VERSION.yml +1 -1
- data/lib/mite/time_entry/bookmark.rb +30 -0
- data/lib/mite/time_entry.rb +3 -1
- data/lib/mite-rb.rb +9 -12
- data/mite-rb.gemspec +3 -2
- metadata +3 -2
data/CHANGES.txt
CHANGED
data/VERSION.yml
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
class Mite::TimeEntry::Bookmark < Mite::Base
|
2
|
+
|
3
|
+
include Mite::ResourceWithoutWriteAccess
|
4
|
+
self.prefix = "/time_entries/"
|
5
|
+
|
6
|
+
def team?
|
7
|
+
user_id.blank?
|
8
|
+
end
|
9
|
+
|
10
|
+
def params
|
11
|
+
hash = CGI.parse(query)
|
12
|
+
hash.each do |k, v|
|
13
|
+
hash[k] = v[0]
|
14
|
+
end
|
15
|
+
hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def follow
|
19
|
+
Mite::TimeEntry.all(:params => params)
|
20
|
+
end
|
21
|
+
|
22
|
+
class << self
|
23
|
+
def follow(id)
|
24
|
+
get("#{id}/follow")
|
25
|
+
rescue ActiveResource::Redirection => err
|
26
|
+
query = err.response['Location'].split(/\?/,2)[1] || ""
|
27
|
+
new(:query => query).follow
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/mite/time_entry.rb
CHANGED
data/lib/mite-rb.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
1
|
+
require 'active_support'
|
2
|
+
require 'active_resource'
|
3
3
|
|
4
4
|
# The official ruby library for interacting with the RESTful API of mite,
|
5
5
|
# a sleek time tracking webapp.
|
@@ -119,6 +119,12 @@ module Mite
|
|
119
119
|
find_every(options).last
|
120
120
|
end
|
121
121
|
end
|
122
|
+
|
123
|
+
private
|
124
|
+
|
125
|
+
def query_string2(options)
|
126
|
+
options.is_a?(String) ? "?#{options}" : super
|
127
|
+
end
|
122
128
|
end
|
123
129
|
|
124
130
|
class SingletonBase < Base
|
@@ -156,13 +162,4 @@ module Mite
|
|
156
162
|
end
|
157
163
|
|
158
164
|
$:.unshift(File.dirname(__FILE__))
|
159
|
-
|
160
|
-
require 'mite/customer'
|
161
|
-
require 'mite/project'
|
162
|
-
require 'mite/service'
|
163
|
-
require 'mite/time_entry'
|
164
|
-
require 'mite/time_entry_group'
|
165
|
-
require 'mite/tracker'
|
166
|
-
require 'mite/user'
|
167
|
-
require 'mite/myself'
|
168
|
-
require 'mite/account'
|
165
|
+
Dir[File.join(File.dirname(__FILE__), "mite/*.rb")].each { |f| require f }
|
data/mite-rb.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mite-rb}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Sebastian Munz"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2010-01-13}
|
13
13
|
s.description = %q{The official ruby library for interacting with the RESTful mite.api.}
|
14
14
|
s.email = %q{sebastian@yo.lk}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
|
|
30
30
|
"lib/mite/project.rb",
|
31
31
|
"lib/mite/service.rb",
|
32
32
|
"lib/mite/time_entry.rb",
|
33
|
+
"lib/mite/time_entry/bookmark.rb",
|
33
34
|
"lib/mite/time_entry_group.rb",
|
34
35
|
"lib/mite/tracker.rb",
|
35
36
|
"lib/mite/user.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mite-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Munz
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-13 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- lib/mite/project.rb
|
56
56
|
- lib/mite/service.rb
|
57
57
|
- lib/mite/time_entry.rb
|
58
|
+
- lib/mite/time_entry/bookmark.rb
|
58
59
|
- lib/mite/time_entry_group.rb
|
59
60
|
- lib/mite/tracker.rb
|
60
61
|
- lib/mite/user.rb
|