you_track 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7731b376fb285bb8902965a614a92045d28fbb31
|
|
4
|
+
data.tar.gz: 87fd01be121a4aa47e2c7e1ae493d52f385360a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2f60bda9c55406d193cbc4475a647e803582b848ab7756280054c9eab2bb894d1d89f9752ab3c23e1c4a5f6722c1e55c10f14c1a9bd25ac23903b75ab8242a34
|
|
7
|
+
data.tar.gz: b24214c9f606c529086faadabaeb1af681d558d2ae8e62c54b3d02bca809ef4520691bb5688cb08f8c0a45f9249c138c4c0e874bd7460cfc65999be2a65dafd7
|
|
@@ -35,15 +35,24 @@ class YouTrack::Client::Mock
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def initialize(options={})
|
|
38
|
-
@url
|
|
38
|
+
@url = URI.parse(options[:url])
|
|
39
39
|
@username = options[:username]
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
|
|
41
|
+
set_current_user
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def set_current_user
|
|
45
|
+
self.data[:users][username] ||= {
|
|
46
|
+
"email" => "#{username}@example.org",
|
|
47
|
+
"full_name" => Faker::Name.name,
|
|
48
|
+
"last_created_project" => SecureRandom.hex(2),
|
|
44
49
|
}
|
|
45
50
|
end
|
|
46
51
|
|
|
52
|
+
def current_user
|
|
53
|
+
@current_user ||= users.current
|
|
54
|
+
end
|
|
55
|
+
|
|
47
56
|
def response(options={})
|
|
48
57
|
body = options[:response_body] || options[:body]
|
|
49
58
|
method = options[:method] || :get
|
|
@@ -79,8 +88,4 @@ class YouTrack::Client::Mock
|
|
|
79
88
|
Faraday::Response::RaiseError.new.on_complete(env) ||
|
|
80
89
|
Faraday::Response.new(env)
|
|
81
90
|
end
|
|
82
|
-
|
|
83
|
-
def current_user
|
|
84
|
-
@current_user ||= users.current
|
|
85
|
-
end
|
|
86
91
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
class YouTrack::Client::User < YouTrack::Client::Model
|
|
2
|
-
identity :id, aliases: ["
|
|
2
|
+
identity :id, aliases: ["email"]
|
|
3
3
|
|
|
4
|
+
attribute :name, alias: "fullName"
|
|
4
5
|
attribute :last_created_project, aliases: ["lastCreatedProject"]
|
|
5
|
-
attribute :email, aliases: ["email"]
|
|
6
6
|
|
|
7
7
|
def admin? # just try to make a request to the admin api and see what happens
|
|
8
8
|
return @admin if defined?(@admin) # i love how ||= doesn't work when a variable is false
|
data/lib/you_track/version.rb
CHANGED