1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-08-28 15:26:18 +03:00

Merge pull request #65 from telegram-bot-rb/rails-6

Prepare for rails 6
Этот коммит содержится в:
printercu
2018-02-21 21:34:49 +03:00
коммит произвёл GitHub
родитель c86b2ef09b f39a451192
Коммит bdff6b2e1c
5 изменённых файлов: 53 добавлений и 10 удалений

Просмотреть файл

@@ -1,14 +1,28 @@
language: ruby
cache: bundler
rvm:
- 2.5
- 2.4
- 2.3
- 2.5
- 2.4
gemfile:
- gemfiles/rails_52.gemfile
- gemfiles/rails_51.gemfile
- gemfiles/rails_50.gemfile
- gemfiles/rails_42.gemfile
- gemfiles/rails_52.gemfile
- gemfiles/rails_51.gemfile
matrix:
include:
# old rails
- rvm: 2.5
gemfile: gemfiles/rails_50.gemfile
- rvm: 2.5
gemfile: gemfiles/rails_42.gemfile
# old rubies
- rvm: 2.3
gemfile: gemfiles/rails_52.gemfile
# future rails
- rvm: 2.5
gemfile: gemfiles/rails_60.gemfile
# Allow rails 6 to fail while master branch is used
allow_failures:
- rvm: 2.5
gemfile: gemfiles/rails_60.gemfile
notifications:
email: false

Просмотреть файл

@@ -1,3 +1,10 @@
appraise 'rails-60' do
git 'https://github.com/rails/rails.git' do
gem 'actionpack', '~> 6.0.0.alpha'
gem 'railties', '~> 6.0.0.alpha'
end
end
appraise 'rails-52' do
gem 'actionpack', '~> 5.2.0.beta2'
gem 'railties', '~> 5.2.0.beta2'

23
gemfiles/rails_60.gemfile Обычный файл
Просмотреть файл

@@ -0,0 +1,23 @@
# This file was generated by Appraisal
source "https://rubygems.org"
git "https://github.com/rails/rails.git" do
gem "actionpack", "~> 6.0.0.alpha"
gem "railties", "~> 6.0.0.alpha"
end
group :development do
gem "appraisal", "~> 2.2"
gem "pry", "~> 0.10.1"
gem "pry-byebug", "~> 3.2.0"
gem "sdoc", "~> 0.4.1"
gem "telegram-bot-types", "~> 0.3.0"
gem "rspec", "~> 3.5.0"
gem "rspec-its", "~> 1.1.0"
gem "rspec-rails", "~> 3.5.0"
gem "rubocop", "~> 0.52.1"
gem "coveralls", "~> 0.8.2", require: false
end
gemspec path: "../"

Просмотреть файл

@@ -1,5 +1,4 @@
require 'active_support/core_ext/hash/keys'
require 'active_support/core_ext/hash/transform_values'
require 'active_support/core_ext/hash/indifferent_access'
module Telegram
@@ -43,7 +42,7 @@ module Telegram
# Hash of botan clients made from #bots.
def botans
@botans ||= bots.transform_values(&:botan)
@botans ||= bots.map { |k, v| [k, v.botan] }.to_h
end
# Returns config for .bots method. By default uses `telegram['bots']` section

Просмотреть файл

@@ -35,7 +35,7 @@ RSpec.shared_context 'telegram/bot/updates_controller' do
def deep_stringify(input)
case input
when Array then input.map(&method(__callee__))
when Hash then input.transform_keys(&:to_s).transform_values(&method(__callee__))
when Hash then input.map { |k, v| [k.to_s, deep_stringify(v)] }.to_h
else input
end
end