you_track 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/you_track/client/models/users.rb +3 -1
- data/lib/you_track/client/request.rb +4 -1
- data/lib/you_track/client/requests/get_user.rb +1 -1
- data/lib/you_track/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3274dd920354c0ad52657a95c79e8e5ccf8e8901
|
4
|
+
data.tar.gz: fbc1aa7ae5ebabf4214273d55d089b937b19545d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca3536c467f2e5827e050b9edf3683d30d1bce294e5df86c10d0724f5b56e70be51daeed4d7535107a42be02a210a5ccf7fb84f76dd5d1468e342ea53283ea69
|
7
|
+
data.tar.gz: 693500b824946720071b40b5a4adfbceeb8adb7907997d7de15b050c4a4ecc9f68b4e5b92612ed0001ecf754bc6373660c016277b38ad34203c89ad19b5b402f
|
data/.gitignore
CHANGED
@@ -7,7 +7,9 @@ class YouTrack::Client::Users < YouTrack::Client::Collection
|
|
7
7
|
|
8
8
|
def get(username)
|
9
9
|
service.users.new(service.get_user(username).body)
|
10
|
-
rescue Faraday::
|
10
|
+
rescue Faraday::ClientError => e
|
11
|
+
# yes 403 if you have valid creds BUT the user isn't there
|
12
|
+
raise unless [403, 404].include?(e.response[:status])
|
11
13
|
nil
|
12
14
|
end
|
13
15
|
end
|
@@ -1,7 +1,10 @@
|
|
1
1
|
class YouTrack::Client::Request
|
2
2
|
def find(collection, id, options={})
|
3
3
|
service.data.fetch(collection)[id] ||
|
4
|
-
service.response(
|
4
|
+
service.response(
|
5
|
+
:status => options[:error_status] || 404,
|
6
|
+
:body => { "error" => options[:error_message] || "#{collection.to_s.gsub(/s\Z/, "").capitalize} not found." }
|
7
|
+
)
|
5
8
|
end
|
6
9
|
|
7
10
|
def require_parameters(_params, *_requirements)
|
@@ -9,7 +9,7 @@ class YouTrack::Client::GetUser < YouTrack::Client::Request
|
|
9
9
|
def mock(username)
|
10
10
|
service.response(
|
11
11
|
:body => Cistern::Hash.slice(
|
12
|
-
find(:users, username),
|
12
|
+
find(:users, username, error_status: 403, error_message: "You have no rights to read user."),
|
13
13
|
"login", "filterFolder", "lastCreatedProject", "fullName"
|
14
14
|
)
|
15
15
|
)
|
data/lib/you_track/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: you_track
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cistern
|