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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76362152176d1e5b5d7b724d62ac5d49359a5408
4
- data.tar.gz: aae6dccb3e749871ef53af7eb48620ab35aed836
3
+ metadata.gz: c2057441130b005a11d9540a39f6b564af35a8ba
4
+ data.tar.gz: be94e987a02a1079732584d729402075945864cb
5
5
  SHA512:
6
- metadata.gz: d36a781ccc9075a58023154244365466f611c7d0623f4f43302073ea1bb4e83b5ce4ba6f0f432e0850bf5d79a820b2a279b49c9b76643dc609beb2823377f863
7
- data.tar.gz: 6ae5c31f6ef79e11dcb952a033b0ac9766361bb5a5b0470841baeecdeb2f69ad80012f7421954fb1ef6e0ebea6711dc29f45f16e9a9fecf02f66e809d8386ec7
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")
@@ -4,15 +4,27 @@ module Lifen
4
4
  private
5
5
 
6
6
  def faraday_client
7
- @faraday_client ||= Faraday.new(url: site) do |faraday|
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
@@ -1,6 +1,6 @@
1
1
  module Lifen
2
2
  class Configuration
3
- attr_accessor :site, :secret_key
3
+ attr_accessor :site, :secret_key, :proxy_url
4
4
  end
5
5
 
6
6
  def self.configuration
@@ -1,3 +1,3 @@
1
1
  module Lifen
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-08 00:00:00.000000000 Z
11
+ date: 2016-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler