cinch-hangouts 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45fde4d2a553d57adc0da9c914d4523853acdbae
4
- data.tar.gz: 4ff858cfa515f6f64465cf4cb524ae67c3a53125
3
+ metadata.gz: d59472f61e3eb012d61ac319e212dd3f2efc1bfb
4
+ data.tar.gz: 423e18cda5f5dc8e2557844af72449000055d57a
5
5
  SHA512:
6
- metadata.gz: 8fe3adc17dfe6cd57258170d665a3b68c9944e3078f45c33d6184d51480e4c578f1b31bfaa84e6c416c6a3f1835d9addc3eeceaa4d77749f277fe2b7728e4fad
7
- data.tar.gz: 02e10783b7f9486e16fb7b3498634eb30133f94108721d4dd5dae08ca3018255bc9851c62e8a53af2c82eabf2a0f5d5e56a67f62a6f11bd223022590b3fe03dd
6
+ metadata.gz: f5a1378fce4ab7bf4c9da05605d33091461f017910fcc57a97986a4a7d8c344155fb1f87377ec4980c0e5aa9fb6485262dd118cd072472232ff9dea3bdac6482
7
+ data.tar.gz: 41b3614c4d71c23ab7de801e608afc80304dbfafecc6fd89bb26afa47fb34e68f7d276433cbc410bae6d003ea8a67e12b89b1bef7d2b2bdccfecc9181b8ca96b
@@ -41,16 +41,14 @@ class Hangout < Cinch::Plugins::Hangouts
41
41
  read_file(files).data[:hangouts]
42
42
  end
43
43
 
44
- def self.url(id, shorten = true)
45
- url = "https://plus.google.com/hangouts/_/#{id}"
46
- return url unless shorten
47
- Cinch::Toolbox.shorten(url)
44
+ def self.url(id)
45
+ "https://plus.google.com/hangouts/_/#{id}"
48
46
  end
49
47
 
50
48
  private
51
49
 
52
50
  def self.read_file(files)
53
- fail "No Hangout filename passed" unless files.key?(:hangouts)
51
+ fail "No Hangout filename passed" unless files.key?(:hangouts)
54
52
  storage = Cinch::Storage.new(files[:hangouts])
55
53
  unless storage.data[:hangouts]
56
54
  storage.data[:hangouts] = {}
@@ -3,7 +3,7 @@ module Cinch
3
3
  module Plugins
4
4
  # Versioning Info
5
5
  class Hangouts
6
- VERSION = '1.1.1'
6
+ VERSION = '1.1.2'
7
7
  end
8
8
  end
9
9
  end
@@ -19,16 +19,16 @@ describe Cinch::Plugins::Hangouts do
19
19
 
20
20
  describe 'posting a valid hangout link' do
21
21
  it 'captures the the link and stores it in @storage' do
22
- msg = make_message(@bot, Hangout.url(random_hangout_id, false), { channel: '#foo' })
23
- sleep 2
22
+ msg = make_message(@bot, Hangout.url(random_hangout_id), { channel: '#foo' })
24
23
  get_replies(msg)
24
+ sleep 2
25
25
  reply = get_replies(make_message(@bot, '!hangouts')).last.text
26
26
  expect(reply).to include('test started a hangout at')
27
27
  expect(reply).to match(/it was last linked \d seconds? ago/)
28
28
  end
29
29
 
30
30
  it 'captures even if it has trailing params' do
31
- msg = make_message(@bot, Hangout.url(random_hangout_id + '?hl=en', false),
31
+ msg = make_message(@bot, Hangout.url(random_hangout_id + '?hl=en'),
32
32
  { channel: '#foo' })
33
33
  get_replies(msg)
34
34
  sleep 2 # hack until 'time-lord' fix gets released
@@ -40,7 +40,7 @@ describe Cinch::Plugins::Hangouts do
40
40
 
41
41
  it 'recaptures a link' do
42
42
  id = random_hangout_id
43
- msg = make_message(@bot, Hangout.url(id, false), { channel: '#foo' })
43
+ msg = make_message(@bot, Hangout.url(id), { channel: '#foo' })
44
44
  get_replies(msg)
45
45
  sleep 2 # hack until 'time-lord' fix gets released
46
46
  get_replies(msg)
@@ -50,7 +50,7 @@ describe Cinch::Plugins::Hangouts do
50
50
  end
51
51
 
52
52
  it 'capture a new short Hangout link and store it in @storage' do
53
- msg = make_message(@bot, Hangout.url('7acpjrpcmgl00u0b665mu25b1g', false), { channel: '#foo' })
53
+ msg = make_message(@bot, Hangout.url('7acpjrpcmgl00u0b665mu25b1g'), { channel: '#foo' })
54
54
  expect(get_replies(msg)).to be_empty
55
55
  sleep 2 # hack until 'time-lord' fix gets released
56
56
  msg = make_message(@bot, '!hangouts')
@@ -58,12 +58,25 @@ describe Cinch::Plugins::Hangouts do
58
58
  expect(reply).to include('test started a hangout at')
59
59
  expect(reply).to match(/it was last linked \d seconds? ago/)
60
60
  end
61
+
62
+
63
+ it 'capture a link and return it' do
64
+ url = Hangout.url(random_hangout_id)
65
+ msg = make_message(@bot, url, { channel: '#foo' })
66
+ expect(get_replies(msg)).to be_empty
67
+ sleep 2 # hack until 'time-lord' fix gets released
68
+ msg = make_message(@bot, '!hangouts')
69
+ reply = get_replies(msg).last.text
70
+ expect(reply).to include(url)
71
+ puts reply
72
+ # expect(reply).to match(/it was last linked \d seconds? ago/)
73
+ end
61
74
  end
62
75
 
63
76
  describe 'posting an invalid hangout link does not log' do
64
77
  it 'when it is malformed (invalid chars)' do
65
- msg = make_message(@bot, Hangout.url('82b5cc7f76b7a%19c180416c2f509027!!d8856d',
66
- false), { channel: '#foo' })
78
+ msg = make_message(@bot, Hangout.url('82b5cc7f76b7a%19c180416c2f509027!!d8856d'),
79
+ { channel: '#foo' })
67
80
  expect(get_replies(msg)).to be_empty
68
81
  msg = make_message(@bot, '!hangouts')
69
82
  message = get_replies(msg).first.text
@@ -71,7 +84,7 @@ describe Cinch::Plugins::Hangouts do
71
84
  end
72
85
 
73
86
  it 'when it is malformed (wrong length)' do
74
- msg = make_message(@bot, Hangout.url('82b5cc', false), { channel: '#foo' })
87
+ msg = make_message(@bot, Hangout.url('82b5cc'), { channel: '#foo' })
75
88
  expect(get_replies(msg)).to be_empty
76
89
  msg = make_message(@bot, '!hangouts')
77
90
  expect(get_replies(msg).first.text).to eq('No hangouts have been linked recently!')
@@ -108,18 +121,16 @@ describe Cinch::Plugins::Hangouts do
108
121
 
109
122
  #it 'should notify users when a new hangout is linked' do
110
123
  # get_replies(make_message(@bot, '!hangouts subscribe'), { channel: '#foo', nick: 'joe' } )
111
- # msgs = get_replies(make_message(@bot, Hangout.url(random_hangout_id, false), { channel: '#foo', nick: 'josh' }))
124
+ # msgs = get_replies(make_message(@bot, Hangout.url(random_hangout_id), { channel: '#foo', nick: 'josh' }))
112
125
  # msgs.first.should_not be_nil
113
126
  #end
114
127
 
115
128
  it 'should not notify users when an old hangout is relinked' do
116
129
  get_replies(make_message(@bot, '!hangouts subscribe'), { channel: '#foo' } )
117
- get_replies(make_message(@bot, Hangout.url(random_hangout_id, false), { channel: '#foo' }))
118
- msg = make_message(@bot, Hangout.url(random_hangout_id, false), { channel: '#foo' })
130
+ get_replies(make_message(@bot, Hangout.url(random_hangout_id), { channel: '#foo' }))
131
+ msg = make_message(@bot, Hangout.url(random_hangout_id), { channel: '#foo' })
119
132
  expect(get_replies(msg)).to be_empty
120
133
  end
121
-
122
-
123
134
  end
124
135
 
125
136
  def random_hangout_id(len = 27)
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.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Haberer