cinch-hangouts 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ module Cinch::Plugins
|
|
24
24
|
# https://plus.google.com/hangouts/_/fbae432b70a47bdf7786e53a16f364895c09d9f8
|
25
25
|
#
|
26
26
|
# The regex will need to be updated if the url scheme changes in the future.
|
27
|
-
HANGOUTS_REGEX = /plus\.google\.com\/hangouts\/_\/([a-
|
27
|
+
HANGOUTS_REGEX = /plus\.google\.com\/hangouts\/_\/([a-z0-9]{10,40})(\?|$)/
|
28
28
|
|
29
29
|
def initialize(*args)
|
30
30
|
super
|
data/spec/cinch-hangouts_spec.rb
CHANGED
@@ -56,6 +56,16 @@ describe Cinch::Plugins::Hangouts do
|
|
56
56
|
reply.should include "test started a hangout at"
|
57
57
|
reply.should match(/it was last linked \d seconds? ago/)
|
58
58
|
end
|
59
|
+
|
60
|
+
it 'should capture a new short Hangout link and store it in @storage' do
|
61
|
+
msg = make_message(@bot, Hangout.url('7acpjrpcmgl00u0b665mu25b1g', false), { :channel => '#foo' })
|
62
|
+
get_replies(msg).should be_empty
|
63
|
+
sleep 1 # hack until 'time-lord' fix gets released
|
64
|
+
msg = make_message(@bot, '!hangouts')
|
65
|
+
reply = get_replies(msg).last.text
|
66
|
+
reply.should include "test started a hangout at"
|
67
|
+
reply.should match(/it was last linked \d seconds? ago/)
|
68
|
+
end
|
59
69
|
end
|
60
70
|
|
61
71
|
describe 'subscriptions' do
|
@@ -106,10 +116,10 @@ describe Cinch::Plugins::Hangouts do
|
|
106
116
|
end
|
107
117
|
end
|
108
118
|
|
109
|
-
def random_hangout_id
|
119
|
+
def random_hangout_id(len = 40)
|
110
120
|
chars = %w{ a b c d e f 0 1 2 3 4 5 6 7 8 9 }
|
111
121
|
string = ''
|
112
|
-
|
122
|
+
len.times { string << chars[rand(chars.length)] }
|
113
123
|
string
|
114
124
|
end
|
115
125
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cinch-hangouts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
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: 2013-
|
12
|
+
date: 2013-10-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|