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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7edacad4f95e018c2c4155c5d7bcbf502a14c7e
4
- data.tar.gz: 3bd46a95ff7f58444d0b19f90939746d225ffa82
3
+ metadata.gz: 9b40e3d92c074afcc638beeaa0e84ce4063cb0c9
4
+ data.tar.gz: 4d952bb15e6b69223bdde6904166c2c34aa2af63
5
5
  SHA512:
6
- metadata.gz: abd9687dfe8752cf416d1a4079e2dc99f3e29b3a43d8f77ae9ca8ad1f7f965238029381e92c658c58f4825e9322df23477fa6c80b197324cc44aaf29d4056f59
7
- data.tar.gz: d90567809d527d9aa8990b0294e04e3e54ad7eab40f43fd5de331b39aaa1a5f936f33a9f2685cdae87e92deef9b90140d5916953a726b0c5af0cc6801f3d0a19
6
+ metadata.gz: 237e62919555f75a09ac6799f84a22ada01b4f777689c1692dcfac884e1aa92334508b9da3c3f07d49482ea2b65d42c1935562266a4fb49eb3962d7b2b68135c
7
+ data.tar.gz: 294a44b270bbc152e482042d6b5339066145a34c5a744ba9fa57a3fc6713ffb4500d1934202d573a2334b17867bfd5b1f52984392cb13df60416dace119ae7f0
data/.rubocop.yml CHANGED
@@ -46,6 +46,9 @@ Style/AccessorMethodName:
46
46
  Style/EmptyLines:
47
47
  Enabled: false
48
48
 
49
+ Style/FrozenStringLiteralComment:
50
+ Enabled: false
51
+
49
52
  Style/IndentArray:
50
53
  Enabled: false
51
54
 
data/.travis.yml CHANGED
@@ -1,6 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.1
4
+ - 2.2.5
5
+ - 2.3.1
6
+
7
+ before_install: gem update bundler
4
8
 
5
9
  script:
6
10
  - rake build
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.
@@ -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
- ObjectSpace.each_object(Class).select { |klass| klass < OneviewSDK::Resource }.each do |c|
337
- valid_classes.push(c.name.split('::').last)
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
@@ -336,11 +336,13 @@ module OneviewSDK
336
336
  def self.resource_named(type)
337
337
  classes = {}
338
338
  orig_classes = []
339
- ObjectSpace.each_object(Class).select { |klass| klass < OneviewSDK::Resource }.each do |c|
340
- name = c.name.split('::').last
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('-')] = c
343
- classes["#{name.downcase.delete('_').delete('-')}s"] = c
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)
@@ -1,7 +1,7 @@
1
- # (C) Copyright 2016 Hewlett Packard Enterprise Development LP
1
+ # (c) Copyright 2016 Hewlett Packard Enterprise Development LP
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
- # You may not use this file except in compliance with the License.
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.0.0'.freeze
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.0.0
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-07-29 00:00:00.000000000 Z
14
+ date: 2016-09-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor