lifen 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/lifen/client.rb +13 -1
- data/lib/lifen/configuration.rb +1 -1
- data/lib/lifen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2057441130b005a11d9540a39f6b564af35a8ba
|
4
|
+
data.tar.gz: be94e987a02a1079732584d729402075945864cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17a66b9fa876808118445b10fdd7a923794f6d7b8934c80d40659e4c76e261cacb76d6eb674484adf916d066fff855b3bc11cfe5d48c27ef6019924401c1d9d4
|
7
|
+
data.tar.gz: 3fff5a262466a8c1dcc7c52ce88cf56d76f5beae3cc7199bb674ca5708890b6672d8989cebb073049945fe3479697da30a5f62be0ab150100523e1818027a37f
|
data/README.md
CHANGED
@@ -25,8 +25,11 @@ Lifen can be configured (ideally inside an initializer) like so:
|
|
25
25
|
Lifen.configure do |config|
|
26
26
|
config.site = "http://develop.lifen.fr/"
|
27
27
|
config.secret_key = "secret_key"
|
28
|
+
config.proxy_url = "http://my.proxy.fr/"
|
28
29
|
end
|
29
30
|
|
31
|
+
`site` and `secret_key` are mandatory attributes.
|
32
|
+
|
30
33
|
### Managing users
|
31
34
|
|
32
35
|
user = Lifen::User.new(email: "email@domain.tld", first_name: "Jean", last_name: "Dupont")
|
data/lib/lifen/client.rb
CHANGED
@@ -4,15 +4,27 @@ module Lifen
|
|
4
4
|
private
|
5
5
|
|
6
6
|
def faraday_client
|
7
|
-
@faraday_client ||= Faraday.new(
|
7
|
+
@faraday_client ||= Faraday.new(faraday_options) do |faraday|
|
8
8
|
faraday.request :url_encoded # form-encode POST params
|
9
9
|
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
def faraday_options
|
14
|
+
options = {url: site}
|
15
|
+
|
16
|
+
options[:proxy] = proxy_url if !proxy_url.nil?
|
17
|
+
|
18
|
+
options
|
19
|
+
end
|
20
|
+
|
13
21
|
def site
|
14
22
|
Lifen.configuration.site
|
15
23
|
end
|
16
24
|
|
25
|
+
def proxy_url
|
26
|
+
Lifen.configuration.proxy_url
|
27
|
+
end
|
28
|
+
|
17
29
|
end
|
18
30
|
end
|
data/lib/lifen/configuration.rb
CHANGED
data/lib/lifen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lifen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Etienne Depaulis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|