telegram_meetup_bot 0.2.1 → 0.3.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1917d0bb400237f866bdf6ab5e38fb0d1fef5f6
|
4
|
+
data.tar.gz: 06e94518ea4a661a319cbb2ced8f8a27852d3877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ccc76e87fc962af3abb2ba136baa88abca63d1594d93dddbe5fe4fb5c76ec7ae06b678698bf1558acda5482d2fd6ee41aa0d2b11997009bed762fb2d329ed38
|
7
|
+
data.tar.gz: 9fbda4e6c9f545c00bb3222998434972c1a380360212e605823e226520c37df10a02c11eb772ae6129ea8b3fe08ea3456e5fdca441fdeb43fe6896ed71722a0f
|
@@ -3,7 +3,7 @@ module TelegramMeetupBot
|
|
3
3
|
class Factory
|
4
4
|
class << self
|
5
5
|
def build(message)
|
6
|
-
return
|
6
|
+
return unless COMMANDS.include?(message.command)
|
7
7
|
|
8
8
|
if no_username?(message)
|
9
9
|
TelegramMeetupBot::Commands::NilUsername.new(message)
|
@@ -15,14 +15,10 @@ module TelegramMeetupBot
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def klass(command)
|
18
|
-
command =
|
18
|
+
command = command.capitalize
|
19
19
|
Object.const_get "TelegramMeetupBot::Commands::#{command}Command"
|
20
20
|
end
|
21
21
|
|
22
|
-
def whitelisted_command(command)
|
23
|
-
COMMANDS.include?(command) ? command : DEFAULT_COMMAND
|
24
|
-
end
|
25
|
-
|
26
22
|
def no_username?(message)
|
27
23
|
message.author.username.nil?
|
28
24
|
end
|
@@ -27,8 +27,8 @@ RSpec.describe TelegramMeetupBot::Commands::Factory do
|
|
27
27
|
context 'not available command' do
|
28
28
|
let(:command) { '/qwerty' }
|
29
29
|
|
30
|
-
it '
|
31
|
-
expect(subject
|
30
|
+
it 'ignore command' do
|
31
|
+
expect(subject).to eq(nil)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telegram_meetup_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timur Yanberdin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|