cim 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/History.txt +19 -0
- data/LICENSE +58 -0
- data/README.rdoc +24 -8
- data/Rakefile +3 -23
- data/cim.gemspec +27 -0
- data/lib/cim.rb +54 -23
- data/lib/cim/association.rb +27 -1
- data/lib/cim/class.rb +51 -8
- data/lib/cim/class_feature.rb +40 -11
- data/lib/cim/indication.rb +14 -0
- data/lib/cim/instance.rb +18 -2
- data/lib/cim/method.rb +28 -1
- data/lib/cim/named_element.rb +55 -7
- data/lib/cim/property.rb +27 -5
- data/lib/cim/qualifier.rb +47 -2
- data/lib/cim/qualifier_declaration.rb +59 -13
- data/lib/cim/qualifier_flavors.rb +84 -10
- data/lib/cim/qualifier_scopes.rb +87 -0
- data/lib/cim/qualifier_set.rb +73 -0
- data/lib/cim/reference.rb +18 -0
- data/lib/cim/type.rb +82 -1
- data/lib/cim/variant.rb +39 -0
- data/tasks/clean.rake +9 -0
- data/tasks/doc.rake +14 -0
- data/tasks/test.rake +6 -0
- data/test/test_method.rb +2 -1
- data/test/test_qualifier_set.rb +39 -0
- metadata +37 -67
- data/Manifest.txt +0 -27
- data/lib/cim/qualifier_scope.rb +0 -37
- data/lib/cim/qualifiers.rb +0 -53
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 11
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 5
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Klaus K\xC3\xA4mpf"
|
@@ -15,51 +15,15 @@ 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
|
-
dependencies:
|
21
|
-
|
22
|
-
name: rubyforge
|
23
|
-
prerelease: false
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 7
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 0
|
33
|
-
- 4
|
34
|
-
version: 2.0.4
|
35
|
-
type: :development
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: hoe
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 21
|
46
|
-
segments:
|
47
|
-
- 2
|
48
|
-
- 6
|
49
|
-
- 1
|
50
|
-
version: 2.6.1
|
51
|
-
type: :development
|
52
|
-
version_requirements: *id002
|
20
|
+
dependencies: []
|
21
|
+
|
53
22
|
description: |-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
See http://www.dmtf.org/standards/cim and http://www.dmtf.org/education/mof
|
59
|
-
for details
|
60
|
-
|
61
|
-
https://rubygems.org/gems/mof is a parser for .mof files and the
|
62
|
-
primary consumer of the cim gem.
|
23
|
+
Instances of Cim classes are used to define a CIM
|
24
|
+
schema, often represented as a .mof file. See
|
25
|
+
http://www.dmtf.org/standards/cim and
|
26
|
+
http://www.dmtf.org/education/mof for details
|
63
27
|
email:
|
64
28
|
- kkaempf@suse.de
|
65
29
|
executables: []
|
@@ -67,44 +31,49 @@ executables: []
|
|
67
31
|
extensions: []
|
68
32
|
|
69
33
|
extra_rdoc_files:
|
70
|
-
-
|
71
|
-
-
|
34
|
+
- README.rdoc
|
35
|
+
- LICENSE
|
72
36
|
files:
|
37
|
+
- Gemfile
|
73
38
|
- History.txt
|
74
|
-
-
|
39
|
+
- LICENSE
|
75
40
|
- README.rdoc
|
76
41
|
- Rakefile
|
42
|
+
- cim.gemspec
|
77
43
|
- lib/cim.rb
|
78
44
|
- lib/cim/association.rb
|
79
45
|
- lib/cim/class.rb
|
46
|
+
- lib/cim/class_feature.rb
|
80
47
|
- lib/cim/indication.rb
|
81
48
|
- lib/cim/instance.rb
|
82
|
-
- lib/cim/class_feature.rb
|
83
|
-
- lib/cim/qualifier_flavors.rb
|
84
|
-
- lib/cim/named_element.rb
|
85
|
-
- lib/cim/qualifier_declaration.rb
|
86
|
-
- lib/cim/qualifier_scope.rb
|
87
|
-
- lib/cim/type.rb
|
88
|
-
- lib/cim/variant.rb
|
89
49
|
- lib/cim/method.rb
|
50
|
+
- lib/cim/named_element.rb
|
90
51
|
- lib/cim/property.rb
|
91
52
|
- lib/cim/qualifier.rb
|
92
|
-
- lib/cim/
|
53
|
+
- lib/cim/qualifier_declaration.rb
|
54
|
+
- lib/cim/qualifier_flavors.rb
|
55
|
+
- lib/cim/qualifier_scopes.rb
|
56
|
+
- lib/cim/qualifier_set.rb
|
93
57
|
- lib/cim/reference.rb
|
58
|
+
- lib/cim/type.rb
|
59
|
+
- lib/cim/variant.rb
|
60
|
+
- tasks/clean.rake
|
61
|
+
- tasks/doc.rake
|
62
|
+
- tasks/test.rake
|
94
63
|
- test/test_loading.rb
|
95
64
|
- test/test_method.rb
|
96
65
|
- test/test_property.rb
|
97
66
|
- test/test_qualifier.rb
|
67
|
+
- test/test_qualifier_set.rb
|
98
68
|
- test/test_reference.rb
|
99
69
|
- test/test_type.rb
|
100
70
|
has_rdoc: true
|
101
|
-
homepage:
|
71
|
+
homepage: https://github.com/kkaempf/cim
|
102
72
|
licenses: []
|
103
73
|
|
104
74
|
post_install_message:
|
105
|
-
rdoc_options:
|
106
|
-
|
107
|
-
- README.rdoc
|
75
|
+
rdoc_options: []
|
76
|
+
|
108
77
|
require_paths:
|
109
78
|
- lib
|
110
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -128,14 +97,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
97
|
requirements: []
|
129
98
|
|
130
99
|
rubyforge_project: cim
|
131
|
-
rubygems_version: 1.
|
100
|
+
rubygems_version: 1.5.2
|
132
101
|
signing_key:
|
133
102
|
specification_version: 3
|
134
|
-
summary:
|
103
|
+
summary: A pure-Ruby implementation of the CIM meta model
|
135
104
|
test_files:
|
136
|
-
- test/test_qualifier.rb
|
137
105
|
- test/test_loading.rb
|
138
|
-
- test/test_property.rb
|
139
|
-
- test/test_type.rb
|
140
106
|
- test/test_method.rb
|
107
|
+
- test/test_property.rb
|
108
|
+
- test/test_qualifier.rb
|
109
|
+
- test/test_qualifier_set.rb
|
141
110
|
- test/test_reference.rb
|
111
|
+
- test/test_type.rb
|
data/Manifest.txt
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
History.txt
|
2
|
-
Manifest.txt
|
3
|
-
README.rdoc
|
4
|
-
Rakefile
|
5
|
-
lib/cim.rb
|
6
|
-
lib/cim/association.rb
|
7
|
-
lib/cim/class.rb
|
8
|
-
lib/cim/indication.rb
|
9
|
-
lib/cim/instance.rb
|
10
|
-
lib/cim/class_feature.rb
|
11
|
-
lib/cim/qualifier_flavors.rb
|
12
|
-
lib/cim/named_element.rb
|
13
|
-
lib/cim/qualifier_declaration.rb
|
14
|
-
lib/cim/qualifier_scope.rb
|
15
|
-
lib/cim/type.rb
|
16
|
-
lib/cim/variant.rb
|
17
|
-
lib/cim/method.rb
|
18
|
-
lib/cim/property.rb
|
19
|
-
lib/cim/qualifier.rb
|
20
|
-
lib/cim/qualifiers.rb
|
21
|
-
lib/cim/reference.rb
|
22
|
-
test/test_loading.rb
|
23
|
-
test/test_method.rb
|
24
|
-
test/test_property.rb
|
25
|
-
test/test_qualifier.rb
|
26
|
-
test/test_reference.rb
|
27
|
-
test/test_type.rb
|
data/lib/cim/qualifier_scope.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
module CIM
|
2
|
-
|
3
|
-
class QualifierScopeError < ArgumentError
|
4
|
-
def initialize element, msg = nil
|
5
|
-
@element = element
|
6
|
-
super msg
|
7
|
-
end
|
8
|
-
def to_s
|
9
|
-
"#{@element} is not a valid meta element for scopes"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
class QualifierScope
|
14
|
-
META_ELEMENTS = [ :schema, :class, :association, :indication, :qualifier, :property, :reference, :method, :parameter, :any ]
|
15
|
-
attr_reader :elements
|
16
|
-
def initialize element = :any
|
17
|
-
@elements = []
|
18
|
-
self << element
|
19
|
-
end
|
20
|
-
def << element
|
21
|
-
element.downcase! if element.is_a?(String)
|
22
|
-
e = element.to_sym
|
23
|
-
raise QualifierScopeError.new(element) unless META_ELEMENTS.include?(e)
|
24
|
-
@elements << e
|
25
|
-
self
|
26
|
-
end
|
27
|
-
def has? qualifier
|
28
|
-
@elements.include? qualifier
|
29
|
-
end
|
30
|
-
def to_s
|
31
|
-
"Scope(#{@elements.join(', ')})"
|
32
|
-
end
|
33
|
-
def to_sym
|
34
|
-
@elements.first
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/lib/cim/qualifiers.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
module CIM
|
2
|
-
# Array of CIM::Qualifier
|
3
|
-
class Qualifiers < ::Array
|
4
|
-
#
|
5
|
-
# check if qualifier exists
|
6
|
-
#
|
7
|
-
alias array_include? include?
|
8
|
-
def include? q,type=:null
|
9
|
-
# puts "#{self}.include? #{q}:#{type}"
|
10
|
-
case q
|
11
|
-
when CIM::Qualifier
|
12
|
-
q = q.definition
|
13
|
-
when CIM::QualifierDeclaration
|
14
|
-
# nothing
|
15
|
-
when String
|
16
|
-
q = CIM::QualifierDeclaration.new(q,type)
|
17
|
-
when Symbol
|
18
|
-
q = CIM::QualifierDeclaration.new(q,type)
|
19
|
-
else
|
20
|
-
raise "Unknown parameter in #{self.class}.include?"
|
21
|
-
end
|
22
|
-
self.array_include? q
|
23
|
-
end
|
24
|
-
#
|
25
|
-
# get qualifier by name and type
|
26
|
-
#
|
27
|
-
alias array_access []
|
28
|
-
def [] q,type=:null
|
29
|
-
case q
|
30
|
-
when Fixnum
|
31
|
-
return self.array_access[q]
|
32
|
-
when CIM::Qualifier
|
33
|
-
q = q.definition
|
34
|
-
when CIM::QualifierDeclaration
|
35
|
-
# nothing
|
36
|
-
when String
|
37
|
-
q = CIM::QualifierDeclaration.new(q,type)
|
38
|
-
when Symbol
|
39
|
-
q = CIM::QualifierDeclaration.new(q,type)
|
40
|
-
else
|
41
|
-
raise "Unknown parameter in #{self.class}.[]"
|
42
|
-
end
|
43
|
-
i = self.index(q)
|
44
|
-
return self.array_access(i) if i
|
45
|
-
i
|
46
|
-
end
|
47
|
-
def to_s
|
48
|
-
return "" if self.empty?
|
49
|
-
q = self.join(", ")
|
50
|
-
return "[#{q}]"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|