зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-03 17:55:52 +03:00
Сравнить коммиты
6 Коммитов
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
cd3d3739a4 | ||
|
|
a054ac704c | ||
|
|
23aa92e614 | ||
|
|
a49dca66fa | ||
|
|
2d5ca981ce | ||
|
|
cf9bd87cf2 |
@@ -15,6 +15,7 @@ Style/DotPosition: {EnforcedStyle: trailing}
|
|||||||
Style/FirstParameterIndentation: {EnforcedStyle: consistent}
|
Style/FirstParameterIndentation: {EnforcedStyle: consistent}
|
||||||
Style/IfUnlessModifier: {Enabled: false}
|
Style/IfUnlessModifier: {Enabled: false}
|
||||||
Style/ModuleFunction: {Enabled: false}
|
Style/ModuleFunction: {Enabled: false}
|
||||||
|
Style/MultilineMethodCallIndentation: {EnforcedStyle: indented}
|
||||||
Style/MultilineOperationIndentation: {EnforcedStyle: indented}
|
Style/MultilineOperationIndentation: {EnforcedStyle: indented}
|
||||||
Style/NestedParenthesizedCalls: {Enabled: false}
|
Style/NestedParenthesizedCalls: {Enabled: false}
|
||||||
Style/PredicateName: {Enabled: false}
|
Style/PredicateName: {Enabled: false}
|
||||||
|
|||||||
@@ -5,5 +5,6 @@ rvm:
|
|||||||
env:
|
env:
|
||||||
- RAILS=4
|
- RAILS=4
|
||||||
- RAILS=5
|
- RAILS=5
|
||||||
|
- RAILS=5_1
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|||||||
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,6 +1,14 @@
|
|||||||
|
# 0.11.3
|
||||||
|
|
||||||
|
- Release dependencies for Rails 5.1.
|
||||||
|
|
||||||
|
# 0.11.2
|
||||||
|
|
||||||
|
- Rails 5.1 deep symbolized secrets support.
|
||||||
|
|
||||||
# 0.11.1
|
# 0.11.1
|
||||||
|
|
||||||
# Fixed poller for typed response.
|
- Fixed poller for typed response.
|
||||||
|
|
||||||
# 0.11.0
|
# 0.11.0
|
||||||
|
|
||||||
|
|||||||
4
Gemfile
4
Gemfile
@@ -2,8 +2,10 @@ source 'https://rubygems.org'
|
|||||||
gemspec
|
gemspec
|
||||||
|
|
||||||
case ENV['RAILS']
|
case ENV['RAILS']
|
||||||
|
when '5_1'
|
||||||
|
gem 'actionpack', '5.1.0'
|
||||||
when '5'
|
when '5'
|
||||||
gem 'actionpack', '5.0.0.rc1'
|
gem 'actionpack', '5.0.2'
|
||||||
when '4'
|
when '4'
|
||||||
gem 'actionpack', '~> 4.2'
|
gem 'actionpack', '~> 4.2'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,6 +43,12 @@ Or install it yourself as:
|
|||||||
|
|
||||||
$ gem install telegram-bot
|
$ gem install telegram-bot
|
||||||
|
|
||||||
|
Require if necessary:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'telegram/bot'
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
require 'active_support/core_ext/hash/keys'
|
require 'active_support/core_ext/hash/keys'
|
||||||
require 'active_support/core_ext/hash/transform_values'
|
require 'active_support/core_ext/hash/transform_values'
|
||||||
|
require 'active_support/core_ext/hash/indifferent_access'
|
||||||
|
|
||||||
module Telegram
|
module Telegram
|
||||||
module Bot
|
module Bot
|
||||||
@@ -48,9 +49,10 @@ module Telegram
|
|||||||
def bots_config
|
def bots_config
|
||||||
@bots_config ||=
|
@bots_config ||=
|
||||||
if defined?(Rails.application)
|
if defined?(Rails.application)
|
||||||
telegram_config = Rails.application.secrets[:telegram] || {}
|
secrets = Rails.application.secrets.
|
||||||
(telegram_config['bots'] || {}).symbolize_keys.tap do |config|
|
fetch(:telegram, {}).with_indifferent_access
|
||||||
default = telegram_config['bot']
|
secrets.fetch(:bots, {}).symbolize_keys.tap do |config|
|
||||||
|
default = secrets[:bot]
|
||||||
config[:default] = default if default
|
config[:default] = default if default
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module Telegram
|
module Telegram
|
||||||
module Bot
|
module Bot
|
||||||
VERSION = '0.11.1'.freeze
|
VERSION = '0.11.3'.freeze
|
||||||
|
|
||||||
def self.gem_version
|
def self.gem_version
|
||||||
Gem::Version.new VERSION
|
Gem::Version.new VERSION
|
||||||
|
|||||||
@@ -87,6 +87,12 @@ RSpec.describe Telegram::Bot::ConfigMethods do
|
|||||||
end
|
end
|
||||||
it { should include default: config[:bot] }
|
it { should include default: config[:bot] }
|
||||||
it { should include config[:bots] }
|
it { should include config[:bots] }
|
||||||
|
|
||||||
|
context 'on rails >5.1 (deep symbolized keys)' do
|
||||||
|
let(:secrets) { {telegram: config.deep_symbolize_keys} }
|
||||||
|
it { should include default: config[:bot] }
|
||||||
|
it { should include config[:bots] }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
|
|||||||
|
|
||||||
spec.required_ruby_version = '~> 2.0'
|
spec.required_ruby_version = '~> 2.0'
|
||||||
|
|
||||||
spec.add_dependency 'activesupport', '>= 4.0', '< 5.1'
|
spec.add_dependency 'activesupport', '>= 4.0', '<= 5.1'
|
||||||
spec.add_dependency 'actionpack', '>= 4.0', '< 5.1'
|
spec.add_dependency 'actionpack', '>= 4.0', '<= 5.1'
|
||||||
spec.add_dependency 'httpclient', '~> 2.7'
|
spec.add_dependency 'httpclient', '~> 2.7'
|
||||||
spec.add_development_dependency 'bundler', '~> 1.11'
|
spec.add_development_dependency 'bundler', '~> 1.11'
|
||||||
spec.add_development_dependency 'rake', '~> 10.0'
|
spec.add_development_dependency 'rake', '~> 10.0'
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user