pechkinrb 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/lib/pechkinrb/pechkin.rb +5 -2
- data/lib/pechkinrb/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8779109ec7de6a5e1d25e5038ea714c37def64da
|
4
|
+
data.tar.gz: 1530886d1298a99dd8ca90f1b526de850a9da695
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e680d6f2d3c3c27786621eace49632ba6e0bd55e1673e4d883bcb421b87bbd149fd82717d93471190eb39a8f3592ffe387c27667e07d9871109e6728808dd7f
|
7
|
+
data.tar.gz: 309abeac83e11489e53939a0174dd1075cb3715831f3f3da56b5d69e40a21f0a9a1c3ecc51099cf7224c586450a27ab3c938237a539e24ec45215372d19f6f1d
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# PechkinRb
|
2
2
|
|
3
|
-
[![Code Climate](https://codeclimate.com/github/crsde/PechkinRb/badges/gpa.svg)](https://codeclimate.com/github/crsde/PechkinRb)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/crsde/PechkinRb/badges/gpa.svg)](https://codeclimate.com/github/crsde/PechkinRb) [![Gem Version](https://badge.fury.io/rb/pechkinrb.svg)](http://badge.fury.io/rb/pechkinrb)
|
4
4
|
|
5
5
|
This gem provides you with simple Ruby interface for pechkin-mail.ru mail service.
|
6
6
|
|
@@ -32,6 +32,11 @@ PechkinRb declares some classes for API objects, like *List*, *Member*, etc
|
|
32
32
|
conn = Pechkin::Connection.new('login', 'password')
|
33
33
|
conn.lists # => Array of Pechkin::List instances
|
34
34
|
|
35
|
+
Optionally you can additionally pass third parameter to Pechkin::Connection constructor, to change API url (for example if you plan to use compatible service):
|
36
|
+
|
37
|
+
conn = Pechkin::Connection.new('login', 'password', 'https://api.pechkin-mail.ru')
|
38
|
+
|
39
|
+
|
35
40
|
Also, you can use universal invocation method with *#call_method*
|
36
41
|
|
37
42
|
conn.call_method('lists.get_members', list_id: 1)
|
data/lib/pechkinrb/pechkin.rb
CHANGED
@@ -10,15 +10,18 @@ module Pechkin
|
|
10
10
|
#
|
11
11
|
# @param username [String] Service username
|
12
12
|
# @param password [String] Password
|
13
|
-
def initialize(username, password)
|
13
|
+
def initialize(username, password, endpoint = API_URL)
|
14
14
|
@username, @password = username, password
|
15
|
+
@endpoint = endpoint
|
15
16
|
end
|
16
17
|
|
18
|
+
attr_reader :endpoint
|
19
|
+
|
17
20
|
# Memoized Faraday connection factory
|
18
21
|
#
|
19
22
|
# @return Faraday connection instance
|
20
23
|
def connection
|
21
|
-
@conn ||= Faraday.new(:url =>
|
24
|
+
@conn ||= Faraday.new(:url => endpoint) do |faraday|
|
22
25
|
faraday.request :url_encoded
|
23
26
|
faraday.response :json
|
24
27
|
faraday.adapter Faraday.default_adapter
|
data/lib/pechkinrb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pechkinrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandr Prokopenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,11 +122,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.4.8
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Interface for pechkin-mail.ru service API
|
129
129
|
test_files:
|
130
130
|
- spec/connection_spec.rb
|
131
131
|
- spec/spec_helper.rb
|
132
|
-
has_rdoc:
|