Skip to content

Commit

Permalink
release 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
7even committed Jul 14, 2013
1 parent 9ec3a35 commit 19c02af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.2 (14.07.2013)

* Повтор запроса при определенных ошибках
* Корректная работа метода `messages.send`
* Поддержка параметров `captcha_sid` и `captcha_img` при ошибке 14

## 1.1 (18.12.2012)

* Передача `redirect_uri` при получении токена
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

``` ruby
# Gemfile
gem 'vkontakte_api', '~> 1.1'
gem 'vkontakte_api', '~> 1.2'
```

или просто
Expand Down Expand Up @@ -181,6 +181,8 @@ vk.friends.get(uid: 1, fields: [:first_name, :last_name, :photo])
# VkontakteApi::Error: VKontakte returned an error 7: 'Permission to perform this action is denied' after calling method 'friends.get' with parameters {"uid"=>"1", "fields"=>"first_name,last_name,photo"}.
```

Особый случай ошибки - 14: необходимо ввести код с captcha. В этом случае можно получить параметры капчи методами `VkontakteApi::Error#captcha_sid` и `VkontakteApi::Error#captcha_img` - например, [так](https://github.com/7even/vkontakte_api/issues/10#issuecomment-11666091).

### Логгирование

`vkontakte_api` логгирует служебную информацию о запросах при вызове методов. По умолчанию все пишется в `STDOUT`, но в настройке можно указать любой другой совместимый логгер, например `Rails.logger`.
Expand Down Expand Up @@ -228,6 +230,8 @@ VkontakteApi.configure do |config|
password: 'bar'
}
}
# максимальное количество повторов запроса при ошибках
config.max_retries = 2

# логгер
config.logger = Rails.logger
Expand Down
2 changes: 2 additions & 0 deletions lib/vkontakte_api/resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def namespaces
@namespaces
end

# When this module is included, it undefines the `:send` instance method in the `base_class`
# so it can be resolved via `method_missing`.
def included(base_class)
base_class.class_eval do
undef_method :send
Expand Down

0 comments on commit 19c02af

Please sign in to comment.