spinacz 0.0.8 → 0.0.9

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: b4a5aa15aa6add0b88158ce0318750cab583e2de
4
- data.tar.gz: e9d7a218bbf39dc0f62fb6236870f8b113c054f5
3
+ metadata.gz: da82fbd825e5c9d7f0a9505ebd16ccf5d19a2b33
4
+ data.tar.gz: 20d2612aea6aeb87173dcb8120d31bf9c342f2fe
5
5
  SHA512:
6
- metadata.gz: 5e478b16fb650f261eaf4d1582536c5a3879af1300df04473404a8d53ac34ffb58ba4b58dd1448bdae3ab21487a812c713919a53ea24ed7f4b709361ebd6217d
7
- data.tar.gz: 433b6db760ce15d6af429c9e3ed9586729f7e8acd1a31a22da318d0cc4509e1b16e582b3ff02f0f5d19eb65c04fef97d093f2fddbf90e09e6d60078919aa7aed
6
+ metadata.gz: 0467d05f331f2be03653d65f9d0c3f1ff57d07871766138a82493a654a8def19bb74b89b4a3596c658106d3137eca22fa1bb6b84ea4f279a72e221eea01ee153
7
+ data.tar.gz: 4e68dfc5d75427903a9e7b775b97efcfb89ff861c8aa7d9b7b70d75712e327447a9ea31cb2f0dfe3bbf0ef705bf5b003dbc90c03f21e6249812d4142fc8600e8
@@ -1,8 +1,9 @@
1
1
  module Spinacz
2
2
  class Client
3
- attr_accessor :email, :password, :token
3
+ attr_accessor :email, :password, :token, :test
4
4
 
5
5
  URL = 'https://spinacz.pl'
6
+ TEST_URL = 'https://test.spinacz.pl'
6
7
 
7
8
  def initialize(credentials = {})
8
9
  @email = credentials[:email] || ENV['SPINACZ_EMAIL']
@@ -11,6 +12,7 @@ module Spinacz
11
12
  @password = @password.strip if @password
12
13
  @token = credentials[:token] || ENV['SPINACZ_TOKEN']
13
14
  @token = @token.strip if @token
15
+ @test = credentials[:test]
14
16
  end
15
17
 
16
18
  def login
@@ -89,8 +91,9 @@ module Spinacz
89
91
  def call_api(call_type, get_data, json_data = nil)
90
92
  json_data_converted = json_data ? json_data.to_json : ''
91
93
  endpoint = "/api/v1/#{get_data}"
94
+ url = @test ? TEST_URL : URL
92
95
 
93
- conn = Faraday.new(:url => URL) do |faraday|
96
+ conn = Faraday.new(url: url) do |faraday|
94
97
  faraday.request :url_encoded
95
98
  # faraday.response :logger
96
99
  faraday.adapter Faraday.default_adapter
@@ -1,3 +1,3 @@
1
1
  module Spinacz
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spinacz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Jan Adamczyk