occi-core 4.0.0.alpha.2 → 4.0.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -65,7 +65,7 @@ module Occi
65
65
  end
66
66
  end
67
67
 
68
- class_name = term.gsub('-', '_').capitalize
68
+ class_name = self.sanitize_term_before_classify(term).classify
69
69
  if namespace.const_defined? class_name
70
70
  klass = namespace.const_get class_name
71
71
  return klass.mixin if klass.respond_to? :mixin
@@ -149,6 +149,18 @@ module Occi
149
149
  self.type_identifier
150
150
  end
151
151
 
152
+ private
153
+
154
+ # Relaxed parser rules require additional checks on terms.
155
+ # TODO: a better solution?
156
+ # TODO: check for more characters
157
+ def self.sanitize_term_before_classify(term)
158
+ sanitized = term.downcase.gsub(/[\s\(\)\.\{\}\-;,\\\/\?\!\|\*\<\>]/, '_').gsub(/_+/, '_').chomp('_').reverse.chomp('_').reverse
159
+ sanitized = "uuid_#{sanitized}" if sanitized.match(/^[0-9]/)
160
+
161
+ sanitized
162
+ end
163
+
152
164
  end
153
165
  end
154
166
  end
data/lib/occi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Occi
2
- VERSION = "4.0.0.alpha.2" unless defined?(::Occi::VERSION)
2
+ VERSION = "4.0.0.alpha.3" unless defined?(::Occi::VERSION)
3
3
  end
data/occi-core.gemspec CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.description = %q{OCCI is a collection of classes to simplify the implementation of the Open Cloud Computing API in Ruby}
13
13
  gem.summary = %q{OCCI toolkit}
14
14
  gem.homepage = 'https://github.com/gwdg/rOCCI-core'
15
+ gem.license = 'Apache License, Version 2.0'
15
16
 
16
17
  gem.files = `git ls-files`.split("\n")
17
18
  gem.test_files = `git ls-files -- {test,spec}/*`.split("\n")
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occi-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.alpha.2
4
+ version: 4.0.0.alpha.3
5
+ prerelease: 6
5
6
  platform: ruby
6
7
  authors:
7
8
  - Florian Feldhaus
@@ -10,53 +11,60 @@ authors:
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2013-07-10 00:00:00.000000000 Z
14
+ date: 2013-07-18 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: json
17
18
  requirement: !ruby/object:Gem::Requirement
19
+ none: false
18
20
  requirements:
19
- - - '>='
21
+ - - ! '>='
20
22
  - !ruby/object:Gem::Version
21
23
  version: '0'
22
24
  type: :runtime
23
25
  prerelease: false
24
26
  version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
25
28
  requirements:
26
- - - '>='
29
+ - - ! '>='
27
30
  - !ruby/object:Gem::Version
28
31
  version: '0'
29
32
  - !ruby/object:Gem::Dependency
30
33
  name: hashie
31
34
  requirement: !ruby/object:Gem::Requirement
35
+ none: false
32
36
  requirements:
33
- - - '>='
37
+ - - ! '>='
34
38
  - !ruby/object:Gem::Version
35
39
  version: '0'
36
40
  type: :runtime
37
41
  prerelease: false
38
42
  version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
39
44
  requirements:
40
- - - '>='
45
+ - - ! '>='
41
46
  - !ruby/object:Gem::Version
42
47
  version: '0'
43
48
  - !ruby/object:Gem::Dependency
44
49
  name: uuidtools
45
50
  requirement: !ruby/object:Gem::Requirement
51
+ none: false
46
52
  requirements:
47
- - - '>='
53
+ - - ! '>='
48
54
  - !ruby/object:Gem::Version
49
55
  version: 2.1.3
50
56
  type: :runtime
51
57
  prerelease: false
52
58
  version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
53
60
  requirements:
54
- - - '>='
61
+ - - ! '>='
55
62
  - !ruby/object:Gem::Version
56
63
  version: 2.1.3
57
64
  - !ruby/object:Gem::Dependency
58
65
  name: nokogiri
59
66
  requirement: !ruby/object:Gem::Requirement
67
+ none: false
60
68
  requirements:
61
69
  - - ~>
62
70
  - !ruby/object:Gem::Version
@@ -64,6 +72,7 @@ dependencies:
64
72
  type: :runtime
65
73
  prerelease: false
66
74
  version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
67
76
  requirements:
68
77
  - - ~>
69
78
  - !ruby/object:Gem::Version
@@ -71,6 +80,7 @@ dependencies:
71
80
  - !ruby/object:Gem::Dependency
72
81
  name: activesupport
73
82
  requirement: !ruby/object:Gem::Requirement
83
+ none: false
74
84
  requirements:
75
85
  - - ~>
76
86
  - !ruby/object:Gem::Version
@@ -78,6 +88,7 @@ dependencies:
78
88
  type: :runtime
79
89
  prerelease: false
80
90
  version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
81
92
  requirements:
82
93
  - - ~>
83
94
  - !ruby/object:Gem::Version
@@ -85,99 +96,113 @@ dependencies:
85
96
  - !ruby/object:Gem::Dependency
86
97
  name: settingslogic
87
98
  requirement: !ruby/object:Gem::Requirement
99
+ none: false
88
100
  requirements:
89
- - - '>='
101
+ - - ! '>='
90
102
  - !ruby/object:Gem::Version
91
103
  version: '0'
92
104
  type: :runtime
93
105
  prerelease: false
94
106
  version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
95
108
  requirements:
96
- - - '>='
109
+ - - ! '>='
97
110
  - !ruby/object:Gem::Version
98
111
  version: '0'
99
112
  - !ruby/object:Gem::Dependency
100
113
  name: rspec
101
114
  requirement: !ruby/object:Gem::Requirement
115
+ none: false
102
116
  requirements:
103
- - - '>='
117
+ - - ! '>='
104
118
  - !ruby/object:Gem::Version
105
119
  version: '0'
106
120
  type: :development
107
121
  prerelease: false
108
122
  version_requirements: !ruby/object:Gem::Requirement
123
+ none: false
109
124
  requirements:
110
- - - '>='
125
+ - - ! '>='
111
126
  - !ruby/object:Gem::Version
112
127
  version: '0'
113
128
  - !ruby/object:Gem::Dependency
114
129
  name: rake
115
130
  requirement: !ruby/object:Gem::Requirement
131
+ none: false
116
132
  requirements:
117
- - - '>='
133
+ - - ! '>='
118
134
  - !ruby/object:Gem::Version
119
135
  version: '0'
120
136
  type: :development
121
137
  prerelease: false
122
138
  version_requirements: !ruby/object:Gem::Requirement
139
+ none: false
123
140
  requirements:
124
- - - '>='
141
+ - - ! '>='
125
142
  - !ruby/object:Gem::Version
126
143
  version: '0'
127
144
  - !ruby/object:Gem::Dependency
128
145
  name: builder
129
146
  requirement: !ruby/object:Gem::Requirement
147
+ none: false
130
148
  requirements:
131
- - - '>='
149
+ - - ! '>='
132
150
  - !ruby/object:Gem::Version
133
151
  version: '0'
134
152
  type: :development
135
153
  prerelease: false
136
154
  version_requirements: !ruby/object:Gem::Requirement
155
+ none: false
137
156
  requirements:
138
- - - '>='
157
+ - - ! '>='
139
158
  - !ruby/object:Gem::Version
140
159
  version: '0'
141
160
  - !ruby/object:Gem::Dependency
142
161
  name: simplecov
143
162
  requirement: !ruby/object:Gem::Requirement
163
+ none: false
144
164
  requirements:
145
- - - '>='
165
+ - - ! '>='
146
166
  - !ruby/object:Gem::Version
147
167
  version: '0'
148
168
  type: :development
149
169
  prerelease: false
150
170
  version_requirements: !ruby/object:Gem::Requirement
171
+ none: false
151
172
  requirements:
152
- - - '>='
173
+ - - ! '>='
153
174
  - !ruby/object:Gem::Version
154
175
  version: '0'
155
176
  - !ruby/object:Gem::Dependency
156
177
  name: yard
157
178
  requirement: !ruby/object:Gem::Requirement
179
+ none: false
158
180
  requirements:
159
- - - '>='
181
+ - - ! '>='
160
182
  - !ruby/object:Gem::Version
161
183
  version: '0'
162
184
  type: :development
163
185
  prerelease: false
164
186
  version_requirements: !ruby/object:Gem::Requirement
187
+ none: false
165
188
  requirements:
166
- - - '>='
189
+ - - ! '>='
167
190
  - !ruby/object:Gem::Version
168
191
  version: '0'
169
192
  - !ruby/object:Gem::Dependency
170
193
  name: yard-rspec
171
194
  requirement: !ruby/object:Gem::Requirement
195
+ none: false
172
196
  requirements:
173
- - - '>='
197
+ - - ! '>='
174
198
  - !ruby/object:Gem::Version
175
199
  version: '0'
176
200
  type: :development
177
201
  prerelease: false
178
202
  version_requirements: !ruby/object:Gem::Requirement
203
+ none: false
179
204
  requirements:
180
- - - '>='
205
+ - - ! '>='
181
206
  - !ruby/object:Gem::Version
182
207
  version: '0'
183
208
  description: OCCI is a collection of classes to simplify the implementation of the
@@ -262,42 +287,28 @@ files:
262
287
  - spec/occi/test.ovf
263
288
  - spec/spec_helper.rb
264
289
  homepage: https://github.com/gwdg/rOCCI-core
265
- licenses: []
266
- metadata: {}
290
+ licenses:
291
+ - Apache License, Version 2.0
267
292
  post_install_message:
268
293
  rdoc_options: []
269
294
  require_paths:
270
295
  - lib
271
296
  required_ruby_version: !ruby/object:Gem::Requirement
297
+ none: false
272
298
  requirements:
273
- - - '>='
299
+ - - ! '>='
274
300
  - !ruby/object:Gem::Version
275
301
  version: 1.8.7
276
302
  required_rubygems_version: !ruby/object:Gem::Requirement
303
+ none: false
277
304
  requirements:
278
- - - '>'
305
+ - - ! '>'
279
306
  - !ruby/object:Gem::Version
280
307
  version: 1.3.1
281
308
  requirements: []
282
309
  rubyforge_project:
283
- rubygems_version: 2.0.3
310
+ rubygems_version: 1.8.25
284
311
  signing_key:
285
- specification_version: 4
312
+ specification_version: 3
286
313
  summary: OCCI toolkit
287
- test_files:
288
- - spec/occi/collection_spec.rb
289
- - spec/occi/core/attribute_spec.rb
290
- - spec/occi/core/attributes_spec.rb
291
- - spec/occi/core/categories_spec.rb
292
- - spec/occi/core/category_spec.rb
293
- - spec/occi/core/entity_spec.rb
294
- - spec/occi/core/resource_spec.rb
295
- - spec/occi/infrastructure/compute_spec.rb
296
- - spec/occi/log_spec.rb
297
- - spec/occi/model_spec.rb
298
- - spec/occi/parser/text_spec.rb
299
- - spec/occi/parser_spec.rb
300
- - spec/occi/test.json
301
- - spec/occi/test.ova
302
- - spec/occi/test.ovf
303
- - spec/spec_helper.rb
314
+ test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 945b3678e21953e765735aff0ace9d400780c9d1
4
- data.tar.gz: a479e10184d38cd9a45ac8cc6aa42fc2a91e9b7c
5
- SHA512:
6
- metadata.gz: 366e5a6cadb42058c98eae50b7b7a72216da444dd9c769b63054cc83b7619137e631c16472fc33ec27902cfcec770a735a5327b1c8e678c76e154f2410ae95b8
7
- data.tar.gz: 2870063f118d8a93629343ce95c9b81799c7980f173fe1b401f4fbc677daa864d4e84a12ffb43b5e58ea2ddf21ccf58c58f0aeb41fea6281f2a5679034d8ae2b