camper_van 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- camper_van (0.0.6)
4
+ camper_van (0.0.7)
5
5
  eventmachine (~> 0.12.10)
6
6
  firering (~> 1.2.0)
7
7
  logging (~> 1.5.1)
@@ -56,7 +56,7 @@ module CamperVan
56
56
  client.user_reply :join, ":#{channel}"
57
57
 
58
58
  # current topic
59
- client.numeric_reply :rpl_topic, channel, ':' + room.topic
59
+ client.numeric_reply :rpl_topic, channel, ':' + (room.topic || "")
60
60
 
61
61
  # List the current users, which must always include myself
62
62
  # (race condition, server may not realize the user has joined yet)
@@ -366,12 +366,7 @@ module CamperVan
366
366
  end
367
367
 
368
368
  when "Tweet"
369
- # stringify keys since campfire API is inconsistent about it
370
- tweet = stringify_keys(YAML.load(message.body))
371
- client.campfire_reply :privmsg, name, channel,
372
- "@#{tweet["author_username"]}: #{tweet["message"]}" +
373
- " (https://twitter.com/#{tweet["author_username"]}" +
374
- "/status/#{tweet["id"]})"
369
+ client.campfire_reply :privmsg, name, channel, message.body
375
370
 
376
371
  else
377
372
  logger.warn "unknown message #{message.type}: #{message.body}"
@@ -1,3 +1,3 @@
1
1
  module CamperVan
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -92,6 +92,12 @@ describe CamperVan::Channel do
92
92
  @client.sent[1].must_equal ":camper_van 332 nathan #test :the topic"
93
93
  end
94
94
 
95
+ it "sends the topic as a command even if the topic is nil" do
96
+ @room.topic = nil
97
+ @channel.join
98
+ @client.sent[1].must_equal ":camper_van 332 nathan #test :"
99
+ end
100
+
95
101
  it "sends the list of users" do
96
102
  @room.users = [
97
103
  OpenStruct.new(:id => 10, :name => "Nathan", :email_address => "x@y.com"),
@@ -470,24 +476,8 @@ describe CamperVan::Channel do
470
476
  end
471
477
 
472
478
  it "sends a message containing the tweet url when a user posts a tweet" do
473
- body = {
474
- "id" => 12345,
475
- "author_username" => "aniero",
476
- "message" => "hello, twitter",
477
- "author_avatar_url" => "http://example.com/url.img"
478
- }
479
- @channel.map_message_to_irc msg("Tweet", :body => body.to_yaml)
480
- @client.sent.last.must_match %r(:joe\S+ PRIVMSG #test .*twitter.com/aniero/status/12345.*)
481
- end
482
-
483
- it "sends a message containing the tweet url when a user posts a tweet with symbols" do
484
- body = {
485
- :id => 12345,
486
- :author_username => "aniero",
487
- :message => "hello, twitter",
488
- :author_avatar_url => "http://example.com/url.img"
489
- }
490
- @channel.map_message_to_irc msg("Tweet", :body => body.to_yaml)
479
+ body = "hello world -- @author, twitter.com/aniero/status/12345.*"
480
+ @channel.map_message_to_irc msg("Tweet", :body => body)
491
481
  @client.sent.last.must_match %r(:joe\S+ PRIVMSG #test .*twitter.com/aniero/status/12345.*)
492
482
  end
493
483
 
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.6
4
+ version: 0.0.7
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-10-28 00:00:00.000000000 Z
12
+ date: 2013-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
@@ -150,10 +150,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  segments:
152
152
  - 0
153
- hash: 3878281362238996625
153
+ hash: -442402109143344785
154
154
  requirements: []
155
155
  rubyforge_project: camper_van
156
- rubygems_version: 1.8.24
156
+ rubygems_version: 1.8.23
157
157
  signing_key:
158
158
  specification_version: 3
159
159
  summary: An IRC to Campfire bridge