palladium 1.0.0 → 1.1.0

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: a30fbc7dbca9da77d81c7c23dfa78c53bd8510ab0e96aadb1537dbf46d27d747
4
- data.tar.gz: 987c049a515fdb04f83bc82e1323faa3cb4f0ef590c2bb850a2962327207a888
3
+ metadata.gz: d05e520a7a2fbe6335acd8dfd02983197f89d0ecf0fa4e3c6fc29838fca26f02
4
+ data.tar.gz: 1deae261c49894c4fb874784bab262fdb2d649bb44284cfbbb007490cda032bc
5
5
  SHA512:
6
- metadata.gz: a6caf1e0c1fbbd2ccf07d1338bc4f8692639f501977cfd4273b7e5553577d69d70ca62d104b07e8c5fe711f66920640dcec6c99fe0ab459625ed2d5ee41f0f2d
7
- data.tar.gz: 2929d78eccf92b4f56f4d4c89076f317739172695d86badedfc73946aac36ec4252d5e997da4200f6fb60230f7bf459590d115e54566c8a205f4b5869fd68d76
6
+ metadata.gz: 00440c93414805bb13882711df753a21423a812ed87e9dba77ef1ad90033950d870da3276cdc16a4c022dcbf6f4f95b3a92ee72455acb7cdca71bec6a98697d9
7
+ data.tar.gz: d1ddb455e73d7614ba3d47aad59916fd5a8a6c0f8f8e32ed95ff9ad1147d7ef5a3b893ee77abae21c3a23061cafacfd1471161a68a46635697601d1e062aeb5f
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Palladium
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
data/lib/palladium.rb CHANGED
@@ -17,10 +17,10 @@ module Palladium
17
17
  def initialize(options = {})
18
18
  @logger = Logger.new($stdout)
19
19
  @logger.level = options[:log] || 1
20
- options[:port] ||= 80
21
- @http = Net::HTTP.new(options[:host], options[:port])
20
+ @port = options[:port] || 443
21
+ @http = Net::HTTP.new(options[:host], @port)
22
+ @http.use_ssl = true if ssl_connection?
22
23
  @host = options[:host]
23
- @port = options[:port]
24
24
  @product = options[:product]
25
25
  @plan = options[:plan]
26
26
  @run = options[:run]
@@ -69,8 +69,16 @@ module Palladium
69
69
 
70
70
  # get link to result set
71
71
  def result_set_link
72
- "http#{'s' if @port == 443}://#{@host}/product/#{@product_id}/"\
73
- "plan/#{@plan_id}/run/#{@run_id}/result_set/#{@result_set_id}"
72
+ "http#{'s' if ssl_connection?}://#{@host}/product/#{@product_id}/"\
73
+ "plan/#{@plan_id}/run/#{@run_id}/result_set/#{@result_set_id}"
74
+ end
75
+
76
+ private
77
+
78
+ # Check if connection should be ssl
79
+ # @return [True, False]
80
+ def ssl_connection?
81
+ @port == 443
74
82
  end
75
83
  end
76
84
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: palladium
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rotatyy Dmitriy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-17 00:00:00.000000000 Z
11
+ date: 2021-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.0.8
117
+ rubygems_version: 3.2.22
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Gem for using Palladium API