ruboty-world_clock 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ed7b9a5eb9c3716b11481ccb60c169ac47f2e40
4
- data.tar.gz: 8c71545ed4c068222c246caa962c0cd3d0313276
3
+ metadata.gz: 9bf8a061ee5c402fff713da2eef81a0fed4ad873
4
+ data.tar.gz: b99ba70772d7bcda40a7c631964258ffe7d59e33
5
5
  SHA512:
6
- metadata.gz: d15a11a4786e03dd7e8ae9e2e0a9efa5d5f06ae36c749984e48f3ee53b57ebb6c6d1ab1d44034bee7ada3bced954c2150ed77fa6a32bde8bb4c982decc9e723b
7
- data.tar.gz: e4a69f74a0d4c4ce3bf05c6b787d35188ca1533cdedebd3f1f3d1f1ad17e8d61ea8af463f7d66582600943f69f0a8fef44c02658fb9089baeebce590cfe3154a
6
+ metadata.gz: f064d834d9b2c1c31b56df9440949aaee68633357ce14274b4d16e0d6932efcafece0a4d6fe81e22d4e28bac184d97d676c3f77c7d3fa9712677aa35cd578617
7
+ data.tar.gz: 7feca508bcaf21c203842694a653688a5b23bc8dcc1cdaa40a7eddaf4d615f6de8ffe5e1c5be83d1d99f94e30f8bd815cbefb88de5e092dc2d6ef480247f96f6
@@ -0,0 +1,21 @@
1
+ module Ruboty
2
+ module Actions
3
+ class WorldClockList < Base
4
+ def call
5
+ message.reply(
6
+ <<-EOM
7
+ ```
8
+ #{timezones.join("\n")}
9
+ ```
10
+ EOM
11
+ )
12
+ end
13
+
14
+ private
15
+
16
+ def timezones
17
+ ActiveSupport::TimeZone.all.map(&:name).select { |tz| tz =~ /#{message[:zone]}/ }
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,11 @@
1
+ module Ruboty
2
+ module Handlers
3
+ class WorldClockList < Base
4
+ on /clock list (?<zone>.+)\z/i, name: 'world_clock_list', description: 'Show world clock list'
5
+
6
+ def world_clock(message)
7
+ Ruboty::Actions::WorldClockList.new(message).call
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module WorldClock
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
5
  end
@@ -2,7 +2,8 @@ require 'active_support/all'
2
2
  require 'ruboty'
3
3
  require 'ruboty/handlers/world_clock'
4
4
  require 'ruboty/actions/world_clock'
5
-
5
+ require 'ruboty/handlers/world_clock_list'
6
+ require 'ruboty/actions/world_clock_list'
6
7
  module Ruboty
7
8
  module WorldClock
8
9
  # Your code goes here...
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-world_clock
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
  - Shota Iguchi
@@ -56,7 +56,9 @@ files:
56
56
  - bin/console
57
57
  - bin/setup
58
58
  - lib/ruboty/actions/world_clock.rb
59
+ - lib/ruboty/actions/world_clock_list.rb
59
60
  - lib/ruboty/handlers/world_clock.rb
61
+ - lib/ruboty/handlers/world_clock_list.rb
60
62
  - lib/ruboty/world_clock.rb
61
63
  - lib/ruboty/world_clock/version.rb
62
64
  - ruboty-world_clock.gemspec