telegram-scrum-bot 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +2 -0
- data/README.md +17 -17
- data/lib/telegram-bot.rb +4 -12
- data/lib/telegram-bot/bot.rb +6 -3
- data/lib/telegram-bot/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a09aa62a76cf00f35681ae6fcb6777fd3226920a825f1ccf7a7702417a5df813
|
4
|
+
data.tar.gz: c4c5f9a4bada72bbcb9ea94a37fd9796e00048f787c459c4270d843f74767dce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27b2f9a97ab4d611c95d61019bd7b45559bdf7c3fc7cc49214579e246968117eab9d20accf0fde7166006c88e47f25ecf852aa3f461ad3658f0c402494358699
|
7
|
+
data.tar.gz: 914d5fd92572e8d4f05ba0a25b5e6e50da4fd5e8ca1da6ff1dbc22747c8a4670f581302dc3ab3250013d7e9aab4ddf4e31a1d6029d6031e844780782e6b3368e
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -22,6 +22,7 @@ GEM
|
|
22
22
|
diff-lcs (1.3)
|
23
23
|
domain_name (0.5.20180417)
|
24
24
|
unf (>= 0.0.5, < 1.0.0)
|
25
|
+
dotenv (2.5.0)
|
25
26
|
equalizer (0.0.11)
|
26
27
|
excon (0.62.0)
|
27
28
|
http-cookie (1.0.3)
|
@@ -82,6 +83,7 @@ PLATFORMS
|
|
82
83
|
ruby
|
83
84
|
|
84
85
|
DEPENDENCIES
|
86
|
+
dotenv (~> 2.5)
|
85
87
|
httparty (~> 0.16.2)
|
86
88
|
rspec (~> 3.8)
|
87
89
|
ruby-trello (~> 2.1)
|
data/README.md
CHANGED
@@ -4,19 +4,27 @@ A friendship Telegram's bot that connect a Repository on GitHub with a Scrum boa
|
|
4
4
|
|
5
5
|
## Setup
|
6
6
|
|
7
|
-
|
7
|
+
You must setup the required enviroment variables inside `.bashrc` or `.zshrc` depend of your terminal configuration:
|
8
|
+
|
8
9
|
```bash
|
9
|
-
|
10
|
+
# Enviroment variables from telegram-scrum-bot gem:
|
11
|
+
export API_TELEGRAM_TOKEN="TOKEN-INFO"
|
12
|
+
export API_TRELLO_KEY="KEY-INFO"
|
13
|
+
export API_TRELLO_TOKEN="TOKEN-INFO"
|
10
14
|
```
|
11
15
|
|
12
|
-
|
16
|
+
Or for development create a `.env` file with the next information:
|
13
17
|
|
14
|
-
```
|
15
|
-
telegram:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
```bash
|
19
|
+
# Enviroment variables from telegram-scrum-bot gem:
|
20
|
+
API_TELEGRAM_TOKEN="TOKEN-INFO"
|
21
|
+
API_TRELLO_KEY="KEY-INFO"
|
22
|
+
API_TRELLO_TOKEN="TOKEN-INFO"
|
23
|
+
```
|
24
|
+
|
25
|
+
### From the Github Repository:
|
26
|
+
```bash
|
27
|
+
git clone https://github.com/hackvan/telegram-bot.git
|
20
28
|
```
|
21
29
|
|
22
30
|
to start the bot's server application:
|
@@ -30,14 +38,6 @@ $ bundle exec ruby lib/telegram-bot.rb
|
|
30
38
|
|
31
39
|
>https://rubygems.org/gems/telegram-scrum-bot
|
32
40
|
|
33
|
-
you must setup the required enviroment variables inside `.bashrc` or `.zshrc` depend of your terminal configuration:
|
34
|
-
```bash
|
35
|
-
# Enviroment variables from telegram-scrum-bot gem:
|
36
|
-
export API_TELEGRAM_TOKEN="TOKEN-INFO"
|
37
|
-
export API_TRELLO_KEY="KEY-INFO"
|
38
|
-
export API_TRELLO_TOKEN="TOKEN-INFO"
|
39
|
-
```
|
40
|
-
|
41
41
|
To install and execute the application:
|
42
42
|
```bash
|
43
43
|
$ gem install telegram-scrum-bot
|
data/lib/telegram-bot.rb
CHANGED
@@ -3,18 +3,10 @@ require_relative 'telegram-bot/bot'
|
|
3
3
|
module TelegramBot
|
4
4
|
end
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
API_TRELLO_KEY = config['trello']['key']
|
11
|
-
API_TRELLO_TOKEN = config['trello']['token']
|
12
|
-
rescue Errno::ENOENT => exception
|
13
|
-
# Search enviroment variables used for production enviroment:
|
14
|
-
API_TELEGRAM_TOKEN = ENV['API_TELEGRAM_TOKEN']
|
15
|
-
API_TRELLO_KEY = ENV['API_TRELLO_KEY']
|
16
|
-
API_TRELLO_TOKEN = ENV['API_TRELLO_TOKEN']
|
17
|
-
end
|
6
|
+
require 'dotenv/load'
|
7
|
+
API_TELEGRAM_TOKEN = ENV['API_TELEGRAM_TOKEN']
|
8
|
+
API_TRELLO_KEY = ENV['API_TRELLO_KEY']
|
9
|
+
API_TRELLO_TOKEN = ENV['API_TRELLO_TOKEN']
|
18
10
|
|
19
11
|
if API_TELEGRAM_TOKEN
|
20
12
|
TelegramBot::TelegramScrumBot.set_token(API_TELEGRAM_TOKEN)
|
data/lib/telegram-bot/bot.rb
CHANGED
@@ -232,9 +232,12 @@ module TelegramBot
|
|
232
232
|
end
|
233
233
|
|
234
234
|
if __FILE__ == $0
|
235
|
-
|
236
|
-
|
237
|
-
|
235
|
+
require 'dotenv/load'
|
236
|
+
API_TELEGRAM_TOKEN = ENV['API_TELEGRAM_TOKEN']
|
237
|
+
API_TRELLO_KEY = ENV['API_TRELLO_KEY']
|
238
|
+
API_TRELLO_TOKEN = ENV['API_TRELLO_TOKEN']
|
239
|
+
TelegramBot::TelegramScrumBot.set_token(API_TELEGRAM_TOKEN)
|
240
|
+
TelegramBot::set_trello_tokens(API_TRELLO_KEY, API_TRELLO_TOKEN)
|
238
241
|
bot = TelegramBot::TelegramScrumBot.new(username: 'hackvan', repository: 'telegram-bot')
|
239
242
|
bot.run
|
240
243
|
end
|
data/lib/telegram-bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telegram-scrum-bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Camacho
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: telegram_bot
|