neetodeploy 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ab15f066189c5b30250ff4b140cdc5e41abe8bd8dc74ec0e452aebf5a783782
4
- data.tar.gz: 55c8b9dfe06de17f9977a0909e134ec29d392f4a4027a8123a140d1d41d5c31d
3
+ metadata.gz: 518719f22d6967ef7bc0acde463bad118be36bb2b4e0e8de6b28cb7f91110dd6
4
+ data.tar.gz: a08a4c651fde80dc3a348c517d3f43c415c985340395338fc878ee0704a14e62
5
5
  SHA512:
6
- metadata.gz: d2e8239f4bf6997a1e4effbbc9d2c35ba35d9799b8435ec13b6027ffb5fb4374610f2b8e96e3827f9ce1ec228b548674fb4058124f30f9c28ab9077bebf97a1c
7
- data.tar.gz: 1a84ce52eb7148fda8a95099d98e73865fb5625c9a0de97122ea89e4d330ae8be3bdbbecdca39954359de4de8146f2a02d25244223624b6d5acbc2df4161609e
6
+ metadata.gz: a7280eab15a0a7495a4ff364df2cc4647f340f4232488fe3231c6bda2b8ada04eed3e9a2050e90740e3495ff6e7ae124ec34abcbaa6a755fb16f32652d7da063
7
+ data.tar.gz: 84600455e6d2cc3aa9e4205399f62b10a26fe58b7a49d94ccc6e7f18a6185639acd88484d8c6aca65f65d4044b5335d5f62cf01d57cb5d16807dccbe30179b37
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neetodeploy (1.1.25)
4
+ neetodeploy (1.4.1)
5
5
  base64
6
6
  bigdecimal
7
7
  colorize
@@ -19,28 +19,32 @@ module NeetoDeploy
19
19
  end
20
20
 
21
21
  def send_get_request(url, body)
22
- HTTParty.get(url, { query: common_body.merge(body), format: :json })
22
+ HTTParty.get(url, { query: body, headers: auth_headers, format: :json })
23
23
  end
24
24
 
25
25
  def send_post_request(url, body)
26
- HTTParty.post(url, { body: common_body.merge(body), format: :json })
26
+ HTTParty.post(url, { body: body.to_json, headers: json_auth_headers, format: :json })
27
27
  end
28
28
 
29
29
  def send_patch_request(url, body)
30
- HTTParty.patch(url, { body: common_body.merge(body), format: :json })
30
+ HTTParty.patch(url, { body: body.to_json, headers: json_auth_headers, format: :json })
31
31
  end
32
32
 
33
33
  def send_delete_request(url, body)
34
- HTTParty.delete(url, { body: common_body.merge(body), format: :json })
34
+ HTTParty.delete(url, { body: body.to_json, headers: json_auth_headers, format: :json })
35
35
  end
36
36
 
37
- def common_body
37
+ def auth_headers
38
38
  session_info = JSON.parse(File.read(CLI_SESSION_STORE_FILE_PATH))
39
- { session_token: session_info["session_token"] }
39
+ { "Session-Token" => session_info["session_token"] }
40
40
  rescue
41
41
  raise Error.new("Unable to retrieve session info. Try logging in again.")
42
42
  end
43
43
 
44
+ def json_auth_headers
45
+ auth_headers.merge("Content-Type" => "application/json")
46
+ end
47
+
44
48
  def os
45
49
  @os ||= (
46
50
  host_os = RbConfig::CONFIG["host_os"]
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NeetoDeploy
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.2"
5
5
  CLI_API_VERSION = "v1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neetodeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin Siby