lita 4.6.1 → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/lita/message.rb +6 -0
- data/lib/lita/version.rb +1 -1
- data/spec/lita/message_spec.rb +8 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23c6ce7e1b5feb04149bf20d38693eeaa839659b
|
4
|
+
data.tar.gz: 90a232c9243a1a53795fcf03bd365d11f809fa2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35e2e6cb2a7f971905c602466cbf9dfbfa4eb40865c82b84d812b110c2f3ec38bee3aad6432fb0f4e1b0e48d586a137badcb8e9e71e2b5344b5b6f389a7e0416
|
7
|
+
data.tar.gz: 751b91c5a3740998066f92dc54a61917f691d056c3d523ab04a2b3ca55c4444dc71685ae41981506e3e9e4945e6635d5e9bd3b8a7054d1f90413e3086dc3dd6d
|
data/.travis.yml
CHANGED
data/lib/lita/message.rb
CHANGED
@@ -11,6 +11,11 @@ module Lita
|
|
11
11
|
# @return [Lita::Source] The message source.
|
12
12
|
attr_reader :source
|
13
13
|
|
14
|
+
# A hash of arbitrary data that can be populated by Lita adapters and extensions.
|
15
|
+
# @return [Hash] The extension data.
|
16
|
+
# @since 4.7.0
|
17
|
+
attr_reader :extensions
|
18
|
+
|
14
19
|
# @!method user
|
15
20
|
# The user who sent the message.
|
16
21
|
# @return [Lita::User] The user.
|
@@ -34,6 +39,7 @@ module Lita
|
|
34
39
|
@robot = robot
|
35
40
|
@body = body
|
36
41
|
@source = source
|
42
|
+
@extensions = {}
|
37
43
|
|
38
44
|
name_pattern = "@?#{Regexp.escape(@robot.mention_name)}[:,]?\\s+"
|
39
45
|
alias_pattern = "#{Regexp.escape(@robot.alias)}\\s*" if @robot.alias
|
data/lib/lita/version.rb
CHANGED
data/spec/lita/message_spec.rb
CHANGED
@@ -21,6 +21,14 @@ describe Lita::Message do
|
|
21
21
|
expect(subject.source).to eq(source)
|
22
22
|
end
|
23
23
|
|
24
|
+
describe "#extensions" do
|
25
|
+
it "can be populated with arbitrary data" do
|
26
|
+
subject.extensions[:foo] = :bar
|
27
|
+
|
28
|
+
expect(subject.extensions[:foo]).to eq(:bar)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
24
32
|
describe "#args" do
|
25
33
|
it "returns an array of the 2nd through nth word in the message" do
|
26
34
|
subject = described_class.new(robot, "args foo bar", source)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Cuadra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -406,7 +406,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
406
406
|
version: '0'
|
407
407
|
requirements: []
|
408
408
|
rubyforge_project:
|
409
|
-
rubygems_version: 2.
|
409
|
+
rubygems_version: 2.5.1
|
410
410
|
signing_key:
|
411
411
|
specification_version: 4
|
412
412
|
summary: ChatOps framework for Ruby. Lita is a robot companion for your chat room.
|
@@ -450,4 +450,3 @@ test_files:
|
|
450
450
|
- spec/templates/basic.irc.erb
|
451
451
|
- spec/templates/helpers.erb
|
452
452
|
- spec/templates/interpolated.erb
|
453
|
-
has_rdoc:
|