mite-rb 0.5.2 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES.md +9 -1
- data/README.md +3 -3
- data/lib/mite/activeresource_patch.rb +24 -0
- data/lib/mite/version.rb +2 -2
- data/lib/mite-rb.rb +3 -2
- data/mite-rb.gemspec +2 -2
- metadata +14 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: be17b15a259803324f44a45fc7741932f40b1bffd806a34b800dcb3c1311ebc8
|
4
|
+
data.tar.gz: 6bd9c1904b6fb218e95ac40f56cebe675b62c37623594f2b9109f6dd6647be52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67d06034a5d1e20488fc2108f566e242ce9162fa81e039ff6e7e941a9b2310dac16e9c06014b901fcd6f1efc3d46980a059a14e0a64006f328452694799f5661
|
7
|
+
data.tar.gz: fa7de37562aa80218f0b1b7c6005ebf52d54bbd5f3c27dd3c6ec699580fda47b54154d279661db0eed2a1605f64a08212701186d5764fc22dc0637ceb7f8057b
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## mite-rb Changelog
|
2
2
|
|
3
|
+
### 0.5.4 / 2023-02-20
|
4
|
+
|
5
|
+
* Changed default API domain from *.mite.yo.lk to *.mite.de
|
6
|
+
|
7
|
+
### 0.5.3 / 2013-11-28
|
8
|
+
|
9
|
+
* Fixed issue with error format returned from mite
|
10
|
+
|
3
11
|
### 0.5.2 / 2013-11-27
|
4
12
|
|
5
13
|
* Fixed issue with activeresource 4: always include json root
|
@@ -84,4 +92,4 @@
|
|
84
92
|
|
85
93
|
### 0.0.1
|
86
94
|
|
87
|
-
* Initial Version
|
95
|
+
* Initial Version
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## mite-rb
|
2
2
|
|
3
|
-
The official ruby library for interacting with the [RESTful API](http://mite.
|
3
|
+
The official ruby library for interacting with the [RESTful API](http://mite.de/en/api) of [mite](http://mite.de/en), a sleek time tracking webapp.
|
4
4
|
|
5
5
|
## Install
|
6
6
|
|
@@ -12,13 +12,13 @@ mite-rb requires activeresource and activesupport in version 3.1 or above. If yo
|
|
12
12
|
|
13
13
|
## Documentation
|
14
14
|
|
15
|
-
You should read the complete *mite*.api documentation at [http://mite.
|
15
|
+
You should read the complete *mite*.api documentation at [http://mite.de/en/api](http://mite.de/en/api)
|
16
16
|
|
17
17
|
### Authenticate
|
18
18
|
|
19
19
|
**IMPORTANT:** To use mite-rb you **must** enable the *mite*.api for your user within the webinterface of *mite*! It is disabled by default.
|
20
20
|
|
21
|
-
The first thing you need to set is the account name. This is the same as the web address (subdomain) for your account. For example if you use *mite* from the domain *demo.mite.
|
21
|
+
The first thing you need to set is the account name. This is the same as the web address (subdomain) for your account. For example if you use *mite* from the domain *demo.mite.de* set the account to 'demo':
|
22
22
|
|
23
23
|
Mite.account = 'demo'
|
24
24
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "active_resource/validations"
|
2
|
+
|
3
|
+
module ActiveResource
|
4
|
+
class Errors < ActiveModel::Errors
|
5
|
+
def from_json(json, save_cache = false)
|
6
|
+
decoded = ActiveSupport::JSON.decode(json) || {} rescue {}
|
7
|
+
from_hash decoded, save_cache
|
8
|
+
end
|
9
|
+
|
10
|
+
def from_hash(messages, save_cache = false)
|
11
|
+
clear unless save_cache
|
12
|
+
|
13
|
+
messages.each do |(key,errors)|
|
14
|
+
Array(errors).each do |error|
|
15
|
+
if key == 'base'
|
16
|
+
self[:base] << error
|
17
|
+
else
|
18
|
+
add key, error
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/mite/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Mite
|
2
|
-
VERSION = "0.5.
|
3
|
-
end
|
2
|
+
VERSION = "0.5.4"
|
3
|
+
end
|
data/lib/mite-rb.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'active_support'
|
2
2
|
require 'active_resource'
|
3
|
-
require 'mite/
|
3
|
+
require 'mite/activeresource_patch'
|
4
|
+
require 'mite/version'
|
4
5
|
|
5
6
|
# The official ruby library for interacting with the RESTful API of mite,
|
6
7
|
# a sleek time tracking webapp.
|
@@ -72,7 +73,7 @@ module Mite
|
|
72
73
|
end
|
73
74
|
|
74
75
|
self.host_format = '%s://%s%s'
|
75
|
-
self.domain_format = '%s.mite.
|
76
|
+
self.domain_format = '%s.mite.de'
|
76
77
|
self.port = ''
|
77
78
|
self.user_agent = "mite-rb/#{Mite::VERSION}"
|
78
79
|
|
data/mite-rb.gemspec
CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = "mite-rb"
|
7
7
|
s.version = Mite::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["
|
10
|
-
s.email = [
|
9
|
+
s.authors = ["mite GmbH"]
|
10
|
+
s.email = []
|
11
11
|
s.homepage = "https://github.com/yolk/mite-rb"
|
12
12
|
s.summary = %q{The official ruby library for interacting with the RESTful mite.api.}
|
13
13
|
s.description = %q{The official ruby library for interacting with the RESTful mite.api.}
|
metadata
CHANGED
@@ -1,37 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mite-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- mite GmbH
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.1.0
|
27
27
|
description: The official ruby library for interacting with the RESTful mite.api.
|
28
|
-
email:
|
29
|
-
- sebastian@yo.lk
|
28
|
+
email: []
|
30
29
|
executables: []
|
31
30
|
extensions: []
|
32
31
|
extra_rdoc_files: []
|
33
32
|
files:
|
34
|
-
- .gitignore
|
33
|
+
- ".gitignore"
|
35
34
|
- CHANGES.md
|
36
35
|
- Gemfile
|
37
36
|
- LICENSE
|
@@ -39,6 +38,7 @@ files:
|
|
39
38
|
- Rakefile
|
40
39
|
- lib/mite-rb.rb
|
41
40
|
- lib/mite/account.rb
|
41
|
+
- lib/mite/activeresource_patch.rb
|
42
42
|
- lib/mite/customer.rb
|
43
43
|
- lib/mite/myself.rb
|
44
44
|
- lib/mite/project.rb
|
@@ -53,24 +53,23 @@ files:
|
|
53
53
|
homepage: https://github.com/yolk/mite-rb
|
54
54
|
licenses: []
|
55
55
|
metadata: {}
|
56
|
-
post_install_message:
|
56
|
+
post_install_message:
|
57
57
|
rdoc_options: []
|
58
58
|
require_paths:
|
59
59
|
- lib
|
60
60
|
required_ruby_version: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
|
-
- -
|
62
|
+
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: '0'
|
65
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
|
-
|
72
|
-
|
73
|
-
signing_key:
|
71
|
+
rubygems_version: 3.3.7
|
72
|
+
signing_key:
|
74
73
|
specification_version: 4
|
75
74
|
summary: The official ruby library for interacting with the RESTful mite.api.
|
76
75
|
test_files: []
|