ruboty-good-night 0.1.1 → 0.1.2

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: 72a7ea2f3fae515abec2a9a5da0ed82d88a80b19
4
- data.tar.gz: 74565378a572ffc7bda2710e94a71a854db78baf
3
+ metadata.gz: a61ebdc206859125a209aad164de9fe06d6a32b2
4
+ data.tar.gz: a04d724fd4f74bde902f50fdb9a7d70b104470bc
5
5
  SHA512:
6
- metadata.gz: c97595aa03b6367f365fa96e3c8fc14cc274c46ade58f54601dec8275127567c97f2d10df2b9f1edb227316af28bc44d1f935de9326284f7aaf12644d96b0035
7
- data.tar.gz: df26bbb23377a01e7eb431fa48454ebfe98e05179631faededb26042c5eb2e41937b7e406a637cb58888012fd81e4c97bfc5da8e39c79eec1a7a43a0b71adda8
6
+ metadata.gz: 687135a00f4fabaf27bc6e5f0266ae835a65e55afa2bcc4beee239a407d3fe83d95a57fd7dea5da60713c1f7f7d3934fa1cec10358920c9022108a70dee24b07
7
+ data.tar.gz: 1fadd08f4fa47ce1b277056c32ea3dd507acf52ae576d86c312bec7b470d8f39dc71dc339c894b28ce76c66bbb2132a671173f30618a14c8c43e1a984f43ea76
@@ -0,0 +1,21 @@
1
+ module Ruboty
2
+ module GoodNight
3
+ module AdaptCallback
4
+ BRAIN_NAMESPACE = 'ruboty-goodnight'
5
+
6
+ def adapt
7
+ super
8
+
9
+ if robot.brain.data[BRAIN_NAMESPACE]
10
+ room.reply('おはようございます')
11
+ end
12
+ end
13
+
14
+ def room
15
+ Ruboty::Message.new(robot.brain.data[BRAIN_NAMESPACE].merge(robot: robot))
16
+ end
17
+ end
18
+ end
19
+
20
+ Robot.prepend(GoodNight::AdaptCallback)
21
+ end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module GoodNight
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -1 +1,2 @@
1
1
  require 'ruboty/handlers/good_night'
2
+ require 'ruboty/good_night/adapt_callback'
@@ -8,7 +8,6 @@ module Ruboty
8
8
  def initialize(*args)
9
9
  super
10
10
  if robot.brain.data[BRAIN_NAMESPACE]
11
- room.reply('おはようございます')
12
11
  trap_message(room)
13
12
  end
14
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-good-night
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - adorechic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-09 00:00:00.000000000 Z
11
+ date: 2015-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,6 +69,7 @@ files:
69
69
  - bin/console
70
70
  - bin/setup
71
71
  - lib/ruboty/good_night.rb
72
+ - lib/ruboty/good_night/adapt_callback.rb
72
73
  - lib/ruboty/good_night/version.rb
73
74
  - lib/ruboty/handlers/good_night.rb
74
75
  - ruboty-good-night.gemspec