yammer-client 0.1.4 → 0.1.5

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.
data.tar.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yammer-client (0.1.4)
4
+ yammer-client (0.1.5)
5
5
  addressable (~> 2.3.3)
6
6
  multi_json (~> 1.3)
7
7
  oj (~> 2.0.10)
@@ -1,20 +1,21 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIDMjCCAhqgAwIBAgIBADANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAh0aWFi
2
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAh0aWFi
3
3
  YXNuazEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
- MB4XDTEzMDQyOTA0MTkwMFoXDTE0MDQyOTA0MTkwMFowPzERMA8GA1UEAwwIdGlh
4
+ MB4XDTEzMDMwMzA2MjAxNVoXDTE0MDMwMzA2MjAxNVowPzERMA8GA1UEAwwIdGlh
5
5
  YmFzbmsxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
6
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMWly4vv32/qfYWuiRJq
7
- /x9CDRpdQ2JFwRiiKA6hjWjkpvYwgssfAVNJcwYSyVWkvRF8wp3UjpWqq+W3zGwR
8
- XHtKysmt8CZl7Y+JdcltSuaRuZljwN37RPnFg7gGHUfhS4klm6s8csvawLzi50eH
9
- 6M/7AeKmYS7sRFQoVR0tfHxq+e5uqo47Qus+aLNFU/bgYJeAhZlYHeU0ANZIp3ig
10
- HRfYE3zz3CA+LffxQ0UXwiySLgUUsdX1Gtv/7AjoLu6v3GS0lbN9o357b0n7fXym
11
- A5iMUeygRZryvLab9kz1YuwgOgx6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RpYWJhc25rQGdtYWlsLmNv
14
+ bTAdBgNVHRIEFjAUgRJ0aWFiYXNua0BnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQAD
15
+ ggEBAEGb4gRDulJ9jkf5oRLydfw9UZi6fVWj6aaiJfbbT5NLotpVaWnWdCOO7hy8
16
+ HDPYWN430zLwr0ODOU9XNueKnEkhnBRiYkcQ0JmYddPkL57kp0qlH4g2IqQfQV2W
17
+ 1b7sE410zFHn55B5nihQY3c0MMSL7wq9Dz2EktbIMikf6sG6zfUgYFE4IQGi2RbO
18
+ xa5fnTWt7KB5DD02HnHLTZ9Hl2kxlPyWwyjREwNwEjPoSUJFEBiosvAml8frUDA9
19
+ j6fATg/4fqpgILPVqFIGZOMJDFcJy/oehwwxLu5XMx88WFD9jT1vRj77D7iPLbXd
20
+ rfGs/qCJKgifXd/1am5hlAH5jXU=
21
+ -----END CERTIFICATE-----
@@ -23,7 +23,7 @@ module Yammer
23
23
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
24
24
  # @return [Yammer::ApiResponse]
25
25
  # @param id [Integer] the group ID
26
- # @example Fetch data for the thread
26
+ # @example Fetch data for specified group
27
27
  # Yammer.get_group(74)
28
28
  def get_group(id)
29
29
  get("/api/v1/groups/#{id}")
@@ -39,8 +39,8 @@ module Yammer
39
39
  # @option opts [String] :description
40
40
  # @option opts [Boolean] :private
41
41
  # @option opts [Boolean] :show_in_directory
42
- # @example Fetch data for the thread
43
- # Yammer.create_group(74)
42
+ # @example Create a new public group
43
+ # Yammer.create_group(:name => "new group name", :private => "false")
44
44
  def create_group(opts={})
45
45
  post("/api/v1/groups", opts)
46
46
  end
@@ -56,7 +56,7 @@ module Yammer
56
56
  # @option opts [String] :description
57
57
  # @option opts [Boolean] :private
58
58
  # @option opts [Boolean] :show_in_directory
59
- # @example Fetch data for the thread
59
+ # @example Update data for a given group
60
60
  # Yammer.update_group(74, :name => "new group name")
61
61
  def update_group(id, opts={})
62
62
  post("/api/v1/groups/#{id}", opts)
@@ -67,8 +67,8 @@ module Yammer
67
67
  # @authentication Requires user context
68
68
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
69
69
  # @return [Yammer::ApiResponse]
70
- # @param id [Integer] the group ID
71
- # @example Fetch data for the thread
70
+ # @param id [Integer] the user ID
71
+ # @example Fetch groups for a given user
72
72
  # Yammer.groups_for_user(74)
73
73
  def groups_for_user(id)
74
74
  get("/api/v1/groups/for_user/#{id}")
@@ -2,7 +2,7 @@ module Yammer
2
2
  module Api
3
3
  module GroupMembership
4
4
 
5
- # @see https://developer.yammer.com/restapi/#rest-groups
5
+ # @see https://developer.yammer.com/restapi/#rest-group_memberships
6
6
  # @api_path /api/v1/group_memberships/id
7
7
  # @rate_limited Yes
8
8
  # @authentication Requires user context
@@ -8,11 +8,19 @@ module Yammer
8
8
  # @authentication Requires user context
9
9
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
10
10
  # @return [Yammer::ApiResponse]
11
- # @param [Hash] opts the options to fetch a thread with
12
- # @option opts [Integer] :newer_than
13
- # @example Fetch data for the thread
14
- # Yammer.create_message()
15
- def create_message(opts={})
11
+ # @param body [String] Message body
12
+ # @param [Hash] opts the options to create a message with
13
+ # @option opts [Integer] :cc
14
+ # @option opts [Integer] :replied_to_id
15
+ # @option opts [Integer] :group_id
16
+ # @option opts [Array<Integer>] :direct_to_user_ids
17
+ # @option opts [Array<Integer>] :pending_attachment_ids
18
+ # @example Create a new message
19
+ # msg1 = Yammer.create_message('what are you workings on?')
20
+ #
21
+ # msg2 = Yammer.create_message('building a yammer client', :replied_to_id => msg.id)
22
+ def create_message(body, opts={})
23
+ opts[:body] = body
16
24
  post("/api/v1/messages", opts)
17
25
  end
18
26
 
@@ -20,15 +28,14 @@ module Yammer
20
28
  # @api_path /api/v1/messages
21
29
  # @rate_limited Yes
22
30
  # @authentication Requires user context
23
- # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
31
+ # @raise [Yammer::Error::BadRequest] Error raised when you try to delete a message that
32
+ # you did not create
24
33
  # @return [Yammer::ApiResponse]
25
34
  # @param id [Integer] the thread ID
26
- # @param [Hash] opts the options to fetch a thread with
27
- # @option opts [Integer] :newer_than
28
- # @example Fetch data for the thread
29
- # Yammer.delete_message
30
- def delete_message(id, opts={})
31
- post("/api/v1/messages/#{id}", opts)
35
+ # @example Delete an existing message
36
+ # result = Yammer.delete_message(1)
37
+ def delete_message(id)
38
+ delete("/api/v1/messages/#{id}")
32
39
  end
33
40
 
34
41
  # @see https://developer.yammer.com/restapi/#rest-messages
@@ -37,13 +44,11 @@ module Yammer
37
44
  # @authentication Requires user context
38
45
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
39
46
  # @return [Yammer::ApiResponse]
40
- # @param id [Integer] the thread ID
41
- # @param [Hash] opts the options to fetch a thread with
42
- # @option opts [Integer] :newer_than
43
- # @example Fetch data for the thread
44
- # Yammer.get_message
45
- def get_message(id, opts={})
46
- get("/api/v1/messages/#{id}", opts)
47
+ # @param id [Integer] the ID of the message to be fetched
48
+ # @example Fetch an existing message
49
+ # msg = Yammer.get_message(3)
50
+ def get_message(id)
51
+ get("/api/v1/messages/#{id}")
47
52
  end
48
53
 
49
54
  # @see https://developer.yammer.com/restapi/#rest-messages
@@ -52,10 +57,10 @@ module Yammer
52
57
  # @authentication Requires user context
53
58
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
54
59
  # @return [Yammer::ApiResponse]
55
- # @param [Hash] opts the options to fetch a thread with
60
+ # @param [Hash] opts the options to fetch the messages with
56
61
  # @option opts [Integer] :newer_than
57
- # @example Fetch data for the thread
58
- # Yammer.all_messages
62
+ # @example Fetch a list of messages from the company feed
63
+ # msgs = Yammer.all_messages
59
64
  def all_messages(opts={})
60
65
  get("/api/v1/messages", opts)
61
66
  end
@@ -66,10 +71,10 @@ module Yammer
66
71
  # @authentication Requires user context
67
72
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
68
73
  # @return [Yammer::ApiResponse]
69
- # @param [Hash] opts the options to fetch a thread with
74
+ # @param [Hash] opts the options to fetch the messages with
70
75
  # @option opts [Integer] :newer_than
71
- # @example Fetch data for the thread
72
- # Yammer.messages_sent
76
+ # @example Fetch list messages sent by authenticated user
77
+ # msgs = Yammer.messages_sent
73
78
  def messages_sent(opts={})
74
79
  get("/api/v1/messages/sent", opts)
75
80
  end
@@ -80,10 +85,10 @@ module Yammer
80
85
  # @authentication Requires user context
81
86
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
82
87
  # @return [Yammer::ApiResponse]
83
- # @param [Hash] opts the options to fetch a thread with
88
+ # @param [Hash] opts the options to fetch the messages with
84
89
  # @option opts [Integer] :newer_than
85
- # @example Fetch data for the thread
86
- # Yammer.messages_received
90
+ # @example Fetch list of messages sent to authenitcated user
91
+ # msgs = Yammer.messages_received
87
92
  def messages_received(opts={})
88
93
  get("/api/v1/messages/received", opts)
89
94
  end
@@ -94,10 +99,10 @@ module Yammer
94
99
  # @authentication Requires user context
95
100
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
96
101
  # @return [Yammer::ApiResponse]
97
- # @param [Hash] opts the options to fetch a thread with
102
+ # @param [Hash] opts the options to fetch the messages with
98
103
  # @option opts [Integer] :newer_than
99
- # @example Fetch data for the thread
100
- # Yammer.private_messages
104
+ # @example Fetch a list of private messages sent to authenitcated user
105
+ # msgs = Yammer.private_messages
101
106
  def private_messages(opts={})
102
107
  get("/api/v1/messages/private", opts)
103
108
  end
@@ -108,10 +113,10 @@ module Yammer
108
113
  # @authentication Requires user context
109
114
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
110
115
  # @return [Yammer::ApiResponse]
111
- # @param [Hash] opts the options to fetch a thread with
116
+ # @param [Hash] opts the options to fetch the messages with
112
117
  # @option opts [Integer] :newer_than
113
- # @example Fetch data for the thread
114
- # Yammer.followed_messages
118
+ # @example Fetch a list of messages being followed by authenitcated user
119
+ # msgs = Yammer.followed_messages
115
120
  def followed_messages(opts={})
116
121
  get("/api/v1/messages/following", opts)
117
122
  end
@@ -122,11 +127,11 @@ module Yammer
122
127
  # @authentication Requires user context
123
128
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
124
129
  # @return [Yammer::ApiResponse]
125
- # @param id [Integer] the thread ID
126
- # @param [Hash] opts the options to fetch a thread with
130
+ # @param id [Integer] the ID of the user whose public messages we want to look at
131
+ # @param [Hash] opts the options to fetch the messages with
127
132
  # @option opts [Integer] :newer_than
128
- # @example Fetch data for the thread
129
- # Yammer.messages_from_user
133
+ # @example Fetch a list of messages sent by a user in the authenticated user's network
134
+ # msgs = Yammer.messages_from_user(8)
130
135
  def messages_from_user(id, opts={})
131
136
  get("/api/v1/messages/from_user/#{id}", opts)
132
137
  end
@@ -137,11 +142,11 @@ module Yammer
137
142
  # @authentication Requires user context
138
143
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
139
144
  # @return [Yammer::ApiResponse]
140
- # @param id [Integer] the thread ID
141
- # @param [Hash] opts the options to fetch a thread with
145
+ # @param id [Integer] the topic ID
146
+ # @param [Hash] opts the options to fetch the messages with
142
147
  # @option opts [Integer] :newer_than
143
- # @example Fetch data for the thread
144
- # Yammer.messages_about_topic
148
+ # @example Fetch messages that have been tagged with a given topic
149
+ # msgs = Yammer.messages_about_topic(1)
145
150
  def messages_about_topic(id, opts={})
146
151
  get("/api/v1/messages/about_topic/#{id}", opts)
147
152
  end
@@ -152,11 +157,11 @@ module Yammer
152
157
  # @authentication Requires user context
153
158
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
154
159
  # @return [Yammer::ApiResponse]
155
- # @param id [Integer] the thread ID
156
- # @param [Hash] opts the options to fetch a thread with
160
+ # @param id [Integer] the ID of the group whose messages you wish to fetch
161
+ # @param [Hash] opts the options to fetch the messages with
157
162
  # @option opts [Integer] :newer_than
158
- # @example Fetch data for the thread
159
- # Yammer.messages_in_group
163
+ # @example Fetch a list of messages in a given group
164
+ # msgs = Yammer.messages_in_group(38)
160
165
  def messages_in_group(id, opts={})
161
166
  get("/api/v1/messages/in_group/#{id}", opts)
162
167
  end
@@ -167,11 +172,11 @@ module Yammer
167
172
  # @authentication Requires user context
168
173
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
169
174
  # @return [Yammer::ApiResponse]
170
- # @param id [Integer] the thread ID
171
- # @param [Hash] opts the options to fetch a thread with
175
+ # @param id [Integer] the ID of the user for whom you wish to get a list of messages they have liked
176
+ # @param [Hash] opts the options to fetch the messages with
172
177
  # @option opts [Integer] :newer_than
173
- # @example Fetch data for the thread
174
- # Yammer.messages_liked_by
178
+ # @example Fetch a list of messages liked by a given user
179
+ # msgs = Yammer.messages_liked_by(4)
175
180
  def messages_liked_by(id, opts={})
176
181
  get("/api/v1/messages/liked_by/#{id}", opts)
177
182
  end
@@ -183,10 +188,10 @@ module Yammer
183
188
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
184
189
  # @return [Yammer::ApiResponse]
185
190
  # @param id [Integer] the thread ID
186
- # @param [Hash] opts the options to fetch a thread with
191
+ # @param [Hash] opts the options to fetch the messages with
187
192
  # @option opts [Integer] :newer_than
188
- # @example Fetch data for the thread
189
- # Yammer.messages_in_thread
193
+ # @example Fetch a list of messages in a given thread
194
+ # msgs = Yammer.messages_in_thread(10)
190
195
  def messages_in_thread(id, opts={})
191
196
  get("/api/v1/messages/in_thread/#{id}", opts)
192
197
  end
@@ -11,7 +11,7 @@ module Yammer
11
11
  # @param [Hash] opts the options to fetch a thread with
12
12
  # @option opts [Boolean] :include_suspended
13
13
  # @option opts [Boolean] :exclude_own_messages_from_unseen
14
- # @example Fetch data for the thread
14
+ # @example Fetch all networks that the current user is a member of
15
15
  # Yammer.current_networks
16
16
  def current_networks(opts={})
17
17
  get('/api/v1/networks/current', opts)
@@ -2,7 +2,7 @@ module Yammer
2
2
  module Api
3
3
  module Notification
4
4
 
5
- # @see https://developer.yammer.com/restapi/#rest-search
5
+ # @see https://developer.yammer.com/restapi/#rest-notifications
6
6
  # @api_path /api/v1/streams/notifications
7
7
  # @rate_limited Yes
8
8
  # @authentication authenticated user context
@@ -18,8 +18,8 @@ module Yammer
18
18
  # @option opts [String] :model_types
19
19
  # @option opts [String] :search_startdate
20
20
  # @option opts [String] :search_enddate
21
- # @example Fetch data for the thread
22
- # Yammer.search(:search => 'money power women')
21
+ # @example Search for a particular term on within current user's network
22
+ # Yammer.search(:search => 'documents')
23
23
  def search(opts={})
24
24
  get('/api/v1/search', opts)
25
25
  end
@@ -2,7 +2,7 @@ module Yammer
2
2
  module Api
3
3
  module Thread
4
4
 
5
- # @see https://developer.yammer.com/restapi/#rest-users
5
+ # @see https://developer.yammer.com/restapi/#rest-threads
6
6
  # @api_path /api/v1/threads/id
7
7
  # @rate_limited Yes
8
8
  # @authentication Requires user context
@@ -2,15 +2,17 @@ module Yammer
2
2
  module Api
3
3
  module Topic
4
4
 
5
- # @see https://developer.yammer.com/restapi/#rest-users
5
+ # @see https://developer.yammer.com/restapi/#rest-topics
6
6
  # @api_path /api/v1/topics
7
7
  # @rate_limited Yes
8
8
  # @authentication Requires user context
9
- # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
9
+ # @raise [Yammer::Error::Unauthorized] Error raised when supplied
10
+ # user credentials are not valid.
10
11
  # @return [Yammer::ApiResponse]
11
12
  # @param id [Integer]
12
13
  # @param [Hash] opts the options to fetch a thread with
13
- # @option opts [Integer] :is_followed_by
14
+ # @option opts [Integer] :is_followed_by include if specified user
15
+ # is following topic that is being fetched
14
16
  # @example Fetch data for the thread
15
17
  # Yammer.get_topic(42, :is_followed_by => 2)
16
18
  def get_topic(id, opts={})
@@ -132,8 +132,7 @@ module Yammer
132
132
  # @authentication Requires user context
133
133
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
134
134
  # @return [Yammer::ApiResponse]
135
- # @param opts [Hash] A customizable set of opts.
136
- # @option opts [Boolean] :full
135
+ # @param id [Integer] the ID of the user whose followers you want to get
137
136
  # @example Fetch users from the authenticated user's network following user whose ID is provided
138
137
  # Yammer.users_following(1)
139
138
  def users_following(id)
@@ -144,8 +143,7 @@ module Yammer
144
143
  # @authentication Requires user context
145
144
  # @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
146
145
  # @return [Yammer::ApiResponse]
147
- # @param opts [Hash] A customizable set of opts.
148
- # @option opts [Boolean] :full
146
+ # @param id [Integer] the ID of the user for whom you want to get the users being followed
149
147
  # @example Fetch users from the authenticated user's network followed by the user whose ID is provided
150
148
  # Yammer.users_followed(1)
151
149
  def users_followed_by(id)
@@ -4,6 +4,7 @@ require 'yammer/http_adapter'
4
4
 
5
5
  module Yammer
6
6
  class Client
7
+
7
8
  include Yammer::Configurable
8
9
  include Yammer::Api::User
9
10
  include Yammer::Api::Group
@@ -34,26 +35,22 @@ module Yammer
34
35
  end
35
36
  end
36
37
 
37
- # (see #request)
38
- # @note makes a GET request
38
+ # makes a GET request
39
39
  def get(path, params={})
40
40
  request(:get, path, params)
41
41
  end
42
42
 
43
- # (see #request)
44
- # @note makes a PUT request
43
+ # makes a PUT request
45
44
  def put(path, params={})
46
45
  request(:put, path, params)
47
46
  end
48
47
 
49
- # (see #request)
50
- # @note makes a POST request
48
+ # makes a POST request
51
49
  def post(path, params={})
52
50
  request(:post, path, params)
53
51
  end
54
52
 
55
- # (see #request)
56
- # @note makes a DELETE request
53
+ # makes a DELETE request
57
54
  def delete(path, params={})
58
55
  request(:delete, path, params)
59
56
  end
@@ -72,7 +69,6 @@ module Yammer
72
69
  # @param method [string]
73
70
  # @param path [string]
74
71
  # @param params [Hash]
75
- # @param opts [Hash]
76
72
  # @return [Yammer::ApiResponse]
77
73
  # @!visibility private
78
74
  def request(method, path, params={})
@@ -8,9 +8,10 @@ module Yammer
8
8
 
9
9
  attr_reader :replied_to_id
10
10
 
11
+ # Creates a new message
11
12
  # @!scope class
12
- def self.create(params={})
13
- api_handler.create_message(params)
13
+ def self.create(body, params={})
14
+ api_handler.create_message(body, params)
14
15
  end
15
16
 
16
17
  end
@@ -2,7 +2,7 @@ module Yammer
2
2
  class Version
3
3
  MAJOR = 0 unless defined? Yammer::MAJOR
4
4
  MINOR = 1 unless defined? Yammer::MINOR
5
- PATCH = 4 unless defined? Yammer::PATCH
5
+ PATCH = 5 unless defined? Yammer::PATCH
6
6
  PRE = nil unless defined? Yammer::PRE
7
7
 
8
8
  class << self
@@ -16,7 +16,7 @@ describe Yammer::Api::Message do
16
16
  describe '#all_messages' do
17
17
  context 'with options' do
18
18
  it 'should get_messages' do
19
- params = { :page => 1, :letter => 'm' }
19
+ params = { :page => 1 }
20
20
  subject.should_receive(:get).with('/api/v1/messages', params)
21
21
  subject.all_messages(params)
22
22
  end
@@ -32,22 +32,22 @@ describe Yammer::Api::Message do
32
32
 
33
33
  describe '#create_message' do
34
34
  it 'should create_message' do
35
- params = { :body => 'Greetings, we come in peace' }
36
- subject.should_receive(:post).with('/api/v1/messages', params)
37
- subject.create_message(params)
35
+ message = 'Greetings, we come in peace'
36
+ subject.should_receive(:post).with('/api/v1/messages', :body => message)
37
+ subject.create_message(message)
38
38
  end
39
39
  end
40
40
 
41
41
  describe '#message' do
42
42
  it 'should fetch a message' do
43
- subject.should_receive(:get).with('/api/v1/messages/3', {})
43
+ subject.should_receive(:get).with('/api/v1/messages/3')
44
44
  subject.get_message(3)
45
45
  end
46
46
  end
47
47
 
48
48
  describe '#delete_message' do
49
49
  it 'should delete a message' do
50
- subject.should_receive(:post).with('/api/v1/messages/4', {})
50
+ subject.should_receive(:delete).with('/api/v1/messages/4')
51
51
  subject.delete_message(4)
52
52
  end
53
53
  end
@@ -19,7 +19,7 @@ describe Yammer::Message do
19
19
  describe '#create' do
20
20
  it 'creates a new group' do
21
21
  stub_request(:post, "https://www.yammer.com/api/v1/messages").with(
22
- :body => { :name => 'rails team', :privacy => 'public' },
22
+ :body => { :body => 'python not ruby', :privacy => 'public' },
23
23
  :headers => {
24
24
  'Accept' => 'application/json',
25
25
  'Authorization' => "Bearer #{Yammer.access_token}",
@@ -31,7 +31,7 @@ describe Yammer::Message do
31
31
  :body => '',
32
32
  :headers => {'Location' => 'https://www.yammer.com/api/v1/messages/2'}
33
33
  )
34
- subject.create(:name => 'rails team', :privacy => 'public')
34
+ subject.create('python not ruby', :privacy => 'public')
35
35
  end
36
36
  end
37
37
 
metadata CHANGED
@@ -1,175 +1,179 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: yammer-client
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 4
10
- version: 0.1.4
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Kevin Mutyaba
14
9
  autorequire:
15
10
  bindir: bin
16
- cert_chain:
17
- - |
18
- -----BEGIN CERTIFICATE-----
19
- MIIDMjCCAhqgAwIBAgIBADANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAh0aWFi
20
- YXNuazEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
21
- MB4XDTEzMDQyOTA0MTkwMFoXDTE0MDQyOTA0MTkwMFowPzERMA8GA1UEAwwIdGlh
22
- YmFzbmsxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
23
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMWly4vv32/qfYWuiRJq
24
- /x9CDRpdQ2JFwRiiKA6hjWjkpvYwgssfAVNJcwYSyVWkvRF8wp3UjpWqq+W3zGwR
25
- XHtKysmt8CZl7Y+JdcltSuaRuZljwN37RPnFg7gGHUfhS4klm6s8csvawLzi50eH
26
- 6M/7AeKmYS7sRFQoVR0tfHxq+e5uqo47Qus+aLNFU/bgYJeAhZlYHeU0ANZIp3ig
27
- HRfYE3zz3CA+LffxQ0UXwiySLgUUsdX1Gtv/7AjoLu6v3GS0lbN9o357b0n7fXym
28
- A5iMUeygRZryvLab9kz1YuwgOgx6OpyQD8JfO9PZeBKYd9XFlZwp44W7Z1akxcu+
29
- +E8CAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQUt6oHkpfViE/jN5InJLzl
30
- DUxUNR8wCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQBunWeru+ZC1uVt
31
- BZj6230whZIvdvGnvcWW6JGG6JZJljYwOHHnaG+u74qE16Voh3n7rT77obp/Wrmx
32
- HUhp4nK+j1AHpdiZman0RxMZzS2fczev9gTyAs/cmaqgVb3YXXniwvZy4P7y07iT
33
- MIbAh4p4NK72MJrOsepD3qhOgE23o8dyFB3+RTB0U7yv3ZW1sMNDxkliqCBqcrBF
34
- bSEMaRUpbbsivejLXgRsxP5cXYy0Wd9GNSOtQ5932HDEoo0F9nXIMZGQSLqEXz3l
35
- B+kZ9/4dAvmKkr2NPSoxBQtO7Rz0HDNLtjMxkXbQUWMDsGnB6Kk1WUBb/w3kQ9Ah
36
- JgIHF4cG
37
- -----END CERTIFICATE-----
38
-
39
- date: 2013-04-29 00:00:00 Z
40
- dependencies:
41
- - !ruby/object:Gem::Dependency
11
+ cert_chain:
12
+ - !binary |-
13
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURjRENDQWxpZ0F3SUJB
14
+ Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREEvTVJFd0R3WURWUVFEREFoMGFX
15
+ RmkKWVhOdWF6RVZNQk1HQ2dtU0pvbVQ4aXhrQVJrV0JXZHRZV2xzTVJNd0VR
16
+ WUtDWkltaVpQeUxHUUJHUllEWTI5dApNQjRYRFRFek1ETXdNekEyTWpBeE5W
17
+ b1hEVEUwTURNd016QTJN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wVmFXbldkQ09PN2h5OApIRFBZV040
34
+ MzB6THdyME9ET1U5WE51ZUtuRWtobkJSaVlrY1EwSm1ZZGRQa0w1N2twMHFs
35
+ SDRnMklxUWZRVjJXCjFiN3NFNDEwekZIbjU1QjVuaWhRWTNjME1NU0w3d3E5
36
+ RHoyRWt0YklNaWtmNnNHNnpmVWdZRkU0SVFHaTJSYk8KeGE1Zm5UV3Q3S0I1
37
+ REQwMkhuSExUWjlIbDJreGxQeVd3eWpSRXdOd0VqUG9TVUpGRUJpb3N2QW1s
38
+ OGZyVURBOQpqNmZBVGcvNGZxcGdJTFBWcUZJR1pPTUpERmNKeS9vZWh3d3hM
39
+ dTVYTXg4OFdGRDlqVDF2Umo3N0Q3aVBMYlhkCnJmR3MvcUNKS2dpZlhkLzFh
40
+ bTVobEFINWpYVT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
41
+ date: 2013-04-29 00:00:00.000000000 Z
42
+ dependencies:
43
+ - !ruby/object:Gem::Dependency
42
44
  name: oj
43
- prerelease: false
44
- requirement: &id001 !ruby/object:Gem::Requirement
45
+ requirement: !ruby/object:Gem::Requirement
45
46
  none: false
46
- requirements:
47
+ requirements:
47
48
  - - ~>
48
- - !ruby/object:Gem::Version
49
- hash: 27
50
- segments:
51
- - 2
52
- - 0
53
- - 10
49
+ - !ruby/object:Gem::Version
54
50
  version: 2.0.10
55
51
  type: :runtime
56
- version_requirements: *id001
57
- - !ruby/object:Gem::Dependency
58
- name: multi_json
59
52
  prerelease: false
60
- requirement: &id002 !ruby/object:Gem::Requirement
53
+ version_requirements: !ruby/object:Gem::Requirement
61
54
  none: false
62
- requirements:
55
+ requirements:
63
56
  - - ~>
64
- - !ruby/object:Gem::Version
65
- hash: 9
66
- segments:
67
- - 1
68
- - 3
69
- version: "1.3"
57
+ - !ruby/object:Gem::Version
58
+ version: 2.0.10
59
+ - !ruby/object:Gem::Dependency
60
+ name: multi_json
61
+ requirement: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ~>
65
+ - !ruby/object:Gem::Version
66
+ version: '1.3'
70
67
  type: :runtime
71
- version_requirements: *id002
72
- - !ruby/object:Gem::Dependency
73
- name: rest-client
74
68
  prerelease: false
75
- requirement: &id003 !ruby/object:Gem::Requirement
69
+ version_requirements: !ruby/object:Gem::Requirement
76
70
  none: false
77
- requirements:
71
+ requirements:
78
72
  - - ~>
79
- - !ruby/object:Gem::Version
80
- hash: 1
81
- segments:
82
- - 1
83
- - 6
84
- - 7
73
+ - !ruby/object:Gem::Version
74
+ version: '1.3'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rest-client
77
+ requirement: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
85
82
  version: 1.6.7
86
83
  type: :runtime
87
- version_requirements: *id003
88
- - !ruby/object:Gem::Dependency
89
- name: addressable
90
84
  prerelease: false
91
- requirement: &id004 !ruby/object:Gem::Requirement
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ~>
89
+ - !ruby/object:Gem::Version
90
+ version: 1.6.7
91
+ - !ruby/object:Gem::Dependency
92
+ name: addressable
93
+ requirement: !ruby/object:Gem::Requirement
92
94
  none: false
93
- requirements:
95
+ requirements:
94
96
  - - ~>
95
- - !ruby/object:Gem::Version
96
- hash: 5
97
- segments:
98
- - 2
99
- - 3
100
- - 3
97
+ - !ruby/object:Gem::Version
101
98
  version: 2.3.3
102
99
  type: :runtime
103
- version_requirements: *id004
104
- - !ruby/object:Gem::Dependency
105
- name: rake
106
100
  prerelease: false
107
- requirement: &id005 !ruby/object:Gem::Requirement
101
+ version_requirements: !ruby/object:Gem::Requirement
108
102
  none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
- version: "0"
103
+ requirements:
104
+ - - ~>
105
+ - !ruby/object:Gem::Version
106
+ version: 2.3.3
107
+ - !ruby/object:Gem::Dependency
108
+ name: rake
109
+ requirement: !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ! '>='
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
116
115
  type: :development
117
- version_requirements: *id005
118
- - !ruby/object:Gem::Dependency
119
- name: rspec
120
116
  prerelease: false
121
- requirement: &id006 !ruby/object:Gem::Requirement
117
+ version_requirements: !ruby/object:Gem::Requirement
122
118
  none: false
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- hash: 3
127
- segments:
128
- - 0
129
- version: "0"
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ - !ruby/object:Gem::Dependency
124
+ name: rspec
125
+ requirement: !ruby/object:Gem::Requirement
126
+ none: false
127
+ requirements:
128
+ - - ! '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
130
131
  type: :development
131
- version_requirements: *id006
132
- - !ruby/object:Gem::Dependency
133
- name: simplecov
134
132
  prerelease: false
135
- requirement: &id007 !ruby/object:Gem::Requirement
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ none: false
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: simplecov
141
+ requirement: !ruby/object:Gem::Requirement
136
142
  none: false
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- hash: 1
141
- segments:
142
- - 0
143
- - 7
144
- - 1
143
+ requirements:
144
+ - - ! '>='
145
+ - !ruby/object:Gem::Version
145
146
  version: 0.7.1
146
147
  type: :development
147
- version_requirements: *id007
148
- - !ruby/object:Gem::Dependency
149
- name: webmock
150
148
  prerelease: false
151
- requirement: &id008 !ruby/object:Gem::Requirement
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ none: false
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: 0.7.1
155
+ - !ruby/object:Gem::Dependency
156
+ name: webmock
157
+ requirement: !ruby/object:Gem::Requirement
152
158
  none: false
153
- requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- hash: 51
157
- segments:
158
- - 1
159
- - 9
160
- - 0
159
+ requirements:
160
+ - - ! '>='
161
+ - !ruby/object:Gem::Version
161
162
  version: 1.9.0
162
163
  type: :development
163
- version_requirements: *id008
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ none: false
167
+ requirements:
168
+ - - ! '>='
169
+ - !ruby/object:Gem::Version
170
+ version: 1.9.0
164
171
  description: A Ruby wrapper for accessing Yammer's REST API
165
172
  email: tiabasnk@gmail.com
166
173
  executables: []
167
-
168
174
  extensions: []
169
-
170
175
  extra_rdoc_files: []
171
-
172
- files:
176
+ files:
173
177
  - .gitignore
174
178
  - .travis.yml
175
179
  - .yardopts
@@ -247,39 +251,32 @@ files:
247
251
  - spec/spec_helper.rb
248
252
  - yammer.gemspec
249
253
  homepage: http://tiabas.github.io/yammer-client
250
- licenses:
254
+ licenses:
251
255
  - MIT
252
- post_install_message: " Thanks for installing! If you like this gem please spread the word "
256
+ post_install_message: ! ' Thanks for installing! If you like this gem please spread
257
+ the word '
253
258
  rdoc_options: []
254
-
255
- require_paths:
259
+ require_paths:
256
260
  - lib
257
- required_ruby_version: !ruby/object:Gem::Requirement
261
+ required_ruby_version: !ruby/object:Gem::Requirement
258
262
  none: false
259
- requirements:
260
- - - ">="
261
- - !ruby/object:Gem::Version
262
- hash: 3
263
- segments:
264
- - 0
265
- version: "0"
266
- required_rubygems_version: !ruby/object:Gem::Requirement
263
+ requirements:
264
+ - - ! '>='
265
+ - !ruby/object:Gem::Version
266
+ version: '0'
267
+ required_rubygems_version: !ruby/object:Gem::Requirement
267
268
  none: false
268
- requirements:
269
- - - ">="
270
- - !ruby/object:Gem::Version
271
- hash: 3
272
- segments:
273
- - 0
274
- version: "0"
269
+ requirements:
270
+ - - ! '>='
271
+ - !ruby/object:Gem::Version
272
+ version: '0'
275
273
  requirements: []
276
-
277
274
  rubyforge_project:
278
- rubygems_version: 1.8.24
275
+ rubygems_version: 1.8.25
279
276
  signing_key:
280
277
  specification_version: 3
281
278
  summary: Yammer API Client - beta
282
- test_files:
279
+ test_files:
283
280
  - spec/api/autocomplete_spec.rb
284
281
  - spec/api/group_membership_spec.rb
285
282
  - spec/api/group_spec.rb
metadata.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- %ʉN����
2
- ��t�H����@�AXc5a0Hz��[��~H���~R�%���֏�� s ���fJ�n= 2��d[���
3
- k#S��(���d+ ��u��!�j�ȥ+n69��AGS[�\JM�j+1� �!�7 �u�D������48#�ƶA :Q;�݋���/���UD�Y���[�{ ��vF<�_EY3���վ�u(�ʖ�\�h#�e�{Rۛ�$�i�3̙&�����,�) �֚O*7`��
1
+ �/·�E?s��jg�<�YW|�B��k����QtrY/�pF�
2
+ ?*�vo�� = ���!�ͱ�;ջ����U1٫wK���X�xC����4(|<�GY������N���s�ʾ�%���(�+nvv����G�ۘ,�v���n�`�j4.qOdE���j��i�y�}�[7�+T�Ȅ��\1 `.�)Q/��F@>�2w �"��Й�ɯ�9�<3C����>���h��_Bx�