ellen 0.2.3 → 0.2.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: 4a4e55f9203669780c969cd86a4c1734b6e18382
4
- data.tar.gz: 1f6d4d92e9ac68cef046e5bdb9a049f5652bd6d6
3
+ metadata.gz: 212431648bbc746967e2f232d4dfedf714e52f60
4
+ data.tar.gz: 25b4c48f6037b23e6accbf509c460f8561a20127
5
5
  SHA512:
6
- metadata.gz: f4a489112860fed3c9434c6bbd5e5c6d0b978d2ad92eb976567dff61c805d149fb4421b0d066220d124e528de4b7d870179c9d517fe57761297758678200e4cf
7
- data.tar.gz: 2f00348f8a62861bfa145109017fd756523bcea2583721996162bedfaf4838b0b773009c3c2107c555c69a5e8553b7786da3ac9a425b3f569bd4306070d975e4
6
+ metadata.gz: 9d03a31da1b337ac911e2f9e820d2c9199a93a9a42887d5cdaa5b9fb74fb9f91380258e1f809456142074a290996a79ccd85e008d2c96e74155899d1e795b252
7
+ data.tar.gz: 65da8ae322cee72f0b620518bd7ad912545574a65cc363a793e5f55a953b1985bcd826ea11eda0c7205805959b3ad7c5567a93bdf33453b6b509dd6557b16fce
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.2.4
2
+ * Reveal message prefix pattern as a class method
3
+
1
4
  ## 0.2.3
2
5
  * Help message is formatted if adapter supported
3
6
 
data/README.md CHANGED
@@ -50,17 +50,14 @@ gem "ellen-slack"
50
50
  Here is the smallest example to deploy a simple chatterbot to Heroku.
51
51
 
52
52
  ```sh
53
- $ gem install ellen
54
- $ ellen --generate
55
- $ cd ellen
56
- $ echo 'gem "ellen-my_adapter"' >> Gemfile
53
+ $ echo 'source "https://rubygesm.org"' >> Gemfile
54
+ $ echo 'gem "ellen"' >> Gemfile
57
55
  $ echo 'bot: bundle exec ellen' >> Procfile
58
56
  $ bundle install
59
57
  $ git init
60
58
  $ git add .
61
59
  $ git commit -m "Initial commit"
62
60
  $ heroku create
63
- $ heroku config:set FOO=1 BAR=2 BAZ=3
64
61
  $ git push heroku master
65
62
  $ heroku scale bot=1
66
63
  ```
data/lib/ellen/action.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  module Ellen
2
2
  class Action
3
+ def self.prefix_pattern(robot_name)
4
+ /\A@?#{Regexp.escape(robot_name)}:?\s*/
5
+ end
6
+
3
7
  attr_reader :options, :pattern
4
8
 
5
9
  def initialize(pattern, options = {})
@@ -25,11 +29,11 @@ module Ellen
25
29
 
26
30
  private
27
31
 
28
- def pattern_with(name)
32
+ def pattern_with(robot_name)
29
33
  if all?
30
34
  /\A#{pattern}/
31
35
  else
32
- /\A@?#{Regexp.escape(name)}:?\s*#{pattern}/
36
+ /#{self.class.prefix_pattern(robot_name)}#{pattern}/
33
37
  end
34
38
  end
35
39
  end
data/lib/ellen/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ellen
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ellen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-15 00:00:00.000000000 Z
11
+ date: 2014-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport