Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dzmitry Monich - Hw 3 #56

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dzmitry-Monich/3/fasteng/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/.bundle/
/vendor/bundle
.DS_Store
*.gem
/tmp/
/.rubocop.yml
.env
.solargraph.yml
/log/*
3 changes: 3 additions & 0 deletions Dzmitry-Monich/3/fasteng/.rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--require spec_helper
--color
--format documentation
39 changes: 39 additions & 0 deletions Dzmitry-Monich/3/fasteng/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# frozen_string_literal: true

source 'https://rubygems.org'

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem 'telegram-bot-ruby', '~> 0.15.0'

gem 'dotenv', '~> 2.7'

gem 'rspec', '~> 3.10'

gem 'activerecord', '~> 6.0'

gem 'standalone_migrations', '~> 6.0'

gem 'rake', '~> 13.0'

gem 'pg', '~> 1.2'

gem 'pry', '~> 0.14.1'

gem 'shoulda-matchers', require: false

gem 'factory_bot'

gem 'database_cleaner-active_record'

gem 'whenever', require: false
gem 'whenever-test'

gem 'timecop', '~> 0.9.4'

gem 'faker', git: 'https://github.com/faker-ruby/faker.git', branch: 'master'

gem 'sinatra'
gem 'thin'

gem 'rack', '~> 2.2'
180 changes: 180 additions & 0 deletions Dzmitry-Monich/3/fasteng/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
GIT
remote: https://github.com/faker-ruby/faker.git
revision: aa31845ed54c25eb2638d716bfddf59771b502aa
branch: master
specs:
faker (2.18.0)
i18n (>= 1.6, < 2)

GEM
remote: https://rubygems.org/
specs:
actionpack (6.0.3.6)
actionview (= 6.0.3.6)
activesupport (= 6.0.3.6)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.0.3.6)
activesupport (= 6.0.3.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activemodel (6.0.3.6)
activesupport (= 6.0.3.6)
activerecord (6.0.3.6)
activemodel (= 6.0.3.6)
activesupport (= 6.0.3.6)
activesupport (6.0.3.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
builder (3.2.4)
chronic (0.10.2)
coderay (1.1.3)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.8)
crass (1.0.6)
daemons (1.3.1)
database_cleaner-active_record (2.0.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.4.4)
dotenv (2.7.6)
equalizer (0.0.11)
erubi (1.10.0)
eventmachine (1.2.7)
factory_bot (6.1.0)
activesupport (>= 5.0.0)
faraday (1.4.1)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
inflecto (0.0.2)
loofah (2.9.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
method_source (1.0.0)
minitest (5.14.4)
multipart-post (2.1.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nokogiri (1.11.3-x86_64-darwin)
racc (~> 1.4)
pg (1.2.3)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.5.2)
rack (2.2.3)
rack-protection (2.1.0)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.0.3.6)
actionpack (= 6.0.3.6)
activesupport (= 6.0.3.6)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rake (13.0.3)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
ruby2_keywords (0.0.4)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
sinatra (2.1.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
tilt (~> 2.0)
standalone_migrations (6.0.0)
activerecord (>= 4.2.7, < 6.1.0, != 5.2.3.rc1, != 5.2.3)
railties (>= 4.2.7, < 6.1.0, != 5.2.3.rc1, != 5.2.3)
rake (>= 10.0)
telegram-bot-ruby (0.15.0)
faraday
inflecto
virtus
thin (1.8.0)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.1.0)
thread_safe (0.3.6)
tilt (2.0.10)
timecop (0.9.4)
tzinfo (1.2.9)
thread_safe (~> 0.1)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
whenever (1.0.0)
chronic (>= 0.6.3)
whenever-test (1.0.1)
whenever
zeitwerk (2.4.2)

PLATFORMS
x86_64-darwin-18

DEPENDENCIES
activerecord (~> 6.0)
database_cleaner-active_record
dotenv (~> 2.7)
factory_bot
faker!
pg (~> 1.2)
pry (~> 0.14.1)
rack (~> 2.2)
rake (~> 13.0)
rspec (~> 3.10)
shoulda-matchers
sinatra
standalone_migrations (~> 6.0)
telegram-bot-ruby (~> 0.15.0)
thin
timecop (~> 0.9.4)
whenever
whenever-test

BUNDLED WITH
2.2.16
31 changes: 31 additions & 0 deletions Dzmitry-Monich/3/fasteng/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
install:
bundle install

run:
bin/bot

server:
ruby lib/server.rb

test:
bundle exec rspec

tasks:
bundle exec rake --tasks

db-migrate:
bundle exec rake db:migrate

db-create:
bundle exec rake db:new_migration name=$(N)

# cron-setup:
# bundle exec whenever

cron-start:
bundle exec whenever --update-crontab --set environment=development

cron-stop:
bundle exec whenever --clear-crontab

.PHONY: test
1 change: 1 addition & 0 deletions Dzmitry-Monich/3/fasteng/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Bot
18 changes: 18 additions & 0 deletions Dzmitry-Monich/3/fasteng/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

# rubocop:disable Lint/RedundantCopDisableDirective
# rubocop:disable Rails/RakeEnvironment

require 'standalone_migrations'
StandaloneMigrations::Tasks.load_tasks

require_relative 'lib/fasteng'

namespace :cron do
task :notify do
Fasteng::NotifyHandler.call
end
end

# rubocop:enable Rails/RakeEnvironment
# rubocop:enable Lint/RedundantCopDisableDirective
11 changes: 11 additions & 0 deletions Dzmitry-Monich/3/fasteng/bin/bot
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# require 'rubygems'
require 'bundler/setup'
require_relative '../lib/fasteng'

Fasteng.config.url = 'https://693b7423ff69.ngrok.io'
# Fasteng.config.controller = 'polling'

Fasteng::App.run
Loading