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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb508f765c63379fa92d71225d020409e27880a1
4
- data.tar.gz: acd0ac2005f571727435031975af75e66bf5595b
3
+ metadata.gz: 3274dd920354c0ad52657a95c79e8e5ccf8e8901
4
+ data.tar.gz: fbc1aa7ae5ebabf4214273d55d089b937b19545d
5
5
  SHA512:
6
- metadata.gz: ae9c7c0e97112d80d0a27d5a84d04aa17ab0da9425adc06a47e8c5efb43f68e54b800539664058278e52c243baff3d785a0862f61f5483b91b174516893caa7b
7
- data.tar.gz: 4149e84c106b152dc9c606f3c2560da2826b728aa0d86e3a79ee9d618d352c1b886581c1229014596ce30a9bd28025263cf4dd338407d373d7f45a9c815a7e67
6
+ metadata.gz: ca3536c467f2e5827e050b9edf3683d30d1bce294e5df86c10d0724f5b56e70be51daeed4d7535107a42be02a210a5ccf7fb84f76dd5d1468e342ea53283ea69
7
+ data.tar.gz: 693500b824946720071b40b5a4adfbceeb8adb7907997d7de15b050c4a4ecc9f68b4e5b92612ed0001ecf754bc6373660c016277b38ad34203c89ad19b5b402f
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -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::ResourceNotFound
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(status: 404, body: {"error" => "#{collection.to_s.gsub(/s\Z/, "").capitalize} not found."})
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
  )
@@ -1,3 +1,3 @@
1
1
  module YouTrack
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
3
3
  end
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.7
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-23 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cistern