mof 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/History.txt +12 -2
- data/LICENSE +58 -0
- data/README.rdoc +1 -8
- data/README.rdoc~ +57 -0
- data/Rakefile +3 -27
- data/bin/moflint +5 -0
- data/lib/include/sblim-qualifiers.mof +7 -0
- data/lib/include/wmi-qualifiers.mof +213 -0
- data/lib/mof.rb +1 -1
- data/lib/mof/helper.rb +7 -5
- data/lib/mof/parser.rb +422 -431
- data/lib/mof/parser.y +661 -0
- data/lib/mof/result.rb +2 -1
- data/lib/mof/scanner.rb +13 -13
- data/mof.gemspec +29 -0
- data/parser/doc/mof.bnf +208 -0
- data/tasks/clean.rake +2 -0
- data/tasks/doc.rake +14 -0
- data/tasks/racc.rake +7 -0
- data/tasks/test.rake +6 -0
- data/test/mof/array_initializer.mof +8 -0
- data/test/mof/association_qualifier.mof +4 -0
- data/test/mof/class_qualifier_fail.mof +4 -0
- data/test/mof/class_qualifiers.mof +7 -0
- data/test/mof/derived.mof +3 -0
- data/test/mof/property_qualifier.mof +8 -0
- data/test/mof/qualifier.mof +3 -0
- data/test/mof/simple.mof +2 -0
- data/test/test_array_initializer.rb +39 -0
- data/test/test_association_qualifier.rb +37 -0
- data/test/test_qualifier.rb +12 -7
- metadata +54 -57
- data/Manifest.txt +0 -10
@@ -0,0 +1,37 @@
|
|
1
|
+
$d = File.expand_path(File.dirname(__FILE__))
|
2
|
+
require "test/unit"
|
3
|
+
require File.join($d,'..','lib','mof')
|
4
|
+
|
5
|
+
class TestQualifiers < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@moffiles, @options = MOF::Parser.argv_handler "test_qualifier", ["association_qualifier.mof"]
|
9
|
+
@options[:style] ||= :cim
|
10
|
+
@options[:includes] ||= [ $d, File.join($d,"mof")]
|
11
|
+
|
12
|
+
@parser = MOF::Parser.new @options
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_parse
|
16
|
+
result = @parser.parse @moffiles
|
17
|
+
assert result
|
18
|
+
# parsed one file
|
19
|
+
assert_equal 1, result.size
|
20
|
+
|
21
|
+
name,res = result.shift
|
22
|
+
assert !res.qualifiers.empty?
|
23
|
+
# parsed one qualifier
|
24
|
+
assert_equal 1, res.qualifiers.size
|
25
|
+
q = res.qualifiers.shift
|
26
|
+
assert q.is_a? CIM::QualifierDeclaration
|
27
|
+
assert q.type == :bool
|
28
|
+
assert q.default == false
|
29
|
+
# has one qualifier scopes
|
30
|
+
assert_equal 1, q.scopes.size
|
31
|
+
assert q.scopes.include? :association
|
32
|
+
# has two qualifier flavors
|
33
|
+
assert_equal 2, q.flavors.size
|
34
|
+
assert q.flavors.include? :disableoverride
|
35
|
+
assert q.flavors.include? :tosubclass
|
36
|
+
end
|
37
|
+
end
|
data/test/test_qualifier.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
|
1
|
+
$d = File.expand_path(File.dirname(__FILE__))
|
2
2
|
require "test/unit"
|
3
|
-
require File.join(
|
3
|
+
require File.join($d,'..','lib','mof')
|
4
4
|
|
5
5
|
class TestQualifiers < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def setup
|
8
8
|
@moffiles, @options = MOF::Parser.argv_handler "test_qualifier", ["qualifier.mof"]
|
9
9
|
@options[:style] ||= :cim
|
10
|
-
@options[:includes] ||= [
|
10
|
+
@options[:includes] ||= [ $d, File.join($d,"mof")]
|
11
11
|
|
12
12
|
@parser = MOF::Parser.new @options
|
13
13
|
end
|
@@ -20,9 +20,14 @@ class TestQualifiers < Test::Unit::TestCase
|
|
20
20
|
|
21
21
|
name,res = result.shift
|
22
22
|
assert !res.qualifiers.empty?
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
# parsed one qualifier
|
24
|
+
assert_equal 1, res.qualifiers.size
|
25
|
+
q = res.qualifiers.shift
|
26
|
+
assert q.is_a? CIM::QualifierDeclaration
|
27
|
+
assert q.type == :string
|
28
|
+
# has two qualifier scopes
|
29
|
+
assert_equal 2, q.scopes.size
|
30
|
+
assert q.scopes.include? :class
|
31
|
+
assert q.scopes.include? :property
|
27
32
|
end
|
28
33
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Klaus K\xC3\xA4mpf"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-09-29 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -24,52 +24,18 @@ dependencies:
|
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 1
|
30
30
|
segments:
|
31
31
|
- 0
|
32
|
-
-
|
33
|
-
|
34
|
-
version: 0.2.7
|
32
|
+
- 5
|
33
|
+
version: "0.5"
|
35
34
|
type: :runtime
|
36
35
|
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rubyforge
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 7
|
46
|
-
segments:
|
47
|
-
- 2
|
48
|
-
- 0
|
49
|
-
- 4
|
50
|
-
version: 2.0.4
|
51
|
-
type: :development
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: hoe
|
55
|
-
prerelease: false
|
56
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
hash: 21
|
62
|
-
segments:
|
63
|
-
- 2
|
64
|
-
- 6
|
65
|
-
- 1
|
66
|
-
version: 2.6.1
|
67
|
-
type: :development
|
68
|
-
version_requirements: *id003
|
69
36
|
description: |-
|
70
|
-
|
71
|
-
classes and instances of the Common Information Model (CIM)
|
72
|
-
|
37
|
+
The Managed Object Format (MOF) language used to
|
38
|
+
describe classes and instances of the Common Information Model (CIM).
|
73
39
|
See http://www.dmtf.org/education/mof
|
74
40
|
email:
|
75
41
|
- kkaempf@suse.de
|
@@ -78,29 +44,50 @@ executables:
|
|
78
44
|
extensions: []
|
79
45
|
|
80
46
|
extra_rdoc_files:
|
81
|
-
-
|
82
|
-
-
|
47
|
+
- README.rdoc
|
48
|
+
- README.rdoc~
|
49
|
+
- LICENSE
|
83
50
|
files:
|
51
|
+
- Gemfile
|
84
52
|
- History.txt
|
85
|
-
-
|
53
|
+
- LICENSE
|
86
54
|
- README.rdoc
|
87
55
|
- Rakefile
|
88
56
|
- bin/moflint
|
57
|
+
- lib/include/sblim-qualifiers.mof
|
58
|
+
- lib/include/wmi-qualifiers.mof
|
89
59
|
- lib/mof.rb
|
90
60
|
- lib/mof/helper.rb
|
91
|
-
- lib/mof/parser.
|
61
|
+
- lib/mof/parser.y
|
92
62
|
- lib/mof/result.rb
|
93
63
|
- lib/mof/scanner.rb
|
94
|
-
-
|
64
|
+
- mof.gemspec
|
65
|
+
- parser/doc/mof.bnf
|
66
|
+
- tasks/clean.rake
|
67
|
+
- tasks/doc.rake
|
68
|
+
- tasks/racc.rake
|
69
|
+
- tasks/test.rake
|
70
|
+
- test/mof/array_initializer.mof
|
71
|
+
- test/mof/association_qualifier.mof
|
72
|
+
- test/mof/class_qualifier_fail.mof
|
73
|
+
- test/mof/class_qualifiers.mof
|
74
|
+
- test/mof/derived.mof
|
75
|
+
- test/mof/property_qualifier.mof
|
76
|
+
- test/mof/qualifier.mof
|
77
|
+
- test/mof/simple.mof
|
78
|
+
- test/test_array_initializer.rb
|
79
|
+
- test/test_association_qualifier.rb
|
95
80
|
- test/test_loading.rb
|
81
|
+
- test/test_qualifier.rb
|
82
|
+
- lib/mof/parser.rb
|
83
|
+
- README.rdoc~
|
96
84
|
has_rdoc: true
|
97
|
-
homepage:
|
85
|
+
homepage: https://github.com/kkaempf/mof
|
98
86
|
licenses: []
|
99
87
|
|
100
88
|
post_install_message:
|
101
|
-
rdoc_options:
|
102
|
-
|
103
|
-
- README.rdoc
|
89
|
+
rdoc_options: []
|
90
|
+
|
104
91
|
require_paths:
|
105
92
|
- lib
|
106
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -124,10 +111,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
111
|
requirements: []
|
125
112
|
|
126
113
|
rubyforge_project: mof
|
127
|
-
rubygems_version: 1.
|
114
|
+
rubygems_version: 1.5.2
|
128
115
|
signing_key:
|
129
116
|
specification_version: 3
|
130
|
-
summary: A parser for
|
117
|
+
summary: A pure Ruby parser for MOF (Managed Object Format) files
|
131
118
|
test_files:
|
132
|
-
- test/
|
119
|
+
- test/mof/array_initializer.mof
|
120
|
+
- test/mof/association_qualifier.mof
|
121
|
+
- test/mof/class_qualifier_fail.mof
|
122
|
+
- test/mof/class_qualifiers.mof
|
123
|
+
- test/mof/derived.mof
|
124
|
+
- test/mof/property_qualifier.mof
|
125
|
+
- test/mof/qualifier.mof
|
126
|
+
- test/mof/simple.mof
|
127
|
+
- test/test_array_initializer.rb
|
128
|
+
- test/test_association_qualifier.rb
|
133
129
|
- test/test_loading.rb
|
130
|
+
- test/test_qualifier.rb
|