oneview-sdk 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +3 -0
- data/lib/oneview-sdk/cli.rb +4 -2
- data/lib/oneview-sdk/resource.rb +6 -4
- data/lib/oneview-sdk/version.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b40e3d92c074afcc638beeaa0e84ce4063cb0c9
|
4
|
+
data.tar.gz: 4d952bb15e6b69223bdde6904166c2c34aa2af63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 237e62919555f75a09ac6799f84a22ada01b4f777689c1692dcfac884e1aa92334508b9da3c3f07d49482ea2b65d42c1935562266a4fb49eb3962d7b2b68135c
|
7
|
+
data.tar.gz: 294a44b270bbc152e482042d6b5339066145a34c5a744ba9fa57a3fc6713ffb4500d1934202d573a2334b17867bfd5b1f52984392cb13df60416dace119ae7f0
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
### v2.1.0
|
2
|
+
- Fixed issue with the :resource_named method for OneViewSDK::Resource in Ruby 2.3
|
3
|
+
|
1
4
|
# v2.0.0
|
2
5
|
### Notes
|
3
6
|
This is the second version of the Ruby SDK for HPE OneView. It was given support to the major features of OneView, refactor in some of the already existing code, and also a full set of exceptions to make some common exceptions more explicit in the debugging process.
|
data/lib/oneview-sdk/cli.rb
CHANGED
@@ -333,8 +333,10 @@ module OneviewSDK
|
|
333
333
|
# Get resource class from given string
|
334
334
|
def parse_type(type)
|
335
335
|
valid_classes = []
|
336
|
-
|
337
|
-
|
336
|
+
OneviewSDK.constants.each do |c|
|
337
|
+
klass = OneviewSDK.const_get(c)
|
338
|
+
next unless klass.is_a?(Class) && klass < OneviewSDK::Resource
|
339
|
+
valid_classes.push(klass.name.split('::').last)
|
338
340
|
end
|
339
341
|
OneviewSDK.resource_named(type) || fail_nice("Invalid resource type: '#{type}'.\n Valid options are #{valid_classes}")
|
340
342
|
end
|
data/lib/oneview-sdk/resource.rb
CHANGED
@@ -336,11 +336,13 @@ module OneviewSDK
|
|
336
336
|
def self.resource_named(type)
|
337
337
|
classes = {}
|
338
338
|
orig_classes = []
|
339
|
-
|
340
|
-
|
339
|
+
OneviewSDK.constants.each do |c|
|
340
|
+
klass = OneviewSDK.const_get(c)
|
341
|
+
next unless klass.is_a?(Class) && klass < OneviewSDK::Resource
|
342
|
+
name = klass.name.split('::').last
|
341
343
|
orig_classes.push(name)
|
342
|
-
classes[name.downcase.delete('_').delete('-')] =
|
343
|
-
classes["#{name.downcase.delete('_').delete('-')}s"] =
|
344
|
+
classes[name.downcase.delete('_').delete('-')] = klass
|
345
|
+
classes["#{name.downcase.delete('_').delete('-')}s"] = klass
|
344
346
|
end
|
345
347
|
new_type = type.to_s.downcase.gsub(/[ -_]/, '')
|
346
348
|
return classes[new_type] if classes.keys.include?(new_type)
|
data/lib/oneview-sdk/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# (
|
1
|
+
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
#
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
5
|
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
6
6
|
#
|
7
7
|
# Unless required by applicable law or agreed to in writing, software distributed
|
@@ -11,5 +11,5 @@
|
|
11
11
|
|
12
12
|
# Gem version defined here
|
13
13
|
module OneviewSDK
|
14
|
-
VERSION = '2.
|
14
|
+
VERSION = '2.1.0'.freeze
|
15
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oneview-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Diomede
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-09-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: thor
|