micro_vkontakte 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,4 +1,4 @@
1
- v0.1.0 stable release
1
+ v0.1.1 bug fixes
2
2
  v0.0.11 added sid and secret to omniauth params
3
3
  v0.0.10 added sid and secret to omniauth
4
4
  v0.0.9 updated omniauth
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('micro_vkontakte', '0.1.0') do |p|
5
+ Echoe.new('micro_vkontakte', '0.1.1') do |p|
6
6
  p.description = "Vkontakte api tools."
7
7
  p.url = "http://github.com/gvalmon/micro_vkontakte"
8
8
  p.author = "Iskander Haziev"
@@ -9,7 +9,7 @@ module MicroVkontakte
9
9
  class ServerError < Error
10
10
  attr_accessor :method, :params, :error
11
11
  def initialize(method, params, error)
12
- super 'Server error'
12
+ super "Server error: #{error}"
13
13
  @method, @params, @error = method, params, error
14
14
  end
15
15
  end
@@ -13,7 +13,7 @@ module MicroVkontakte
13
13
  VK_API_URL = 'http://api.vk.com/api.php'
14
14
  attr_accessor :app_id, :api_secret
15
15
 
16
- def initialize(app_id, api_secret, prefix)
16
+ def initialize(app_id, api_secret, prefix = '')
17
17
  @app_id, @api_secret, @prefix = app_id, api_secret, prefix
18
18
  end
19
19
 
@@ -21,6 +21,7 @@ module MicroVkontakte
21
21
  params[:method] = @prefix ? "#{@prefix}.#{method}" : method
22
22
  params[:api_id] = app_id
23
23
  params[:format] = 'json'
24
+ params[:timestamp] = Time.now.to_i
24
25
  params[:sig] = sig(params.stringify_keys)
25
26
  response = JSON.parse(Net::HTTP.post_form(URI.parse(VK_API_URL), params).body)
26
27
  if response['error']
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{micro_vkontakte}
5
- s.version = "0.1.0"
5
+ s.version = "0.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Iskander Haziev"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_vkontakte
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Iskander Haziev