tinder 1.4.2 → 1.4.3

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/CHANGELOG.txt CHANGED
@@ -1,3 +1,7 @@
1
+ 1.4.3 - 2010-12-07
2
+ * explicitly require 'uri'
3
+ * added Room#tweet(url)
4
+
1
5
  1.4.2 - 2010-11-13
2
6
  * Use Faraday instead of HTTParty [eric]
3
7
  * Fix file uploads [eric]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.2
1
+ 1.4.3
@@ -1,3 +1,4 @@
1
+ require 'uri'
1
2
  require 'faraday'
2
3
 
3
4
  module Tinder
data/lib/tinder/room.rb CHANGED
@@ -81,6 +81,10 @@ module Tinder
81
81
  send_message(sound, 'SoundMessage')
82
82
  end
83
83
 
84
+ def tweet(url)
85
+ send_message(url, 'TweetMessage')
86
+ end
87
+
84
88
  # Get the list of users currently chatting for this room
85
89
  def users
86
90
  reload!
@@ -188,47 +192,48 @@ module Tinder
188
192
  get(:uploads)['uploads'].map { |u| u['full_url'] }
189
193
  end
190
194
 
191
- protected
192
- def load
193
- reload! unless @loaded
194
- end
195
+ protected
195
196
 
196
- def reload!
197
- attributes = connection.get("/room/#{@id}.json")['room']
197
+ def load
198
+ reload! unless @loaded
199
+ end
198
200
 
199
- @id = attributes['id']
200
- @name = attributes['name']
201
- @topic = attributes['topic']
202
- @full = attributes['full']
203
- @open_to_guests = attributes['open_to_guests']
204
- @active_token_value = attributes['active_token_value']
205
- @users = attributes['users']
201
+ def reload!
202
+ attributes = connection.get("/room/#{@id}.json")['room']
206
203
 
207
- @loaded = true
208
- end
204
+ @id = attributes['id']
205
+ @name = attributes['name']
206
+ @topic = attributes['topic']
207
+ @full = attributes['full']
208
+ @open_to_guests = attributes['open_to_guests']
209
+ @active_token_value = attributes['active_token_value']
210
+ @users = attributes['users']
209
211
 
210
- def send_message(message, type = 'TextMessage')
211
- post 'speak', {:message => {:body => message, :type => type}}
212
- end
212
+ @loaded = true
213
+ end
213
214
 
214
- def get(action)
215
- connection.get(room_url_for(action))
216
- end
215
+ def send_message(message, type = 'TextMessage')
216
+ post 'speak', {:message => {:body => message, :type => type}}
217
+ end
217
218
 
218
- def post(action, body = nil)
219
- connection.post(room_url_for(action), body)
220
- end
219
+ def get(action)
220
+ connection.get(room_url_for(action))
221
+ end
221
222
 
222
- def raw_post(action, body = nil)
223
- connection.raw_post(room_url_for(action), body)
224
- end
223
+ def post(action, body = nil)
224
+ connection.post(room_url_for(action), body)
225
+ end
225
226
 
226
- def room_url_for(action)
227
- "/room/#{@id}/#{action}.json"
228
- end
227
+ def raw_post(action, body = nil)
228
+ connection.raw_post(room_url_for(action), body)
229
+ end
229
230
 
230
- def connection
231
- @connection
232
- end
231
+ def room_url_for(action)
232
+ "/room/#{@id}/#{action}.json"
233
+ end
234
+
235
+ def connection
236
+ @connection
237
+ end
233
238
  end
234
239
  end
data/tinder.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{tinder}
8
- s.version = "1.4.2"
8
+ s.version = "1.4.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brandon Keepers"]
12
- s.date = %q{2010-11-13}
12
+ s.date = %q{2010-12-07}
13
13
  s.description = %q{A Ruby API for interfacing with Campfire, the 37Signals chat application.}
14
14
  s.email = %q{brandon@opensoul.org}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 4
8
- - 2
9
- version: 1.4.2
8
+ - 3
9
+ version: 1.4.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Brandon Keepers
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-13 00:00:00 -06:00
17
+ date: 2010-12-07 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency