lita 1.0.0 → 1.1.0

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: 685f6216c8c89f5312c06bf1ae319148b664f7f7
4
- data.tar.gz: d56a154473e9e27b2bd670b8e523c436659775b8
3
+ metadata.gz: f158cb443c81f822bc6d7e8c79686c2d88d4b54e
4
+ data.tar.gz: 7b69a1cf250862ccfc8e14f6744d888aca82e4bb
5
5
  SHA512:
6
- metadata.gz: 73a167653dde936d3813aea9bcc9a8dc6d6c8de116773277a7e18b3e3e6a9a79f37854075f02d53c87d90c4f732e0541d4912557af591c5a6a7401b559ca2bf1
7
- data.tar.gz: 0ae661969514a05918bcc7d11b8bef8c95cce9f4b40010aef44185d52158d39cf7774db522c47840ebbaae00c30c3a1550f1a8fff1cfad36f33b0bac65c1aecc
6
+ metadata.gz: d789ea06b6c14ccbc872ff44ec44a4da8c395648e2617fb80f423022dfa1480c109a45981dbd4be6aed48d112908f476e42685cfbe2317c74d229a7f960f9161
7
+ data.tar.gz: d5f90787d8903222cb433f8d065a0bccd2f2dc7edd7867acc4355d351352286d2876c48264745edd37fad2e861af4331ed24de97477bf95e313376b9fa3dad95
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0 (June 23, 2013)
4
+
5
+ * Added a new configuration: `config.robot.mention_name`. This allows the display name of the robot `config.robot.name` to differ from the name Lita uses to detect a message as a command. For example, on HipChat, Lita's name might be displayed as "Lita Bot", but might be mentioned in messages with "LitaBot". This value will default to `config.robot.name` if not set.
6
+
7
+ ## 1.0.0 (June 22, 2013)
8
+
9
+ First stable release.
10
+
3
11
  ## 0.0.1 (June 15, 2013)
4
12
 
5
13
  Initial release.
data/README.md CHANGED
@@ -60,6 +60,7 @@ To configure Lita, edit the file `lita_config.rb` generated by the `lita new` co
60
60
  ``` ruby
61
61
  Lita.configure do |config|
62
62
  config.robot.name = "Sir Bottington"
63
+ config.robot.mention_name = "bottington"
63
64
  config.robot.adapter = :example_chat_service
64
65
  config.adapter.username = "bottington"
65
66
  config.adapter.password = "secret"
@@ -72,7 +73,8 @@ end
72
73
  The main config objects are:
73
74
 
74
75
  * `robot` - General settings for Lita.
75
- * `name` - The name the bot will use on the chat service.
76
+ * `name` - The display name the bot will use on the chat service.
77
+ * `mention_name` - The name the bot will look for in messages to determine if the message is being addressed to it. Usually this is the same as the display name, but in some cases it may not be. For example, on HipChat, display names are required to be a first and last name, such as "Lita Bot", whereas the mention system would use a name like "LitaBot". This value defaults to whatever the name is if it's not set.
76
78
  * `adapter` - A symbol or string indicating the adapter to load.
77
79
  * `log_level` - A symbol or string indicating the severity level of log messages to output. Valid options are, in order of severity - `:debug`, `:info`, `:warn`, `:error`, and `:fatal`. For whichever level you choose, log messages of that severity and greater will be output. The default level is `:info`.
78
80
  * `admins` - An array of string user IDs which tell Lita which users are considered administrators. Only these users will have access to Lita's `auth` command.
@@ -13,7 +13,7 @@ module Lita
13
13
  @body = body
14
14
  @source = source
15
15
 
16
- @command = !!@body.sub!(/^\s*@?#{@robot.name}[:,]?\s*/, "")
16
+ @command = !!@body.sub!(/^\s*@?#{@robot.mention_name}[:,]?\s*/, "")
17
17
  end
18
18
 
19
19
  def args
@@ -1,9 +1,11 @@
1
1
  module Lita
2
2
  class Robot
3
3
  attr_reader :name
4
+ attr_accessor :mention_name
4
5
 
5
6
  def initialize
6
7
  @name = Lita.config.robot.name
8
+ @mention_name = Lita.config.robot.mention_name || @name
7
9
  load_adapter
8
10
  end
9
11
 
@@ -1,3 +1,3 @@
1
1
  module Lita
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -1,9 +1,5 @@
1
1
  describe Lita::Adapters::Shell do
2
- let(:robot) do
3
- robot = double("Robot")
4
- allow(robot).to receive(:name).and_return("Lita")
5
- robot
6
- end
2
+ let(:robot) { double("Lita::Robot", name: "Lita", mention_name: "LitaBot") }
7
3
 
8
4
  subject { described_class.new(robot) }
9
5
 
@@ -1,11 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Lita::Message do
4
- let(:robot) do
5
- robot = double("Robot")
6
- allow(robot).to receive(:name).and_return("Lita")
7
- robot
8
- end
4
+ let(:robot) { double("Lita::Robot", name: "Lita", mention_name: "LitaBot") }
9
5
 
10
6
  subject do
11
7
  described_class.new(robot, "Hello", "Carl")
@@ -44,7 +40,11 @@ describe Lita::Message do
44
40
 
45
41
  describe "#command?" do
46
42
  it "is true when the message is addressed to the Robot" do
47
- subject = described_class.new(robot, "#{robot.name}: hello", "Carl")
43
+ subject = described_class.new(
44
+ robot,
45
+ "#{robot.mention_name}: hello",
46
+ "Carl"
47
+ )
48
48
  expect(subject).to be_a_command
49
49
  end
50
50
 
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: 1.0.0
4
+ version: 1.1.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: 2013-06-22 00:00:00.000000000 Z
11
+ date: 2013-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler