tinder 0.1.5 → 0.1.6
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 +4 -0
- data/lib/tinder/campfire.rb +0 -5
- data/lib/tinder/room.rb +21 -14
- data/lib/tinder/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
0.1.6 - 2008-03-07
|
2
|
+
* Added Room#topic for getting the current topic [Even Weaver]
|
3
|
+
* Trap INT in #listen(&block) [borrowed from Chris Shea's Pyre]
|
4
|
+
|
1
5
|
0.1.5 - 2008-01-25
|
2
6
|
* Fixed Room#listen, which was broken by latest Campfire deploy
|
3
7
|
* Fixed timeout when listening but not speaking that will eventually log you out [Clinton R. Nixon]
|
data/lib/tinder/campfire.rb
CHANGED
@@ -89,11 +89,6 @@ module Tinder
|
|
89
89
|
room ? transcripts[room.to_s] : transcripts
|
90
90
|
end
|
91
91
|
|
92
|
-
# Deprecated: only included for backwards compatability
|
93
|
-
def host #:nodoc:
|
94
|
-
uri.host
|
95
|
-
end
|
96
|
-
|
97
92
|
# Is the connection to campfire using ssl?
|
98
93
|
def ssl?
|
99
94
|
uri.scheme == 'https'
|
data/lib/tinder/room.rb
CHANGED
@@ -65,6 +65,16 @@ module Tinder
|
|
65
65
|
topic if verify_response(post("room/#{id}/change_topic", { 'room' => { 'topic' => topic }}, :ajax => true), :success)
|
66
66
|
end
|
67
67
|
|
68
|
+
# Get the current topic
|
69
|
+
def topic
|
70
|
+
join
|
71
|
+
h = (Hpricot(@room.body)/"#topic")
|
72
|
+
if h
|
73
|
+
(h/:span).remove
|
74
|
+
h.inner_text.strip
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
68
78
|
# Lock the room to prevent new users from entering and to disable logging
|
69
79
|
def lock
|
70
80
|
verify_response(post("room/#{id}/lock", {}, :ajax => true), :success)
|
@@ -123,10 +133,13 @@ module Tinder
|
|
123
133
|
def listen(interval = 5)
|
124
134
|
join
|
125
135
|
if block_given?
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
136
|
+
catch(:stop_listening) do
|
137
|
+
trap('INT') { throw :stop_listening }
|
138
|
+
loop do
|
139
|
+
ping
|
140
|
+
self.messages.each {|msg| yield msg }
|
141
|
+
sleep interval
|
142
|
+
end
|
130
143
|
end
|
131
144
|
else
|
132
145
|
self.messages
|
@@ -188,16 +201,10 @@ module Tinder
|
|
188
201
|
end
|
189
202
|
end
|
190
203
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
def get(*args)
|
196
|
-
@campfire.send :get, *args
|
197
|
-
end
|
198
|
-
|
199
|
-
def verify_response(*args)
|
200
|
-
@campfire.send :verify_response, *args
|
204
|
+
[:post, :get, :verify_response].each do |method|
|
205
|
+
define_method method do |*args|
|
206
|
+
@campfire.send method, *args
|
207
|
+
end
|
201
208
|
end
|
202
209
|
|
203
210
|
end
|
data/lib/tinder/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-03-07 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -37,7 +37,7 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.5.1
|
41
41
|
version:
|
42
42
|
description: An API for interfacing with Campfire, the 37Signals chat application.
|
43
43
|
email: brandon@opensoul.org
|