occi-core 4.0.1 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -9
- data/Gemfile +0 -4
- data/README.md +11 -8
- data/lib/occi/parser/text.rb +7 -20
- data/lib/occi/version.rb +1 -1
- data/occi-core.gemspec +3 -4
- metadata +7 -9
- data/ext/mkrf_conf.rb +0 -35
data/.travis.yml
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
|
-
before_install:
|
4
|
-
- sudo apt-get install -qq libonig-dev
|
5
|
-
|
6
3
|
rvm:
|
7
|
-
- 1.8.7
|
8
4
|
- 1.9.3
|
9
5
|
- 2.0.0
|
10
6
|
- ruby-head
|
@@ -21,10 +17,6 @@ matrix:
|
|
21
17
|
- rvm: ruby-head
|
22
18
|
- rvm: jruby-head
|
23
19
|
exclude:
|
24
|
-
- rvm: 1.8.7
|
25
|
-
jdk: openjdk7
|
26
|
-
- rvm: 1.8.7
|
27
|
-
jdk: oraclejdk7
|
28
20
|
- rvm: 1.9.3
|
29
21
|
jdk: openjdk7
|
30
22
|
- rvm: 1.9.3
|
@@ -40,4 +32,6 @@ matrix:
|
|
40
32
|
|
41
33
|
branches:
|
42
34
|
only:
|
43
|
-
- master
|
35
|
+
- master
|
36
|
+
- 4.0.x
|
37
|
+
- 4.1.x
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -10,25 +10,23 @@ Requirements
|
|
10
10
|
------------
|
11
11
|
|
12
12
|
### Ruby
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
* rake installed (e.g., `gem install rake`)
|
13
|
+
* Ruby 1.9.3 is required
|
14
|
+
* RubyGems have to be installed
|
15
|
+
* Rake has to be installed (e.g., `gem install rake`)
|
17
16
|
|
18
17
|
### Libraries/packages
|
19
18
|
* libxslt1-dev/libxslt-devel
|
20
19
|
* libxml2-dev/libxml2-devel
|
21
|
-
* **only if using Ruby 1.8.7:** libonig-dev/oniguruma-devel (Linux) or oniguruma (Mac)
|
22
20
|
|
23
21
|
### Examples
|
24
22
|
For distros based on Debian:
|
25
23
|
~~~
|
26
|
-
apt-get install ruby rubygems ruby-dev libxslt1-dev libxml2-dev
|
24
|
+
apt-get install ruby rubygems ruby-dev libxslt1-dev libxml2-dev
|
27
25
|
~~~
|
28
26
|
|
29
27
|
For distros based on RHEL:
|
30
28
|
~~~
|
31
|
-
yum install libxml2-devel libxslt-devel ruby-devel openssl-devel gcc gcc-c++ ruby rubygems
|
29
|
+
yum install libxml2-devel libxslt-devel ruby-devel openssl-devel gcc gcc-c++ ruby rubygems
|
32
30
|
~~~
|
33
31
|
|
34
32
|
Installation
|
@@ -73,7 +71,8 @@ The OCCI gem includes its own logging mechanism using a message queue. By defaul
|
|
73
71
|
A new OCCI Logger can be initialized by specifying the log destination (either a filename or an IO object like
|
74
72
|
STDOUT) and the log level.
|
75
73
|
|
76
|
-
Occi::Log.new
|
74
|
+
logger = Occi::Log.new STDOUT
|
75
|
+
logger.level = Occi::Log::INFO
|
77
76
|
|
78
77
|
You can create multiple Loggers to receive the log output.
|
79
78
|
|
@@ -138,6 +137,10 @@ The occi-core gem includes all OCCI Core classes necessary to handly arbitrary O
|
|
138
137
|
Changelog
|
139
138
|
---------
|
140
139
|
|
140
|
+
### Version 4.1
|
141
|
+
* Dropped support for Rubies 1.8.x
|
142
|
+
* Updated dependencies
|
143
|
+
|
141
144
|
### Version 4.0
|
142
145
|
* introduced compatibility mode (for OCCI-OS, on by default)
|
143
146
|
* introduced new attribute handling for resources
|
data/lib/occi/parser/text.rb
CHANGED
@@ -1,15 +1,6 @@
|
|
1
1
|
module Occi
|
2
2
|
module Parser
|
3
3
|
module Text
|
4
|
-
# Backwards compatibility for Ruby 1.8.7 and named groups in regular expressions
|
5
|
-
if RUBY_VERSION =~ /1.8/
|
6
|
-
require 'oniguruma'
|
7
|
-
REGEXP = Oniguruma::ORegexp
|
8
|
-
ONIG = true
|
9
|
-
else
|
10
|
-
REGEXP = Regexp
|
11
|
-
ONIG = false
|
12
|
-
end
|
13
4
|
|
14
5
|
# Regular expressions
|
15
6
|
REGEXP_QUOTED_STRING = /([^"\\]|\\.)*/
|
@@ -157,7 +148,7 @@ module Occi
|
|
157
148
|
|
158
149
|
def self.category(string)
|
159
150
|
# create regular expression from regexp string
|
160
|
-
regexp =
|
151
|
+
regexp = Regexp.new(REGEXP_CATEGORY)
|
161
152
|
# match string to regular expression
|
162
153
|
match = regexp.match string
|
163
154
|
|
@@ -196,7 +187,7 @@ module Occi
|
|
196
187
|
|
197
188
|
def self.attribute(string)
|
198
189
|
# create regular expression from regexp string
|
199
|
-
regexp =
|
190
|
+
regexp = Regexp.new(REGEXP_ATTRIBUTE)
|
200
191
|
# match string to regular expression
|
201
192
|
match = regexp.match string
|
202
193
|
|
@@ -214,7 +205,7 @@ module Occi
|
|
214
205
|
|
215
206
|
def self.link_string(string, source)
|
216
207
|
# create regular expression from regexp string
|
217
|
-
regexp =
|
208
|
+
regexp = Regexp.new(REGEXP_LINK)
|
218
209
|
# match string to regular expression
|
219
210
|
match = regexp.match string
|
220
211
|
|
@@ -234,14 +225,10 @@ module Occi
|
|
234
225
|
|
235
226
|
# create an array of the list of attributes
|
236
227
|
attributes = []
|
237
|
-
regexp=
|
228
|
+
regexp=Regexp.new '(\\s*'+REGEXP_ATTRIBUTE_REPR.to_s+')'
|
238
229
|
attr_line = match[:attributes].sub(/^\s*;\s*/, ' ')
|
239
|
-
|
240
|
-
|
241
|
-
attributes = attr_line_scans.collect {|matches| matches.captures.first} if attr_line_scans
|
242
|
-
else
|
243
|
-
attributes = attr_line.scan(regexp).collect {|matches| matches.first}
|
244
|
-
end
|
230
|
+
attributes = attr_line.scan(regexp).collect {|matches| matches.first}
|
231
|
+
|
245
232
|
# parse each attribute and create an OCCI Attribute object from it
|
246
233
|
attributes = attributes.inject(Hashie::Mash.new) { |hsh, attribute| hsh.merge!(Occi::Parser::Text.attribute('X-OCCI-Attribute: ' + attribute)) }
|
247
234
|
Occi::Core::Link.new kind, mixins, attributes, actions, rel, target, source, location
|
@@ -249,7 +236,7 @@ module Occi
|
|
249
236
|
|
250
237
|
def self.location(string)
|
251
238
|
# create regular expression from regexp string
|
252
|
-
regexp =
|
239
|
+
regexp = Regexp.new(REGEXP_LOCATION)
|
253
240
|
# match string to regular expression
|
254
241
|
match = regexp.match string
|
255
242
|
|
data/lib/occi/version.rb
CHANGED
data/occi-core.gemspec
CHANGED
@@ -17,13 +17,12 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.files = `git ls-files`.split("\n")
|
18
18
|
gem.test_files = `git ls-files -- {test,spec}/*`.split("\n")
|
19
19
|
gem.require_paths = ['lib']
|
20
|
-
gem.extensions = 'ext/mkrf_conf.rb'
|
21
20
|
|
22
21
|
gem.add_dependency 'json'
|
23
22
|
gem.add_dependency 'hashie'
|
24
23
|
gem.add_dependency 'uuidtools', '>=2.1.3'
|
25
|
-
gem.add_dependency 'nokogiri', '~>1.
|
26
|
-
gem.add_dependency 'activesupport', '~>
|
24
|
+
gem.add_dependency 'nokogiri', '~>1.6.0'
|
25
|
+
gem.add_dependency 'activesupport', '~>4.0.0'
|
27
26
|
gem.add_dependency 'settingslogic'
|
28
27
|
|
29
28
|
gem.add_development_dependency 'rspec'
|
@@ -33,5 +32,5 @@ Gem::Specification.new do |gem|
|
|
33
32
|
gem.add_development_dependency 'yard'
|
34
33
|
gem.add_development_dependency 'yard-rspec'
|
35
34
|
|
36
|
-
gem.required_ruby_version = '>= 1.
|
35
|
+
gem.required_ruby_version = '>= 1.9.3'
|
37
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: occi-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -68,7 +68,7 @@ dependencies:
|
|
68
68
|
requirements:
|
69
69
|
- - ~>
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version: 1.
|
71
|
+
version: 1.6.0
|
72
72
|
type: :runtime
|
73
73
|
prerelease: false
|
74
74
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - ~>
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: 1.
|
79
|
+
version: 1.6.0
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: activesupport
|
82
82
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,7 +84,7 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version:
|
87
|
+
version: 4.0.0
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -92,7 +92,7 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - ~>
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version:
|
95
|
+
version: 4.0.0
|
96
96
|
- !ruby/object:Gem::Dependency
|
97
97
|
name: settingslogic
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,8 +212,7 @@ email:
|
|
212
212
|
- piotr.kasprzak@gwdg.de
|
213
213
|
- xparak@mail.muni.cz
|
214
214
|
executables: []
|
215
|
-
extensions:
|
216
|
-
- ext/mkrf_conf.rb
|
215
|
+
extensions: []
|
217
216
|
extra_rdoc_files: []
|
218
217
|
files:
|
219
218
|
- .gitignore
|
@@ -226,7 +225,6 @@ files:
|
|
226
225
|
- README.md
|
227
226
|
- Rakefile
|
228
227
|
- config/occi.yml
|
229
|
-
- ext/mkrf_conf.rb
|
230
228
|
- lib/occi-core.rb
|
231
229
|
- lib/occi/collection.rb
|
232
230
|
- lib/occi/core.rb
|
@@ -299,7 +297,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
299
297
|
requirements:
|
300
298
|
- - ! '>='
|
301
299
|
- !ruby/object:Gem::Version
|
302
|
-
version: 1.
|
300
|
+
version: 1.9.3
|
303
301
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
304
302
|
none: false
|
305
303
|
requirements:
|
data/ext/mkrf_conf.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rubygems/command.rb'
|
3
|
-
require 'rubygems/dependency_installer.rb'
|
4
|
-
|
5
|
-
begin
|
6
|
-
Gem::Command.build_args = ARGV
|
7
|
-
rescue NoMethodError
|
8
|
-
# do nothing but warn the user
|
9
|
-
warn "Gem::Command doesn't have a method named 'build_args'!"
|
10
|
-
end
|
11
|
-
|
12
|
-
warn 'Installing platform-specific dependencies.'
|
13
|
-
|
14
|
-
warn 'Installing the most recent version of \'rake\''
|
15
|
-
inst = Gem::DependencyInstaller.new
|
16
|
-
inst.install "rake"
|
17
|
-
|
18
|
-
if RUBY_PLATFORM == "java"
|
19
|
-
# Nothing to install for rOCCI-core
|
20
|
-
#warn 'Installing dependencies specific for jRuby'
|
21
|
-
else
|
22
|
-
warn 'Installing dependencies specific for Ruby'
|
23
|
-
|
24
|
-
rver = RUBY_VERSION.split('.').map{ |elm| elm.to_i }
|
25
|
-
if rver[0] == 1 && rver[1] < 9
|
26
|
-
warn 'Installing \'oniguruma\' for Ruby 1.8.x'
|
27
|
-
warn 'Make sure you have \'libonig-dev\' installed!'
|
28
|
-
inst.install "oniguruma"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# create dummy rakefile to indicate success
|
33
|
-
f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w")
|
34
|
-
f.write "task :default\n"
|
35
|
-
f.close
|