telepost 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/telepost.rb +1 -1
- data/telepost.gemspec +1 -1
- data/test/test_telepost.rb +7 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1bfc2471b076fe6343687400f3c9d199f4ba2c01fce7751e5b13d1db31ed29c
|
4
|
+
data.tar.gz: 94a7397bcf43afa770452170c918d672f0fbe47a59bff68d7842e9f3c94a9e45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51fae734e3ab3403eaaa3b8d21ed201a3cbee2a10c9802905061fc2551c83063109ca76134a8fc0cd7ad921ce1d6ddd4d40c9774af7d783e7589a552b3bd37a6
|
7
|
+
data.tar.gz: ec5bb310af82d8ea9aaf82f5465fa7ce5fa7b7ba8559a4404f8dbaa5246e673b1d4300acf8f3d75e5a5aec257669f1ff7646cb314e9686542e3e55694496c2ec
|
data/lib/telepost.rb
CHANGED
@@ -101,7 +101,7 @@ class Telepost
|
|
101
101
|
# be the admin there). The lines provided will be
|
102
102
|
# concatenated with a space between them.
|
103
103
|
def post(chat, *lines)
|
104
|
-
@bot.send_message(
|
104
|
+
@bot.api.send_message(
|
105
105
|
chat_id: chat,
|
106
106
|
parse_mode: 'Markdown',
|
107
107
|
disable_web_page_preview: true,
|
data/telepost.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
29
29
|
s.required_ruby_version = '>=3.2'
|
30
30
|
s.name = 'telepost'
|
31
|
-
s.version = '0.5.
|
31
|
+
s.version = '0.5.1'
|
32
32
|
s.license = 'MIT'
|
33
33
|
s.summary = 'Simple Telegram posting Ruby gem'
|
34
34
|
s.description = 'Simple Telegram posting Ruby gem'
|
data/test/test_telepost.rb
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
# SOFTWARE.
|
24
24
|
|
25
25
|
require 'minitest/autorun'
|
26
|
+
require 'yaml'
|
26
27
|
require_relative '../lib/telepost'
|
27
28
|
|
28
29
|
# Telepost test.
|
@@ -38,11 +39,13 @@ class TelepostTest < Minitest::Test
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def test_real_posting
|
41
|
-
|
42
|
+
cfg = '/code/home/assets/zerocracy/baza.yml'
|
43
|
+
skip unless File.exist?(cfg)
|
44
|
+
yaml = YAML.safe_load_file(cfg)
|
42
45
|
tp = Telepost.new(
|
43
|
-
'
|
44
|
-
chats: [
|
46
|
+
yaml['tg']['token'],
|
47
|
+
chats: [yaml['tg']['admin_chat'].to_i]
|
45
48
|
)
|
46
|
-
tp.spam('This is just a test message')
|
49
|
+
tp.spam('This is just a test message from telepost test')
|
47
50
|
end
|
48
51
|
end
|