camper_van 0.0.5 → 0.0.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/Gemfile.lock +1 -1
- data/lib/camper_van/channel.rb +3 -2
- data/lib/camper_van/version.rb +1 -1
- data/spec/camper_van/channel_spec.rb +12 -2
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/lib/camper_van/channel.rb
CHANGED
@@ -361,8 +361,9 @@ module CamperVan
|
|
361
361
|
# client.numeric_reply :rpl_topic, channel, ':' + message.body
|
362
362
|
|
363
363
|
when "Upload"
|
364
|
-
|
365
|
-
|
364
|
+
room.connection.http(:get, "/room/#{message.room_id}/messages/#{message.id}/upload.json") do |data|
|
365
|
+
client.campfire_reply :privmsg, name, channel, ":\01ACTION uploaded " + data[:upload][:full_url]
|
366
|
+
end
|
366
367
|
|
367
368
|
when "Tweet"
|
368
369
|
# stringify keys since campfire API is inconsistent about it
|
data/lib/camper_van/version.rb
CHANGED
@@ -26,6 +26,8 @@ describe CamperVan::Channel do
|
|
26
26
|
attr_writer :users, :topic, :locked, :full, :open_to_guests
|
27
27
|
attr_writer :stream
|
28
28
|
|
29
|
+
attr_accessor :connection
|
30
|
+
|
29
31
|
def initialize
|
30
32
|
@users = []
|
31
33
|
@sent = []
|
@@ -455,8 +457,16 @@ describe CamperVan::Channel do
|
|
455
457
|
end
|
456
458
|
|
457
459
|
it "sends a message containing the upload link when a user uploads a file" do
|
458
|
-
|
459
|
-
|
460
|
+
conn = Class.new do
|
461
|
+
def http(method, url)
|
462
|
+
raise "bad method #{method}" unless method == :get
|
463
|
+
raise "bad url #{url}" unless url == "/room/456/messages/1234/upload.json"
|
464
|
+
yield :upload => {:full_url => "filename"}
|
465
|
+
end
|
466
|
+
end.new
|
467
|
+
@room.connection = conn
|
468
|
+
@channel.map_message_to_irc msg("Upload", :body => "filename", :room_id => 456)
|
469
|
+
@client.sent.last.must_match %r(:joe\S+ PRIVMSG #test .* filename)
|
460
470
|
end
|
461
471
|
|
462
472
|
it "sends a message containing the tweet url when a user posts a tweet" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: camper_van
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
version: '0'
|
151
151
|
segments:
|
152
152
|
- 0
|
153
|
-
hash:
|
153
|
+
hash: 3878281362238996625
|
154
154
|
requirements: []
|
155
155
|
rubyforge_project: camper_van
|
156
156
|
rubygems_version: 1.8.24
|