mof 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +21 -0
- data/History.txt +5 -0
- data/Rakefile +1 -0
- data/lib/mof/helper.rb +22 -1
- data/lib/mof/parser.rb +88 -88
- data/lib/mof/scanner.rb +1 -1
- data/lib/mof/version.rb +1 -1
- data/mof.gemspec +1 -0
- data/tasks/racc.rake +1 -4
- data/tasks/test.rake +2 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77676d72b9224fef64132ec8719756c5dc06d3f5
|
4
|
+
data.tar.gz: 04c859dfa4695654f2b0d7b02da2bde43eab8226
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19bdf1e78f80808b701352e7d1fa2f76c68ef0a531ef6712161223a5b3835ad5e5a526f76529266d3808efc797e7966e355656fb00a2d052225e5d1c233024b2
|
7
|
+
data.tar.gz: f812a418f9bbcb1407303c5dad055f9cb3c567c1be69756290bb82cac6c7bf1968987861f0a7310c2336a08f8c80142d734f6a51ed68766c0dfa1f3474706ac3
|
data/Gemfile.lock
ADDED
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/lib/mof/helper.rb
CHANGED
@@ -80,6 +80,11 @@ module Helper
|
|
80
80
|
elsif bom == "\377\376"
|
81
81
|
@iconv = "UTF-16LE"
|
82
82
|
$/ = "\r\0\n\0"
|
83
|
+
elsif ! has_valid_utf8(@name)
|
84
|
+
$stderr.puts "#{name} contains invalid UTF-8, treating as ISO-8859-1"
|
85
|
+
@iconv = "ISO-8859-1"
|
86
|
+
@file.rewind
|
87
|
+
$/ = "\n"
|
83
88
|
else
|
84
89
|
@file.rewind
|
85
90
|
@iconv = nil
|
@@ -87,7 +92,23 @@ module Helper
|
|
87
92
|
end
|
88
93
|
@style = :wmi if @iconv
|
89
94
|
# $stderr.puts "$/(#{$/.split('').inspect})"
|
90
|
-
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
def has_valid_utf8 name
|
99
|
+
valid = true
|
100
|
+
|
101
|
+
begin
|
102
|
+
# throws on invalid byte sequences such as 0x91 / 0x92 (smartquotes)
|
103
|
+
# and 0xAE (copyright) that may be present in Microsoft ISO-8859-1 MOFs
|
104
|
+
File.open(name, 'r:UTF-8', &:read).split('') << ''
|
105
|
+
rescue => e
|
106
|
+
if e.class == ArgumentError && e.message == 'invalid byte sequence in UTF-8'
|
107
|
+
valid = false
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
valid
|
91
112
|
end
|
92
113
|
|
93
114
|
#----------------------------------------------------------
|
data/lib/mof/parser.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.4.
|
3
|
+
# This file is automatically generated by Racc 1.4.12
|
4
4
|
# from Racc grammer file "".
|
5
5
|
#
|
6
6
|
|
@@ -102,92 +102,92 @@ include Scanner
|
|
102
102
|
##### State transition tables begin ###
|
103
103
|
|
104
104
|
racc_action_table = [
|
105
|
-
13,
|
106
|
-
147,
|
107
|
-
144, 149, 150, 151, 152, 18, 163, 173,
|
108
|
-
106, 107, 108, 109, 110, 112, 111,
|
109
|
-
|
110
|
-
56, 163, 7,
|
111
|
-
|
112
|
-
72, 52, 53, 54, 56, 51,
|
113
|
-
|
105
|
+
13, 172, 163, 197, 174, 27, 63, 17, 145, 146,
|
106
|
+
147, 62, 28, 172, 11, 173, 174, 173, 148, 11,
|
107
|
+
144, 149, 150, 151, 152, 18, 163, 173, 33, 153,
|
108
|
+
106, 107, 108, 109, 110, 112, 111, 40, 15, 16,
|
109
|
+
42, 55, 57, 68, 69, 71, 72, 52, 53, 54,
|
110
|
+
56, 163, 7, 199, 35, 42, 174, 7, 10, 10,
|
111
|
+
115, 102, 114, 36, 10, 55, 57, 68, 69, 71,
|
112
|
+
72, 52, 53, 54, 56, 51, 190, 44, -77, 42,
|
113
|
+
33, 189, 10, 10, 33, 102, 51, 164, 60, 10,
|
114
114
|
55, 57, 68, 69, 71, 72, 52, 53, 54, 56,
|
115
|
-
|
116
|
-
102, 35,
|
117
|
-
52, 53, 54, 56,
|
118
|
-
|
115
|
+
170, 35, 10, 21, 42, 22, 23, 10, 29, 31,
|
116
|
+
102, 35, 95, 96, 55, 57, 25, 65, 24, 78,
|
117
|
+
52, 53, 54, 56, 97, 55, 57, 35, 180, 181,
|
118
|
+
100, 52, 53, 54, 56, 93, 79, 80, 81, 82,
|
119
119
|
83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
|
120
120
|
-25, 93, 79, 80, 81, 82, 83, 84, 85, 86,
|
121
|
-
87, 88, 89, 90, 91, 92,
|
121
|
+
87, 88, 89, 90, 91, 92, 191, 192, 102, 60,
|
122
122
|
55, 57, 68, 69, 71, 72, 52, 53, 54, 56,
|
123
|
-
145, 146, 147, 172,
|
124
|
-
148,
|
125
|
-
|
123
|
+
145, 146, 147, 172, 113, 97, 174, 10, 18, 118,
|
124
|
+
148, 119, 144, 149, 150, 151, 152, 173, 121, 124,
|
125
|
+
35, 153, 55, 57, 68, 69, 71, 72, 52, 53,
|
126
126
|
54, 56, 106, 107, 108, 109, 110, 112, 111, 10,
|
127
127
|
55, 57, 68, 69, 71, 72, 52, 53, 54, 56,
|
128
|
-
21,
|
129
|
-
|
130
|
-
|
128
|
+
21, 126, 22, 23, 127, 129, 21, 10, 22, 23,
|
129
|
+
130, 131, 133, 25, 135, 24, 10, 141, 154, 25,
|
130
|
+
35, 24, 93, 79, 80, 81, 82, 83, 84, 85,
|
131
131
|
86, 87, 88, 89, 90, 91, 92, 106, 107, 108,
|
132
|
-
109, 110, 112, 111,
|
133
|
-
|
132
|
+
109, 110, 112, 111, 184, 185, 194, 200, 121, 207,
|
133
|
+
-59, 121, 209, 211, 135, 135, 218, 220, 221, 226,
|
134
134
|
228, 229, 231, 10, 121, 135 ]
|
135
135
|
|
136
136
|
racc_action_check = [
|
137
|
-
1,
|
138
|
-
131,
|
139
|
-
131, 131, 131, 131, 131, 8,
|
140
|
-
65, 65, 65, 65, 65, 65, 65,
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
33, 33, 33, 33,
|
150
|
-
|
137
|
+
1, 140, 135, 186, 140, 12, 37, 8, 131, 131,
|
138
|
+
131, 37, 13, 194, 0, 140, 194, 186, 131, 1,
|
139
|
+
131, 131, 131, 131, 131, 8, 189, 194, 16, 131,
|
140
|
+
65, 65, 65, 65, 65, 65, 65, 20, 7, 7,
|
141
|
+
20, 135, 135, 135, 135, 135, 135, 135, 135, 135,
|
142
|
+
135, 211, 0, 187, 17, 135, 187, 1, 135, 0,
|
143
|
+
75, 135, 75, 18, 1, 189, 189, 189, 189, 189,
|
144
|
+
189, 189, 189, 189, 189, 33, 177, 26, 207, 189,
|
145
|
+
29, 177, 189, 207, 30, 189, 96, 137, 34, 137,
|
146
|
+
211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
|
147
|
+
138, 36, 138, 10, 211, 10, 10, 211, 15, 15,
|
148
|
+
211, 169, 47, 47, 33, 33, 10, 38, 10, 43,
|
149
|
+
33, 33, 33, 33, 49, 96, 96, 216, 142, 142,
|
150
|
+
58, 96, 96, 96, 96, 169, 169, 169, 169, 169,
|
151
151
|
169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
|
152
152
|
42, 216, 216, 216, 216, 216, 216, 216, 216, 216,
|
153
|
-
216, 216, 216, 216, 216, 216,
|
153
|
+
216, 216, 216, 216, 216, 216, 178, 178, 60, 61,
|
154
154
|
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
|
155
|
-
181, 181, 181, 218,
|
156
|
-
181,
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
155
|
+
181, 181, 181, 218, 66, 70, 218, 42, 74, 77,
|
156
|
+
181, 78, 181, 181, 181, 181, 181, 218, 94, 98,
|
157
|
+
100, 181, 40, 40, 40, 40, 40, 40, 40, 40,
|
158
|
+
40, 40, 141, 141, 141, 141, 141, 141, 141, 40,
|
159
|
+
115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
|
160
|
+
11, 102, 11, 11, 103, 116, 63, 115, 63, 63,
|
161
|
+
118, 119, 121, 11, 122, 11, 127, 130, 132, 63,
|
162
|
+
161, 63, 44, 44, 44, 44, 44, 44, 44, 44,
|
163
163
|
44, 44, 44, 44, 44, 44, 44, 192, 192, 192,
|
164
|
-
192, 192, 192, 192,
|
165
|
-
|
164
|
+
192, 192, 192, 192, 162, 164, 183, 188, 195, 196,
|
165
|
+
197, 198, 201, 205, 206, 208, 210, 212, 213, 217,
|
166
166
|
221, 222, 223, 229, 230, 233 ]
|
167
167
|
|
168
168
|
racc_action_pointer = [
|
169
|
-
-5, 0, nil, nil, nil, nil, nil,
|
170
|
-
95,
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
nil, nil, nil, nil, nil, nil, nil, nil,
|
175
|
-
|
176
|
-
|
169
|
+
-5, 0, nil, nil, nil, nil, nil, 32, -2, nil,
|
170
|
+
95, 222, -58, 12, nil, 101, -30, 46, 32, nil,
|
171
|
+
-21, nil, nil, nil, nil, nil, 11, nil, nil, 22,
|
172
|
+
26, nil, nil, 67, 60, nil, 93, -54, 51, nil,
|
173
|
+
155, nil, 123, 59, 220, nil, nil, 53, nil, 76,
|
174
|
+
nil, nil, nil, nil, nil, nil, nil, nil, 64, nil,
|
175
|
+
101, 141, nil, 228, nil, 18, 125, nil, nil, nil,
|
176
|
+
137, nil, nil, nil, 161, 0, nil, 129, 171, nil,
|
177
177
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
178
|
-
nil, nil, nil, nil,
|
179
|
-
|
180
|
-
nil, nil, nil, nil, nil,
|
181
|
-
nil,
|
182
|
-
|
183
|
-
|
178
|
+
nil, nil, nil, nil, 134, nil, 78, nil, 138, nil,
|
179
|
+
192, nil, 223, 173, nil, nil, nil, nil, nil, nil,
|
180
|
+
nil, nil, nil, nil, nil, 173, 172, nil, 214, 183,
|
181
|
+
nil, 195, 176, nil, nil, nil, nil, 182, nil, nil,
|
182
|
+
189, -1, 183, nil, nil, -6, nil, 25, 38, nil,
|
183
|
+
-7, 200, 69, nil, nil, nil, nil, nil, nil, nil,
|
184
184
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
185
|
-
nil,
|
186
|
-
nil, nil, nil, nil, nil, nil, nil,
|
187
|
-
nil, 171, nil,
|
188
|
-
nil, nil, 255, nil,
|
189
|
-
nil,
|
190
|
-
|
185
|
+
nil, 242, 208, nil, 212, nil, nil, nil, nil, 103,
|
186
|
+
nil, nil, nil, nil, nil, nil, nil, 13, 107, nil,
|
187
|
+
nil, 171, nil, 207, nil, nil, -5, 45, 248, 18,
|
188
|
+
nil, nil, 255, nil, 5, 214, 221, 222, 217, nil,
|
189
|
+
nil, 219, nil, nil, nil, 215, 216, 19, 217, nil,
|
190
|
+
226, 43, 224, 229, nil, nil, 119, 226, 175, nil,
|
191
191
|
nil, 227, 231, 284, nil, nil, nil, nil, nil, 229,
|
192
192
|
230, nil, nil, 227, nil, nil ]
|
193
193
|
|
@@ -220,12 +220,12 @@ racc_action_default = [
|
|
220
220
|
racc_goto_table = [
|
221
221
|
8, 8, 34, 94, 122, 105, 136, 155, 48, 66,
|
222
222
|
49, 76, 50, 19, 143, 187, 58, 204, 215, 32,
|
223
|
-
139, 61, 2, 14, 12, 12,
|
224
|
-
|
225
|
-
232, 227,
|
226
|
-
|
227
|
-
|
228
|
-
|
223
|
+
139, 61, 2, 14, 12, 12, 1, 30, 47, 98,
|
224
|
+
137, 171, 45, 46, 165, 166, 167, 168, 37, 26,
|
225
|
+
232, 227, 38, 103, 64, 39, 41, 99, 101, 195,
|
226
|
+
198, 196, 213, 214, 222, 223, 230, 234, 235, 132,
|
227
|
+
75, 201, 225, 182, 193, 203, 104, 210, 177, 43,
|
228
|
+
77, 123, 116, 49, 117, 50, 142, 178, 138, nil,
|
229
229
|
nil, 179, nil, 219, 128, 125, nil, nil, nil, nil,
|
230
230
|
212, nil, 217, nil, nil, nil, nil, nil, nil, nil,
|
231
231
|
nil, nil, nil, nil, nil, 206, nil, nil, 208, nil,
|
@@ -245,12 +245,12 @@ racc_goto_table = [
|
|
245
245
|
racc_goto_check = [
|
246
246
|
13, 13, 14, 35, 37, 28, 38, 52, 10, 30,
|
247
247
|
11, 30, 12, 23, 69, 39, 15, 61, 44, 7,
|
248
|
-
72, 14, 2, 2, 55, 55,
|
249
|
-
|
250
|
-
44, 61,
|
251
|
-
|
252
|
-
|
253
|
-
|
248
|
+
72, 14, 2, 2, 55, 55, 1, 8, 9, 16,
|
249
|
+
17, 72, 7, 7, 18, 19, 20, 21, 24, 25,
|
250
|
+
44, 61, 26, 15, 27, 29, 31, 33, 34, 36,
|
251
|
+
40, 41, 42, 43, 45, 46, 47, 48, 50, 51,
|
252
|
+
54, 52, 39, 58, 69, 60, 23, 62, 63, 64,
|
253
|
+
65, 10, 66, 11, 67, 12, 68, 70, 71, nil,
|
254
254
|
nil, 28, nil, 52, 30, 14, nil, nil, nil, nil,
|
255
255
|
38, nil, 38, nil, nil, nil, nil, nil, nil, nil,
|
256
256
|
nil, nil, nil, nil, nil, 37, nil, nil, 37, nil,
|
@@ -268,14 +268,14 @@ racc_goto_check = [
|
|
268
268
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, 13 ]
|
269
269
|
|
270
270
|
racc_goto_pointer = [
|
271
|
-
nil,
|
272
|
-
-25, -23, -21, 0, -15, -18,
|
273
|
-
|
274
|
-
-31,
|
275
|
-
-
|
276
|
-
-
|
277
|
-
-
|
278
|
-
-
|
271
|
+
nil, 26, 22, nil, nil, nil, nil, 3, 12, -5,
|
272
|
+
-25, -23, -21, 0, -15, -18, -29, -94, -103, -102,
|
273
|
+
-101, -100, nil, 3, 19, 28, 22, 6, -60, 25,
|
274
|
+
-31, 26, nil, -11, -12, -41, -137, -90, -116, -154,
|
275
|
+
-137, -135, -155, -154, -189, -161, -161, -167, -176, nil,
|
276
|
+
-175, -62, -128, nil, 18, 24, nil, nil, -98, nil,
|
277
|
+
-129, -177, -137, -72, 43, 27, -5, -3, -55, -117,
|
278
|
+
-64, -49, -107 ]
|
279
279
|
|
280
280
|
racc_goto_default = [
|
281
281
|
nil, nil, nil, 3, 4, 5, 6, nil, nil, nil,
|
data/lib/mof/scanner.rb
CHANGED
@@ -45,7 +45,7 @@ module Scanner
|
|
45
45
|
# $stderr.puts "fill_queue(#{@line.split('').inspect})"
|
46
46
|
@line.chomp! # remove $/
|
47
47
|
if @iconv
|
48
|
-
if String.method_defined? encode
|
48
|
+
if String.method_defined? 'encode'
|
49
49
|
@line = @line.encode( "ISO-8859-1", @iconv )
|
50
50
|
else
|
51
51
|
@line = Iconv.conv( "ISO-8859-1", @iconv, @line )
|
data/lib/mof/version.rb
CHANGED
data/mof.gemspec
CHANGED
@@ -22,6 +22,7 @@ See http://www.dmtf.org/education/mof}
|
|
22
22
|
|
23
23
|
s.add_development_dependency('rake')
|
24
24
|
s.add_development_dependency('bundler')
|
25
|
+
s.add_development_dependency('racc')
|
25
26
|
|
26
27
|
s.files = `git ls-files`.split("\n") << "lib/mof/parser.rb"
|
27
28
|
s.files.reject! { |fn| fn == '.gitignore' }
|
data/tasks/racc.rake
CHANGED
data/tasks/test.rake
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Klaus Kämpf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cim
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: racc
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: |-
|
56
70
|
The Managed Object Format (MOF) language used to
|
57
71
|
describe classes and instances of the Common Information Model (CIM).
|
@@ -66,6 +80,7 @@ extra_rdoc_files:
|
|
66
80
|
- LICENSE
|
67
81
|
files:
|
68
82
|
- Gemfile
|
83
|
+
- Gemfile.lock
|
69
84
|
- History.txt
|
70
85
|
- LICENSE
|
71
86
|
- README.rdoc
|