hako-etcenv 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: cd2bf1cdaeff9c4684e2e228cab8b25f0212d399
4
- data.tar.gz: e3d9927b8de71138f369c9bccca31d803f150607
3
+ metadata.gz: d2a9495a38130707e4051a01395c08c0f975af9e
4
+ data.tar.gz: d94365656739c8b1f9ac808520f72126155a8d99
5
5
  SHA512:
6
- metadata.gz: a589d23fb997eaf9f6b6145161890194ffca1df100a8406396fb4f2c0efc823e6f9053c0d6c65cb51489329a65e6412166b5c9f6f6255e7332f429dabda04137
7
- data.tar.gz: 4b6834a5511e67679c79c98a836c65db60eb620fe6d31e3b43460e1ae6bc762077ab62b5269630bb8831026e37cb666ebb9fdb38ba0739c2fc7fc5cc5829eef5
6
+ metadata.gz: e728461943005d520218ed1bc9886a88fdc7923ea2f264d7eae6a285ecaff3b7d83ec4b31e79af340f0b2582d07d96e4f37dfa18ac4c7ba48b8f1d7521bbaeb3
7
+ data.tar.gz: cc5cf45a12dd2e7bec14a92d19408db3b8d6dd51d44cb63a95444a752193b1e8419ff16662376f88482f3eeb7681216f0a14f8795f9873d4d07fe42cf7589a0d
data/.rubocop.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
+ Style/GuardClause:
4
+ Enabled: false
5
+
3
6
  Style/HashSyntax:
4
7
  Exclude:
5
8
  - 'Rakefile'
data/hako-etcenv.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'hako-etcenv'
7
- spec.version = '0.1.0'
7
+ spec.version = '0.1.1'
8
8
  spec.authors = ['Kohei Suzuki']
9
9
  spec.email = ['eagletmt@gmail.com']
10
10
 
@@ -20,8 +20,8 @@ module Hako
20
20
  port: uri.port,
21
21
  use_ssl: uri.scheme == 'https',
22
22
  ca_file: options.fetch('ca_file', nil),
23
- ssl_cert: OpenSSL::X509::Certificate.new(::File.read(options.fetch('ssl_cert', nil))),
24
- ssl_key: OpenSSL::PKey::RSA.new(::File.read(options.fetch('ssl_key', nil))),
23
+ ssl_cert: ssl_cert(options.fetch('ssl_cert', nil)),
24
+ ssl_key: ssl_key(options.fetch('ssl_key', nil)),
25
25
  )
26
26
  @root = options.fetch('root')
27
27
  end
@@ -35,6 +35,20 @@ module Hako
35
35
  end
36
36
  env
37
37
  end
38
+
39
+ private
40
+
41
+ def ssl_cert(cert_path)
42
+ if cert_path
43
+ OpenSSL::X509::Certificate.new(::File.read(cert_path))
44
+ end
45
+ end
46
+
47
+ def ssl_key(key_path)
48
+ if key_path
49
+ OpenSSL::PKey::RSA.new(::File.read(key_path))
50
+ end
51
+ end
38
52
  end
39
53
  end
40
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hako-etcenv
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
  - Kohei Suzuki