mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
add polyfill for ruby 1.9.3. struct
This commit is contained in:
parent
dde4433933
commit
2323ec52d2
2 changed files with 14 additions and 0 deletions
13
lib/inspec/polyfill.rb
Normal file
13
lib/inspec/polyfill.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
# encoding: utf-8
|
||||
# copyright: 2016, Chef Software Inc.
|
||||
# author: Dominik Richter
|
||||
# author: Christoph Hartmann
|
||||
# license: All rights reserved
|
||||
|
||||
class Struct
|
||||
unless instance_methods.include? :to_h
|
||||
def to_h
|
||||
Hash[each_pair.to_a]
|
||||
end
|
||||
end
|
||||
end
|
|
@ -4,6 +4,7 @@
|
|||
# author: Christoph Hartmann
|
||||
|
||||
require 'forwardable'
|
||||
require 'inspec/polyfill'
|
||||
require 'inspec/fetcher'
|
||||
require 'inspec/source_reader'
|
||||
require 'inspec/metadata'
|
||||
|
|
Loading…
Reference in a new issue