samson_hipchat 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5dde8617b79688e447d24772d04c4636257074a7
4
- data.tar.gz: 54c8e367ee9a185ee3a195af3aff827558a8a097
3
+ metadata.gz: 3df471005965151a366d321f8d68e01d334031ba
4
+ data.tar.gz: ba241af2e33b3a685b3d95d9c361dba6739e0245
5
5
  SHA512:
6
- metadata.gz: 7d4b4f361f3a33e2273a116fd5be3b458d03208a1ce1ce250801295bc69f07cb27523ec433da1ab019dda773e4ebcf53093818f6659b20d80ce8f0d04b0820cb
7
- data.tar.gz: 487fa2af69ba5a66e2bb79913a4a16f58164bb4aa4fcfb396a9823c7d64161254267039538e779a09ea8c8575bfa8841494df7db6c82fe5d46dd17570c103170
6
+ metadata.gz: 7568d94df81592ec9d3ed0b6562acc322770a2a8f03ff1ee009bc5ea44b1cd1e157e67d20e7852332d9073367db582c9cc6a3efbaba01e024ef72dd329ce70fd
7
+ data.tar.gz: 9a41b596e5dfa4619b7adde5d5455fe0df767db5c3999bd8cc08ac81de38db19f0ec9771e2f90bceaa55ed8838438fe2b8ed50e264ce78a78231061824cb50ef
@@ -21,15 +21,17 @@ Stage.class_eval do
21
21
 
22
22
  def update_room_id
23
23
  if room_for(room_name)
24
+ # we attempt to save room id
24
25
  self.hipchat_rooms.first.room_id = room_for(room_name)['id']
25
26
  else
26
- self.hipchat_rooms.first.room_id = nil
27
+ # if we fail, this maybe a notification token, just set it to 0
28
+ self.hipchat_rooms.first.room_id = 0 if room_name
27
29
  end
28
30
  end
29
31
 
30
32
  def room_exists?
31
33
  if room_name
32
- errors.add(:hipchat_rooms_name, "was not found. Create the room first. If this is a notification token, you can ignore this message") unless room_for(room_name)
34
+ #errors.add(:hipchat_rooms_name, "was not found. Create the room first. If this is a notification token, you can ignore this message") unless room_for(room_name)
33
35
  end
34
36
  end
35
37
 
@@ -41,7 +43,7 @@ Stage.class_eval do
41
43
  def room_for(name)
42
44
  return nil unless name
43
45
 
44
- Rails.cache.fetch(hipchat_rooms_cache_key, expires_in: 5.minutes) do
46
+ Rails.cache.fetch(hipchat_rooms_cache_key + name, expires_in: 15.minutes) do
45
47
  begin
46
48
  hipchat[name].get_room
47
49
  rescue HipChat::UnknownRoom, HipChat::UnknownResponseCode
@@ -0,0 +1,5 @@
1
+ class RemoveRoomIdFromHipchatRoom < ActiveRecord::Migration
2
+ def change
3
+ remove_column :hipchat_rooms, :room_id, :string
4
+ end
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: samson_hipchat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vinh Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-01 00:00:00.000000000 Z
11
+ date: 2015-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hipchat
@@ -38,6 +38,7 @@ files:
38
38
  - app/views/samson_hipchat/notification.text.erb
39
39
  - config/initializers/hipchat.rb
40
40
  - db/migrate/20150519105221_create_hipchat_rooms.rb
41
+ - db/migrate/20150702231956_remove_room_id_from_hipchat_room.rb
41
42
  - lib/samson_hipchat/samson_plugin.rb
42
43
  homepage:
43
44
  licenses: []