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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4461654558ffed3bd8215c301229d9e78ec05fb8cd6ed54cae1e838065f8eff3
4
- data.tar.gz: a0d2708c6436ac774225dbe474d31e5104a72d1984e4512647ae3f7cb1e1668a
3
+ metadata.gz: a09aa62a76cf00f35681ae6fcb6777fd3226920a825f1ccf7a7702417a5df813
4
+ data.tar.gz: c4c5f9a4bada72bbcb9ea94a37fd9796e00048f787c459c4270d843f74767dce
5
5
  SHA512:
6
- metadata.gz: 88eff10b013d490bfa950f335d58ed5b54ca147f449f483700f27e7375def089a221b4d7e2f9d41d893bbbb3497418ba20ab43e503c2a29add87c3669e170e8b
7
- data.tar.gz: 36d43702ddbe79c6af640bb17b9f540a4d58e9f21d7d7fc273bf1eecb3c342663ee4e40f94c4582fd88a28e6306607424edeed133dc5ff005507d0f744b90859
6
+ metadata.gz: 27b2f9a97ab4d611c95d61019bd7b45559bdf7c3fc7cc49214579e246968117eab9d20accf0fde7166006c88e47f25ecf852aa3f461ad3658f0c402494358699
7
+ data.tar.gz: 914d5fd92572e8d4f05ba0a25b5e6e50da4fd5e8ca1da6ff1dbc22747c8a4670f581302dc3ab3250013d7e9aab4ddf4e31a1d6029d6031e844780782e6b3368e
data/.gitignore CHANGED
@@ -1,5 +1,5 @@
1
1
  .ruby-version
2
2
  /.bundle
3
3
  .DS_Store
4
- config/secrets.yml
4
+ .env
5
5
  telegram-scrum-bot*.gem
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  ruby '2.5.0'
4
4
 
5
+ gem 'dotenv', '~> 2.5'
5
6
  gem 'httparty', '~> 0.16.2'
6
7
  gem 'rspec', '~> 3.8'
7
8
  gem 'telegram_bot', '~> 0.0.8'
@@ -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
- ### From the Github Repository:
7
+ You must setup the required enviroment variables inside `.bashrc` or `.zshrc` depend of your terminal configuration:
8
+
8
9
  ```bash
9
- git clone https://github.com/hackvan/telegram-bot.git
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
- For development you must be create the file `secrets.yml` inside the `config` directory and put the Telegram and Trello tokens information on this structure:
16
+ Or for development create a `.env` file with the next information:
13
17
 
14
- ```yaml
15
- telegram:
16
- token: 'TOKEN-INFO'
17
- trello:
18
- key: 'KEY-INFO'
19
- token: 'TOKEN-INFO'
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
@@ -3,18 +3,10 @@ require_relative 'telegram-bot/bot'
3
3
  module TelegramBot
4
4
  end
5
5
 
6
- begin
7
- # Search the config/secrets.yml used for development enviroment:
8
- config = YAML.load_file("./config/secrets.yml")
9
- API_TELEGRAM_TOKEN = config['telegram']['token']
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)
@@ -232,9 +232,12 @@ module TelegramBot
232
232
  end
233
233
 
234
234
  if __FILE__ == $0
235
- config = YAML.load_file("./config/secrets.yml")
236
- TelegramBot::TelegramScrumBot.set_token(config['telegram']['token'])
237
- TelegramBot::set_trello_tokens(config['trello']['key'], config['trello']['token'])
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
@@ -1,4 +1,4 @@
1
1
  module TelegramBot
2
- VERSION = "0.0.4".freeze
3
- RELEASE_DATE = "2018-10-05".freeze
2
+ VERSION = "0.0.5".freeze
3
+ RELEASE_DATE = "2018-10-09".freeze
4
4
  end
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
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-05 00:00:00.000000000 Z
11
+ date: 2018-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: telegram_bot