lolcation_client 0.2.2 → 0.2.3

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: 9ad80fc8f98bed7e355132d27b7a41987e05b774
4
- data.tar.gz: 9b7c438954a5efaf3cde8dff9c9e63de36db529a
3
+ metadata.gz: b8ed3b3cf03f08a0c02dee0f835b096fb4892ef4
4
+ data.tar.gz: 393779c29c70e6f853b4a05522436657e1d5cc91
5
5
  SHA512:
6
- metadata.gz: 713322e5a6a404f21dbd2609fd1fd663992a99fe6b5e459d6d248b76b9756fed9d14399084f7b050fb844eb521f6e69241c9f3dec18ac68809d3fc32a34ee42d
7
- data.tar.gz: 29fd6c962e0c47db1c4648e80ae6138bf0fa407bc86b412b6c385600acf01c6370d21cc55538279291376e11c17da6d4d92c353ad68278fa8bd692b9f013bb31
6
+ metadata.gz: fdc77e1c89d819dc8e63834b951aaa910147de592fd0fca6433ecb515ef92eb902875619c266cdef5cbb9bb4b6a4d5663175dd5f44291df428e886fa8c7087d3
7
+ data.tar.gz: 82bbc906ac688466b03f3753052edda79b6feb731696a59d0b7253a494aea1da3229d9e65a8b9916ec706ee57724fb76c1d5982869a5c9d9749e34a94911f440
@@ -1,8 +1,11 @@
1
1
  development:
2
+ servie_url: 'https://lolcation-service.loldesign.com.br'
2
3
  token: 'Insert your token here'
3
4
  sandbox: true
4
5
  staging:
6
+ servie_url: 'https://lolcation-service.loldesign.com.br'
5
7
  token: 'Insert your token here'
6
8
  sandbox: true
7
9
  production:
10
+ servie_url: 'https://lolcation-service.loldesign.com.br'
8
11
  token: 'Insert your token here'
@@ -1,12 +1,13 @@
1
1
  module LolcationClient
2
2
  module Configurations
3
- API = "/api/v1/localizations"
4
- URL = Rails.env.development? ? "http://localhost:8000#{API}" : "https://lolcation-service.loldesign.com.br#{API}"
5
-
6
3
  def configs
7
4
  Rails.application.config_for(:lolcation)
8
5
  end
9
6
 
7
+ def service_url
8
+ "#{configs['servie_url']}/api/v1/localizations"
9
+ end
10
+
10
11
  def token
11
12
  configs["token"]
12
13
  end
@@ -65,8 +65,7 @@ module LolcationClient
65
65
  end
66
66
 
67
67
  def create_on_lolcation_server
68
- url = LolcationClient::Configurations::URL
69
- conn = Faraday.new(url: url)
68
+ conn = Faraday.new(url: service_url)
70
69
  conn.post do |r|
71
70
  r.headers["X-Token"] = token
72
71
  r.headers["Content-Type"] = "application/json"
@@ -75,8 +74,7 @@ module LolcationClient
75
74
  end
76
75
 
77
76
  def update_on_lolcation_server
78
- url = LolcationClient::Configurations::URL
79
- conn = Faraday.new(url: "#{url}/#{self.lolcation_id}")
77
+ conn = Faraday.new(url: "#{service_url}/#{self.lolcation_id}")
80
78
  conn.put do |r|
81
79
  r.headers["X-Token"] = token
82
80
  r.headers["Content-Type"] = "application/json"
@@ -24,8 +24,7 @@ module LolcationClient
24
24
  private
25
25
 
26
26
  def do_post(options = {})
27
- url = LolcationClient::Configurations::URL
28
- conn = Faraday.new(url: "#{url}/near-me")
27
+ conn = Faraday.new(url: "#{service_url}/near-me")
29
28
  conn.post do |r|
30
29
  r.headers["X-Token"] = token
31
30
  r.headers["Content-Type"] = "application/json"
@@ -1,3 +1,3 @@
1
1
  module LolcationClient
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolcation_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Zaghi