ellen 0.0.5 → 0.0.6

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: f27816fa4aa7300a9b7c35b5827d5940c47088d6
4
- data.tar.gz: 1cb192ad3cc6a7f8a29cc07f7907f2958be45077
3
+ metadata.gz: fadab9439cdcb677b1957518a8665aa3b8d39ab3
4
+ data.tar.gz: b453149f59ffe456d6c67d9cb61d420ed9b15b25
5
5
  SHA512:
6
- metadata.gz: 5037d6dadd4f679ed7254fd262405367f933d5cb8aa4dbeb114658243d31a0f1e469d460646a5e8e5608ccc087499f3051bed40b928c1065972b7356fea60e40
7
- data.tar.gz: 314db415e020045daee42765c201c5faad64a0163a2ad4874d235dcfb12b7896079a882d8da99566539e08a79065af349991c5509ecface10b87d632cf4f5fde
6
+ metadata.gz: cc6e3090e688787fa2d8963b764a1530eb322e3c44ba309013e50fb257f8fae8be0c1399321bac7b22b78069bfb792cb62ec08c01aa2853ca521edfaf2534db7
7
+ data.tar.gz: 2864acd5087d41b1943b4fbce57dabf6d25e92a047305eea1fcda309b88975df3a937c016f8003d72fb1783c125d96b7506f3d9c990cbc7ffcba0292bf44b1df
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.0.6
2
+ * `ellen help` to show actions list
3
+
1
4
  ## 0.0.5
2
5
  * Now Action can access to MatchData object via Message
3
6
  * ENV["ROBOT_NAME"] or "ellen" is default name
data/lib/ellen/action.rb CHANGED
@@ -16,6 +16,10 @@ module Ellen
16
16
  !!options[:all]
17
17
  end
18
18
 
19
+ def description
20
+ options[:description] || "(no description)"
21
+ end
22
+
19
23
  private
20
24
 
21
25
  def pattern_with(name)
@@ -3,7 +3,7 @@
3
3
  # Example:
4
4
  #
5
5
  # class MyHandler < Ellen::Handlers::Base
6
- # on /kill\z/, command: true do |message|
6
+ # on /kill\z/ do |message|
7
7
  # say "Good bye, cruel world..."
8
8
  # exit
9
9
  # end
@@ -1,8 +1,13 @@
1
1
  module Ellen
2
2
  module Handlers
3
3
  class Help < Base
4
- on /help\z/ do |message|
5
- say "You'll be okay"
4
+ on /help\z/, description: "Show this help message" do |message|
5
+ lines = Ellen.handlers.map(&:actions).flatten.sort_by(&:all?).map do |action|
6
+ prefix = "@#{name} " unless action.all?
7
+ line = "%-30s - #{action.description}" % "#{prefix}#{action.pattern.inspect}"
8
+ line
9
+ end
10
+ say lines.join("\n")
6
11
  end
7
12
  end
8
13
  end
data/lib/ellen/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ellen
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ellen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura