slackup 0.0.3 → 0.0.4

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: 9f775a52592ebb2b334b49c07577edb1d63ae909
4
- data.tar.gz: c8f07567b097c4138ddccf4d1359c711d24dc6c4
3
+ metadata.gz: 6f1c23098a77f4dcd22d91db7e1093559e0bfe80
4
+ data.tar.gz: fbdf07fd8126c3fff96092494217603a2c68f0e4
5
5
  SHA512:
6
- metadata.gz: a8991c5c8a2b0227974db3c2e0ccb33a3d6a69df8154145a1b9e90bfe9aa17a64fadb158999cf9867119a9b0f152744c9c6555359aec2dc0fd0c532d199ad494
7
- data.tar.gz: 6dadcf2bc8c6adc5d0bd692800b541176a90664a7f93b251d9786e36e5727b9e09c8ee208c47bca2cef21e45cefa05d2a7da4c945e83638415cf53109fcea8cd
6
+ metadata.gz: 57557649da5b389b035bd3acd4d21d8ef5f52aa42032fc83eb878d19c02c636b8606a1e8db0fbd561629f54be849e90213e8cae06de36455d6ba98777286fbdb
7
+ data.tar.gz: f643590f2a48240ed0d7e0f981e55f4b231201c16023a5d2926b7a647149a76495f76be14c8069d180dda74ece207d4eb9bb87db8d852c6043e6ebf69a3a4029
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- slackup (0.0.3)
4
+ slackup (0.0.4)
5
5
  slack-api (~> 1.1, >= 1.1.3)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module Slackup
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/slackup.rb CHANGED
@@ -158,7 +158,7 @@ class Slackup
158
158
  # "type": "message",
159
159
  # "ts": "1358546515.000008",
160
160
  # "user": "U2147483896",
161
- # "text": "Hello"
161
+ # "text": "<@U0453RHGQ> has some thoughts on that kind of stuff"
162
162
  # },
163
163
  # ]
164
164
  # "has_more": false
@@ -178,6 +178,10 @@ class Slackup
178
178
  messages.reverse.map { |msg|
179
179
  if msg.has_key?("text") && msg.has_key?("user")
180
180
  msg["user"] = user_name(msg["user"])
181
+ msg["text"].gsub!(/<@(?<userid>U[A-Z0-9]+)>/) {
182
+ userid = $~[:userid] # MatchData
183
+ "<@#{user_name(userid)}>"
184
+ }
181
185
  msg
182
186
  else
183
187
  nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slackup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Fleischer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-26 00:00:00.000000000 Z
11
+ date: 2015-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slack-api