libis-tools 0.9.58 → 0.9.59
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libis/tools/extend/struct.rb +3 -3
- data/lib/libis/tools/version.rb +1 -1
- data/spec/config_file_spec.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8095f715cbd7a776eb78417571d8c8a383d2d541
|
4
|
+
data.tar.gz: 08a87704986febcf0edbffab6f534de6c27cc0c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c905f074337dd78172bf3f7c68880f07ba45c272eda2f5c424a4694f3241128d1b4fec792c292089274cb2aaa62dc4838829ee9cf7f51c26c9240506cc73fc1
|
7
|
+
data.tar.gz: de94ebfed64708f954436f826b98dbdbb84a2950f196b3ee1435478857a97d164303d21b674a785a6515b77ffb804b6582085e888333bc9b9e138a105dc6086a
|
@@ -4,9 +4,9 @@ require 'backports/rails/hash'
|
|
4
4
|
require 'backports/2.0.0/struct'
|
5
5
|
|
6
6
|
class Struct
|
7
|
-
def to_hash
|
8
|
-
|
9
|
-
end unless method_defined? :to_hash
|
7
|
+
# def to_hash
|
8
|
+
# members.inject({}) {|h,m| h[m] = send(m); h}
|
9
|
+
# end unless method_defined? :to_hash
|
10
10
|
|
11
11
|
def set(h = {})
|
12
12
|
h.symbolize_keys!
|
data/lib/libis/tools/version.rb
CHANGED
data/spec/config_file_spec.rb
CHANGED
@@ -71,4 +71,13 @@ describe ::Libis::Tools::ConfigFile do
|
|
71
71
|
|
72
72
|
end
|
73
73
|
|
74
|
+
context 'initialization with hash from YAML file' do
|
75
|
+
subject { ::Libis::Tools::ConfigFile.new YAML.load_file(test_file)}
|
76
|
+
|
77
|
+
it 'has hash' do
|
78
|
+
expect(subject.to_hash).to eq hash
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
74
83
|
end
|