telegram-bot-ruby 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.rubocop.yml +1 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +5 -0
- data/README.md +1 -0
- data/Rakefile +5 -1
- data/lib/telegram/bot/api.rb +7 -0
- data/lib/telegram/bot/client.rb +2 -1
- data/lib/telegram/bot/version.rb +1 -1
- data/telegram-bot-ruby.gemspec +3 -0
- metadata +47 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8650ba94f288d865b3e28b7c048b1ae1a9b9d94e
|
4
|
+
data.tar.gz: 19164744782cc7cdca0baef1bffe18317137a1c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b56bf52fcb734518d9d588d572945b97b13315e514adefead8210f6e69e8cc847272a279f155fbb6ecb428ea493be6d7e9d043d528335868ee6ff320186ffd3
|
7
|
+
data.tar.gz: 1c13c8cd9c5852dabd60557ae9e367d890b576309101bb0840bb01c6598d62c012d29d8a60d034d575f8a4a28d6dae70871db04d43236f950ec5fe44c7212af2
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
CHANGED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -4,6 +4,7 @@ Ruby wrapper for [Telegram's Bot API](https://core.telegram.org/bots/api).
|
|
4
4
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/telegram-bot-ruby.svg)](http://badge.fury.io/rb/telegram-bot-ruby)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/atipugin/telegram-bot-ruby/badges/gpa.svg)](https://codeclimate.com/github/atipugin/telegram-bot-ruby)
|
7
|
+
[![Build Status](https://travis-ci.org/atipugin/telegram-bot-ruby.svg?branch=master)](https://travis-ci.org/atipugin/telegram-bot-ruby)
|
7
8
|
|
8
9
|
## Installation
|
9
10
|
|
data/Rakefile
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'bundler/setup'
|
3
3
|
require 'rubocop/rake_task'
|
4
|
+
require 'rspec/core/rake_task'
|
4
5
|
|
5
6
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
6
7
|
task.fail_on_error = false
|
7
8
|
task.options = %w(--force-exclusion)
|
8
9
|
task.patterns = %w(lib/**/*.rb)
|
10
|
+
task.requires << 'rubocop-rspec'
|
9
11
|
end
|
10
12
|
|
11
|
-
|
13
|
+
RSpec::Core::RakeTask.new(:spec)
|
14
|
+
|
15
|
+
task default: :spec
|
data/lib/telegram/bot/api.rb
CHANGED
@@ -40,6 +40,13 @@ module Telegram
|
|
40
40
|
ENDPOINTS.include?(endpoint) ? call(endpoint, *args) : super
|
41
41
|
end
|
42
42
|
|
43
|
+
def respond_to_missing?(*args)
|
44
|
+
method_name = args[0].to_s
|
45
|
+
method_name = camelize(method_name) if method_name.include?('_')
|
46
|
+
|
47
|
+
ENDPOINTS.include?(method_name) || super
|
48
|
+
end
|
49
|
+
|
43
50
|
def call(endpoint, raw_params = {})
|
44
51
|
params = build_params(raw_params)
|
45
52
|
response = self.class.post("/bot#{token}/#{endpoint}", query: params)
|
data/lib/telegram/bot/client.rb
CHANGED
@@ -4,7 +4,8 @@ module Telegram
|
|
4
4
|
TIMEOUT_EXCEPTIONS = [Timeout::Error]
|
5
5
|
TIMEOUT_EXCEPTIONS << Net::ReadTimeout if Net.const_defined?(:ReadTimeout)
|
6
6
|
|
7
|
-
attr_reader :api, :offset, :timeout
|
7
|
+
attr_reader :api, :offset, :timeout
|
8
|
+
attr_accessor :logger
|
8
9
|
|
9
10
|
def self.run(*args, &block)
|
10
11
|
new(*args).run(&block)
|
data/lib/telegram/bot/version.rb
CHANGED
data/telegram-bot-ruby.gemspec
CHANGED
@@ -25,4 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
26
26
|
spec.add_development_dependency 'pry'
|
27
27
|
spec.add_development_dependency 'rubocop'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.4'
|
29
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.4'
|
30
|
+
spec.add_development_dependency 'nokogiri', '~> 1.6'
|
28
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telegram-bot-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Tipugin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httmultiparty
|
@@ -108,6 +108,48 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.4'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.4'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-rspec
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '1.4'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '1.4'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: nokogiri
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1.6'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1.6'
|
111
153
|
description:
|
112
154
|
email:
|
113
155
|
- atipugin@gmail.com
|
@@ -116,8 +158,11 @@ extensions: []
|
|
116
158
|
extra_rdoc_files: []
|
117
159
|
files:
|
118
160
|
- ".gitignore"
|
161
|
+
- ".rspec"
|
119
162
|
- ".rubocop.yml"
|
120
163
|
- ".rubocop_todo.yml"
|
164
|
+
- ".travis.yml"
|
165
|
+
- CHANGELOG.md
|
121
166
|
- Gemfile
|
122
167
|
- README.md
|
123
168
|
- Rakefile
|