jumpup-hipchat 0.2.0 → 0.2.1

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: e983c1913d6010c2721df952d3a7b1b4f1240d3e
4
- data.tar.gz: 7915bdb75400d9d87266f5cad8edc9e8c9bcf721
3
+ metadata.gz: 7b01aaf99bc100dcc76e15285ead16d396adac70
4
+ data.tar.gz: 407731d9904e39df120546ceaef0bc3a210ac13f
5
5
  SHA512:
6
- metadata.gz: 4610c74b8ee61459176859c357c35ba10796015e45f430401408e0c200cf572cf6a4c0d1aba1ab675c99f14e4ef76a5025b20cd26dc959a0c310e19b83db4339
7
- data.tar.gz: bd003f04d8604e1dc1582bd0eb8230c57462026f1fc35161aad90924650294f5ebb8972ad1bfe7058c620c0b046fc9d77fa8462249e438fec590e0e7d5a8b13a
6
+ metadata.gz: 8a1b95f7fd105eb55a903ccff0e19957fb210ffc3f5ba53b797473440474044724bd62cd32ded449cdd2788d80f3c9264f6f03453542b6f525dd343cc8b52ce6
7
+ data.tar.gz: a2a938a36eddb15072ac2deb44250c77624b774400707e0b6e6481e0b11e53ee0e300a97aa88ec580efb909cb6bfdbf7101326bf44092ef04426c1d155f1e9cb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1 (May 23, 2014)
4
+
5
+ ### bug fixes
6
+
7
+ - Truncate HipChat username to 15 chars before posting messages [[GH-15]]
8
+
3
9
  ## 0.2.0 (May 16, 2014)
4
10
 
5
11
  ### features
@@ -35,11 +35,19 @@ module Jumpup
35
35
 
36
36
  def send_message(msg)
37
37
  begin
38
- @client[@room].send(@git_user, msg, notify: true)
38
+ @client[@room].send(truncate_username(@git_user), msg, notify: true)
39
39
  rescue => ex
40
40
  puts "----> Unable to send message to HipChat room!\n ERROR: #{ex}"
41
41
  end
42
42
  end
43
+
44
+ # Inspired on https://github.com/rails/rails/blob/cada218f539265c6c44002833dc41b36be7738d3/activesupport/lib/active_support/core_ext/string/filters.rb#L51
45
+ def truncate_username(username, truncate_at = 15, omission = '...')
46
+ return username if username.length <= truncate_at
47
+
48
+ stop = truncate_at - omission.length
49
+ "#{username[0, stop]}#{omission}"
50
+ end
43
51
  end
44
52
  end
45
53
  end
@@ -1,5 +1,5 @@
1
1
  module Jumpup
2
2
  module Hipchat
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jumpup-hipchat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HE:labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-16 00:00:00.000000000 Z
11
+ date: 2014-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake