ghee 0.10.15 → 0.11.16

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: 228113acda6ec17f64ce78cc6adebe8fb42535b3
4
- data.tar.gz: e0be6738ba9502e91a2d3d5394c2b0df25a50fdd
3
+ metadata.gz: d4632fb35cf000d7f6fe844d1d8672297502a29a
4
+ data.tar.gz: 979de725a3fac62e7af4cc5794d1f65f7d6a0abd
5
5
  SHA512:
6
- metadata.gz: 66dd6465d9fcbc37470c70762d6ffa47b0fec1436cc07aa7a5b678ab93099576080ecd04dd9a9cee30bab0e2e9b06aa7e26dc5d35c0465b8ffd5718a719ea4d2
7
- data.tar.gz: 3cd598037797a7e904b03789a8cfc9d14384f6e25f4a84b7acc127b22a2d76c5f98320f6e7b7460e96cac23c7e245c89d1741981c382b94fad4fd5b93fd73b69
6
+ metadata.gz: f8fe541f0d64025037aa127a329fdcc165be9001fc5e918fe27e5c99e592969f42f97468bc7027922c1735ae4e7d2c5286e0f17ec2577d195d83b7e9b377c238
7
+ data.tar.gz: e811288c74181163b8f67f3c9f4e62edf69e21d42af1f587aae98f292ee6aabd73ca7f33b7a733cc9fa9e7f0a2aab3d1dfb398c2d6fb87f753f479dc94c57d61
@@ -28,7 +28,7 @@ class Ghee
28
28
  class Proxy < ::Ghee::ResourceProxy
29
29
  def collaborators(user=nil, &block)
30
30
  prefix = build_prefix user, "collaborators"
31
- return (!user.is_a?(Hash) and number) ? connection.get(prefix).status == 204 : Collaborators::Proxy.new(connection, prefix, user, &block)
31
+ Collaborators::Proxy.new(connection, prefix, user, &block)
32
32
  end
33
33
  end
34
34
  end
data/lib/ghee/api/orgs.rb CHANGED
@@ -74,6 +74,16 @@ class Ghee
74
74
  prefix = (!name.is_a?(Hash) and name) ? "./repos/#{self["login"]}/#{name}" : "#{path_prefix}/repos"
75
75
  Ghee::API::Repos::Proxy.new(connection,prefix,params)
76
76
  end
77
+
78
+ # User Membership for an org
79
+ #
80
+ # Returns json
81
+ #
82
+
83
+ def memberships(user, &block)
84
+ prefix = "#{path_prefix}/memberships/#{user}"
85
+ Proxy.new(connection, prefix, nil, &block)
86
+ end
77
87
  end
78
88
 
79
89
  # Team by id
@@ -10,6 +10,29 @@ class Ghee
10
10
  #
11
11
  module Users
12
12
 
13
+ #Users::Memberships modules handles a users memberships
14
+ #
15
+ #
16
+ module Memberships
17
+
18
+ # Memberships::Proxy inherits from Ghee::Proxy and
19
+ # enables defining methods on the proxy object
20
+ #
21
+ class Proxy < ::Ghee::ResourceProxy
22
+
23
+ #Org membership for the user
24
+ #
25
+ #State: string to limit scope to either active or
26
+ #pending
27
+ #
28
+ #Returns json
29
+ def orgs(state, &block)
30
+ params = state ? {state: state} : {}
31
+ connection.get("#{path_prefix}/orgs", params, &block)
32
+ end
33
+ end
34
+ end
35
+
13
36
  # Users::Proxy inherits from Ghee::Proxy and
14
37
  # enables defining methods on the proxy object
15
38
  #
@@ -47,7 +70,11 @@ class Ghee
47
70
  Ghee::API::Orgs::Proxy.new(connection, prefix, params)
48
71
  end
49
72
 
50
-
73
+ # Returns a Memberships Proxy
74
+ def memberships
75
+ prefix = "#{path_prefix}/memberships"
76
+ Ghee::API::Users::Memberships::Proxy.new(connection, prefix)
77
+ end
51
78
  end
52
79
 
53
80
  # Get authenticated user
data/lib/ghee/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  class Ghee
3
- VERSION = "0.10.15"
3
+ VERSION = "0.11.16"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.15
4
+ version: 0.11.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Rauh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-20 00:00:00.000000000 Z
12
+ date: 2015-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday