mof 1.2.2 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/History.txt +4 -0
- data/lib/mof/parser.rb +914 -900
- data/lib/mof/parser.y +1 -0
- data/lib/mof/scanner.rb +14 -5
- data/lib/mof/version.rb +1 -1
- data/test/mof/qualifier.mof +3 -0
- data/test/test_qualifier.rb +19 -8
- metadata +59 -80
data/lib/mof/parser.y
CHANGED
data/lib/mof/scanner.rb
CHANGED
@@ -19,14 +19,17 @@
|
|
19
19
|
# @q: Queue of [token,value] pairs, [false,false] denotes EOF
|
20
20
|
#
|
21
21
|
|
22
|
-
require 'iconv'
|
23
|
-
|
24
22
|
module MOF
|
25
23
|
module Scanner
|
24
|
+
|
25
|
+
require 'iconv' unless String.method_defined? :encode
|
26
|
+
|
26
27
|
def fill_queue
|
27
|
-
if @file.eof?
|
28
|
+
if @file.closed? || @file.eof?
|
28
29
|
# $stderr.puts "eof ! #{@fstack.size}"
|
29
|
-
|
30
|
+
unless @file.closed?
|
31
|
+
@file.close unless @file == $stdin
|
32
|
+
end
|
30
33
|
unless @fstack.empty?
|
31
34
|
@file, @name, @lineno, @iconv, $/, @result = @fstack.pop
|
32
35
|
# $stderr.puts "fill! #{@fstack.size}, #{@name}@#{@lineno}"
|
@@ -41,7 +44,13 @@ module Scanner
|
|
41
44
|
|
42
45
|
# $stderr.puts "fill_queue(#{@line.split('').inspect})"
|
43
46
|
@line.chomp! # remove $/
|
44
|
-
|
47
|
+
if @iconv
|
48
|
+
if String.method_defined? encode
|
49
|
+
@line = @line.encode( "ISO-8859-1", @iconv )
|
50
|
+
else
|
51
|
+
@line = Iconv.conv( "ISO-8859-1", @iconv, @line )
|
52
|
+
end
|
53
|
+
end
|
45
54
|
# $stderr.puts "scan(#{@line})" unless @quiet
|
46
55
|
scanner = StringScanner.new(@line)
|
47
56
|
|
data/lib/mof/version.rb
CHANGED
data/test/mof/qualifier.mof
CHANGED
data/test/test_qualifier.rb
CHANGED
@@ -21,13 +21,24 @@ class TestQualifiers < Test::Unit::TestCase
|
|
21
21
|
name,res = result.shift
|
22
22
|
assert !res.qualifiers.empty?
|
23
23
|
# parsed one qualifier
|
24
|
-
assert_equal
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
assert_equal 2, res.qualifiers.size
|
25
|
+
res.qualifiers.each do |q|
|
26
|
+
assert q.is_a? CIM::QualifierDeclaration
|
27
|
+
case q.name
|
28
|
+
when "Description"
|
29
|
+
assert q.type == :string
|
30
|
+
# has two qualifier scopes
|
31
|
+
assert_equal 2, q.scopes.size
|
32
|
+
assert q.scopes.include? :class
|
33
|
+
assert q.scopes.include? :property
|
34
|
+
when "Reference"
|
35
|
+
assert q.type == :string
|
36
|
+
assert_equal 1, q.scopes.size
|
37
|
+
assert q.scopes.include? :property
|
38
|
+
else
|
39
|
+
STDERR.puts "Unhandled QualifierDeclaration for '#{q.name}'"
|
40
|
+
assert false
|
41
|
+
end
|
42
|
+
end
|
32
43
|
end
|
33
44
|
end
|
metadata
CHANGED
@@ -1,80 +1,70 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mof
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
- 2
|
10
|
-
version: 1.2.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.4
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
13
|
-
-
|
6
|
+
authors:
|
7
|
+
- Klaus Kämpf
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2015-04-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: cim
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 11
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 2
|
33
|
-
version: "1.2"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.2'
|
34
20
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rake
|
38
21
|
prerelease: false
|
39
|
-
|
40
|
-
|
41
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
42
31
|
- - ">="
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
version: "0"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
48
34
|
type: :development
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: bundler
|
52
35
|
prerelease: false
|
53
|
-
|
54
|
-
|
55
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
56
45
|
- - ">="
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
version: "0"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
62
48
|
type: :development
|
63
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
64
55
|
description: |-
|
65
56
|
The Managed Object Format (MOF) language used to
|
66
57
|
describe classes and instances of the Common Information Model (CIM).
|
67
58
|
See http://www.dmtf.org/education/mof
|
68
|
-
email:
|
59
|
+
email:
|
69
60
|
- kkaempf@suse.de
|
70
|
-
executables:
|
61
|
+
executables:
|
71
62
|
- moflint
|
72
63
|
extensions: []
|
73
|
-
|
74
|
-
extra_rdoc_files:
|
64
|
+
extra_rdoc_files:
|
75
65
|
- README.rdoc
|
76
66
|
- LICENSE
|
77
|
-
files:
|
67
|
+
files:
|
78
68
|
- Gemfile
|
79
69
|
- History.txt
|
80
70
|
- LICENSE
|
@@ -85,6 +75,7 @@ files:
|
|
85
75
|
- lib/include/wmi-qualifiers.mof
|
86
76
|
- lib/mof.rb
|
87
77
|
- lib/mof/helper.rb
|
78
|
+
- lib/mof/parser.rb
|
88
79
|
- lib/mof/parser.y
|
89
80
|
- lib/mof/result.rb
|
90
81
|
- lib/mof/scanner.rb
|
@@ -108,42 +99,30 @@ files:
|
|
108
99
|
- test/test_class_qualifiers.rb
|
109
100
|
- test/test_loading.rb
|
110
101
|
- test/test_qualifier.rb
|
111
|
-
- lib/mof/parser.rb
|
112
|
-
has_rdoc: true
|
113
102
|
homepage: https://github.com/kkaempf/mof
|
114
103
|
licenses: []
|
115
|
-
|
104
|
+
metadata: {}
|
116
105
|
post_install_message:
|
117
106
|
rdoc_options: []
|
118
|
-
|
119
|
-
require_paths:
|
107
|
+
require_paths:
|
120
108
|
- lib
|
121
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
-
|
123
|
-
requirements:
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
124
111
|
- - ">="
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
version: "0"
|
130
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
|
-
requirements:
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
133
116
|
- - ">="
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
|
136
|
-
segments:
|
137
|
-
- 0
|
138
|
-
version: "0"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
139
119
|
requirements: []
|
140
|
-
|
141
120
|
rubyforge_project: mof
|
142
|
-
rubygems_version:
|
121
|
+
rubygems_version: 2.4.5
|
143
122
|
signing_key:
|
144
|
-
specification_version:
|
123
|
+
specification_version: 4
|
145
124
|
summary: A pure Ruby parser for MOF (Managed Object Format) files
|
146
|
-
test_files:
|
125
|
+
test_files:
|
147
126
|
- test/mof/array_initializer.mof
|
148
127
|
- test/mof/association_qualifier.mof
|
149
128
|
- test/mof/class_qualifier_fail.mof
|