mind_meld 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mind_meld.rb +18 -2
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 965156ebbb57d0fbf56135e730dbaf5afd77e4a7
|
4
|
+
data.tar.gz: fc387114e2ead0065b6b9a17d637d91c45f77994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac135e252446ebedbedf5d3c0880a120508d7a492f11a91059c9e30cd0cd600df83616bde86c65c002199f33ab378acfa8a8cfe96921328e976f1bb4917a29fa
|
7
|
+
data.tar.gz: b1f6f0e9486b40a945988910487a7e626051efb538b9e7afa372b78283d9dd254cf4a00460cf6ebe6e3553ded2dd592169727f1273f6c7d998ea5af8a4ea30eb
|
data/lib/mind_meld.rb
CHANGED
@@ -9,11 +9,27 @@ class MindMeld
|
|
9
9
|
if options[:url]
|
10
10
|
uri = URI.parse(options[:url])
|
11
11
|
@http = Net::HTTP.new(uri.host, uri.port)
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
if options.key?(:cert) and options[:cert]
|
14
|
+
type = options[:cert].split('/').last.split('.').last == "p12" ? "p12" : "pem"
|
15
|
+
if type == "pem"
|
16
|
+
pem = File.read(options[:cert])
|
17
|
+
@http.cert = OpenSSL::X509::Certificate.new(pem)
|
18
|
+
@http.key = OpenSSL::PKey::RSA.new(pem)
|
19
|
+
elsif type == "p12"
|
20
|
+
p12 = OpenSSL::PKCS12.new(File.binread(options[:cert]))
|
21
|
+
@http.cert = p12.certificate
|
22
|
+
@http.key = p12.key
|
23
|
+
end
|
14
24
|
@http.use_ssl = true if uri.scheme == 'https'
|
25
|
+
@http.ca_file = options[:ca_file] if options.key?(:ca_file)
|
26
|
+
@http.verify_mode = options[:verify_mode] if options.key?(:verify_mode)
|
27
|
+
elsif options.key?(:pem) and options[:pem]
|
28
|
+
warn "['DEPRECATION'] Key [:pem] is deprecated in Mind Meld. Use [:cert] instead."
|
29
|
+
pem = File.read(options[:pem])
|
15
30
|
@http.cert = OpenSSL::X509::Certificate.new(pem)
|
16
31
|
@http.key = OpenSSL::PKey::RSA.new(pem)
|
32
|
+
@http.use_ssl = true if uri.scheme == 'https'
|
17
33
|
@http.ca_file = options[:ca_file] if options.key?(:ca_file)
|
18
34
|
@http.verify_mode = options[:verify_mode] if options.key?(:verify_mode)
|
19
35
|
end
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mind_meld
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Haig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: webmock
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.21'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.21'
|
55
55
|
description: API for Hive Mind
|
@@ -61,11 +61,11 @@ extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
63
|
- README.md
|
64
|
-
- bin/mind_meld
|
65
|
-
- lib/mind_meld.rb
|
66
64
|
- lib/mind_meld/device.rb
|
67
65
|
- lib/mind_meld/hive.rb
|
68
66
|
- lib/mind_meld/tv.rb
|
67
|
+
- lib/mind_meld.rb
|
68
|
+
- bin/mind_meld
|
69
69
|
homepage: https://github.org/bbc/mind_meld
|
70
70
|
licenses:
|
71
71
|
- MIT
|
@@ -76,17 +76,17 @@ require_paths:
|
|
76
76
|
- lib
|
77
77
|
required_ruby_version: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - '>='
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - '>='
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.
|
89
|
+
rubygems_version: 2.0.14
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: API for Hive Mind
|