mailru-api 0.7.0 → 1.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/{mailru-api → mailru}/api.rb +15 -32
- data/lib/mailru/api/configuration_builder.rb +20 -0
- data/lib/{mailru-api → mailru/api}/dsl.rb +0 -2
- data/lib/{mailru-api → mailru/api}/error.rb +1 -3
- data/lib/mailru/api/format.rb +8 -0
- data/lib/{mailru-api → mailru/api}/request.rb +0 -2
- metadata +69 -11
- data/lib/mailru-api.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 742cfc55de9d900b59e23ebd289fce3bfadbae3c
|
4
|
+
data.tar.gz: 5e97e8657bccb8d58d2187522d759ae59d100b1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4299d2b156e9133437ec15b2d6695c7fbf44a9328ebde0b74b9140ccabfdac4312f05c9bfdc62cdd7b1935fbedcd2f801bf8f0eb0818fbdea974e436aa89279
|
7
|
+
data.tar.gz: 8598b81a70e77c095b53225434b4721d0b828a64d3b57e2af4ad2dec3730c12f1d62545403b9888a211db9184593d7824c8eda4240de582c090ce0b121d268ac
|
@@ -1,32 +1,8 @@
|
|
1
|
-
#:encoding: utf-8
|
2
|
-
|
3
1
|
module MailRU
|
4
2
|
class API
|
5
3
|
PATH = 'http://www.appsmail.ru/platform/api'
|
6
4
|
PARAMS = [:app_id, :secret_key, :private_key, :session_key, :uid, :format]
|
7
5
|
|
8
|
-
module Format
|
9
|
-
XML = 'xml'
|
10
|
-
JSON = 'json'
|
11
|
-
end
|
12
|
-
|
13
|
-
class ConfigurationBuilder
|
14
|
-
attr_reader :configuration
|
15
|
-
|
16
|
-
def initialize(&block)
|
17
|
-
@configuration = {}
|
18
|
-
instance_eval(&block) if block_given?
|
19
|
-
end
|
20
|
-
|
21
|
-
PARAMS.each do |param|
|
22
|
-
class_eval <<-EOV, __FILE__, __LINE__ + 1
|
23
|
-
def #{param}(value) # def app_id(value)
|
24
|
-
@configuration[:#{param}] = value # @configuration[:app_id] = value
|
25
|
-
end # end
|
26
|
-
EOV
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
6
|
def initialize options = {}, &block
|
31
7
|
@configuration = options
|
32
8
|
|
@@ -61,9 +37,10 @@ module MailRU
|
|
61
37
|
|
62
38
|
def audio
|
63
39
|
DSL.new(self, 'audio') do
|
64
|
-
api 'get'
|
40
|
+
api 'get', :post
|
65
41
|
api 'link'
|
66
|
-
api 'search'
|
42
|
+
api 'search', :post
|
43
|
+
api 'top', :get, Request::Secure::No
|
67
44
|
end
|
68
45
|
end
|
69
46
|
|
@@ -112,22 +89,22 @@ module MailRU
|
|
112
89
|
|
113
90
|
def notifications
|
114
91
|
DSL.new(self, 'notifications') do
|
115
|
-
api 'send', :
|
92
|
+
api 'send', :post, Request::Secure::Yes
|
116
93
|
end
|
117
94
|
end
|
118
95
|
|
119
96
|
def photos
|
120
97
|
DSL.new(self, 'photos') do
|
121
|
-
api 'createAlbum'
|
122
|
-
api 'get'
|
123
|
-
api 'getAlbums'
|
98
|
+
api 'createAlbum', :post
|
99
|
+
api 'get', :post
|
100
|
+
api 'getAlbums', :post
|
124
101
|
api 'upload', :post
|
125
102
|
end
|
126
103
|
end
|
127
104
|
|
128
105
|
def stream
|
129
106
|
DSL.new(self, 'stream') do
|
130
|
-
api 'comment'
|
107
|
+
api 'comment', :post
|
131
108
|
api 'get'
|
132
109
|
api 'getByAuthor'
|
133
110
|
api 'like'
|
@@ -140,10 +117,16 @@ module MailRU
|
|
140
117
|
def users
|
141
118
|
DSL.new(self, 'users') do
|
142
119
|
api 'getBalance'
|
143
|
-
api 'getInfo'
|
120
|
+
api 'getInfo', :post
|
144
121
|
api 'hasAppPermission'
|
145
122
|
api 'isAppUser'
|
146
123
|
end
|
147
124
|
end
|
148
125
|
end
|
149
126
|
end
|
127
|
+
|
128
|
+
require 'mailru/api/configuration_builder'
|
129
|
+
require 'mailru/api/dsl'
|
130
|
+
require 'mailru/api/error'
|
131
|
+
require 'mailru/api/format'
|
132
|
+
require 'mailru/api/request'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module MailRU
|
2
|
+
class API
|
3
|
+
class ConfigurationBuilder
|
4
|
+
attr_reader :configuration
|
5
|
+
|
6
|
+
def initialize(&block)
|
7
|
+
@configuration = {}
|
8
|
+
instance_eval(&block) if block_given?
|
9
|
+
end
|
10
|
+
|
11
|
+
PARAMS.each do |param|
|
12
|
+
class_eval <<-EOV, __FILE__, __LINE__ + 1
|
13
|
+
def #{param}(value) # def app_id(value)
|
14
|
+
@configuration[:#{param}] = value # @configuration[:app_id] = value
|
15
|
+
end # end
|
16
|
+
EOV
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,26 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailru-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Demin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
12
|
-
dependencies:
|
13
|
-
|
11
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 10.0.1
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 10.0.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.14.1
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.14.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: webmock
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.15.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.15.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coveralls
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.7.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.7.0
|
69
|
+
description:
|
14
70
|
email: demin.alexey@inbox.ru
|
15
71
|
executables: []
|
16
72
|
extensions: []
|
17
73
|
extra_rdoc_files: []
|
18
74
|
files:
|
19
|
-
- lib/mailru
|
20
|
-
- lib/mailru
|
21
|
-
- lib/mailru
|
22
|
-
- lib/mailru
|
23
|
-
- lib/mailru
|
75
|
+
- lib/mailru/api.rb
|
76
|
+
- lib/mailru/api/configuration_builder.rb
|
77
|
+
- lib/mailru/api/error.rb
|
78
|
+
- lib/mailru/api/format.rb
|
79
|
+
- lib/mailru/api/request.rb
|
80
|
+
- lib/mailru/api/dsl.rb
|
24
81
|
homepage: https://github.com/ademin/mailru-api
|
25
82
|
licenses:
|
26
83
|
- MIT
|
@@ -36,9 +93,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
36
93
|
version: 1.9.3
|
37
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
95
|
requirements:
|
39
|
-
- - '
|
96
|
+
- - '>'
|
40
97
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
98
|
+
version: 1.3.1
|
42
99
|
requirements: []
|
43
100
|
rubyforge_project:
|
44
101
|
rubygems_version: 2.0.3
|
@@ -46,3 +103,4 @@ signing_key:
|
|
46
103
|
specification_version: 4
|
47
104
|
summary: Ruby @Mail.RU API
|
48
105
|
test_files: []
|
106
|
+
has_rdoc:
|