occi-core 4.1.1 → 4.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a33d4666ccb0cb6f5319c9c0a313a57659d092f
4
- data.tar.gz: 06508a287d3bab6d510dc75e4c330f15fecab503
3
+ metadata.gz: 9b884e7dad15d650f4b9d82c029a5581176c13fa
4
+ data.tar.gz: 6fcf4b0cd0141f1aaba9b5287fd6aa5206c165af
5
5
  SHA512:
6
- metadata.gz: df8f403bc9166fea257c801665645cf61060cb5667854f7a76053d3744f7d1021d77605661805bf55fa649809d51a61187ac8a07dfae89427ff824be8f1e0c03
7
- data.tar.gz: 68593e75b588190ee1d8a604594931edac40a1bfded15ca8bba84193859397ada6a2ed16f966ab046d8199918ebc63fe8e3ed4af705b6a39e074a9de476fef5d
6
+ metadata.gz: 22fffb43cbf87277d3c18453687873a8e37a87c76cfcad265a76e44781a0a3acf1a71a3030b60e299b55ccc9f607f789d9d243defb3f799475666e4890acae77
7
+ data.tar.gz: 4e50e65a640d86a6ac8f8b0db7dce4418835493e37be5a452d3a63c473a6cbde2545fa7a43db874c37bc730b452c5ee5a866d40cc10e7d66ceacac60de45b3be
@@ -5,6 +5,7 @@ module Occi
5
5
  # Regular expressions
6
6
  REGEXP_QUOTED_STRING = /([^"\\]|\\.)*/
7
7
  REGEXP_LOALPHA = /[a-z]/
8
+ REGEXP_ALPHA = /[a-zA-Z]/
8
9
  REGEXP_DIGIT = /[0-9]/
9
10
  REGEXP_INT = /#{REGEXP_DIGIT}+/
10
11
  REGEXP_FLOAT = /#{REGEXP_INT}\.#{REGEXP_INT}/
@@ -14,7 +15,7 @@ module Occi
14
15
  # Regular expressions for OCCI
15
16
  if Occi::Settings.compatibility
16
17
  # Compatibility with terms starting with a number
17
- REGEXP_TERM = /(#{REGEXP_LOALPHA}|#{REGEXP_DIGIT})(#{REGEXP_LOALPHA}|#{REGEXP_DIGIT}|-|_)*/
18
+ REGEXP_TERM = /(#{REGEXP_ALPHA}|#{REGEXP_DIGIT})(#{REGEXP_ALPHA}|#{REGEXP_DIGIT}|-|_)*/
18
19
  else
19
20
  REGEXP_TERM = /#{REGEXP_LOALPHA}(#{REGEXP_LOALPHA}|#{REGEXP_DIGIT}|-|_)*/
20
21
  end
@@ -154,7 +155,7 @@ module Occi
154
155
 
155
156
  raise "could not match #{string}" unless match
156
157
 
157
- term = match[:term]
158
+ term = match[:term].downcase
158
159
  scheme = match[:scheme]
159
160
  title = match[:title]
160
161
  related = match[:rel].to_s.split
@@ -1,3 +1,3 @@
1
1
  module Occi
2
- VERSION = "4.1.1" unless defined?(::Occi::VERSION)
2
+ VERSION = "4.1.2" unless defined?(::Occi::VERSION)
3
3
  end
@@ -34,6 +34,15 @@ module Occi
34
34
  category.class.should eq Occi::Core::Kind
35
35
  end
36
36
 
37
+ it 'parses a string describing an OCCI Category with uppercase term' do
38
+ category_string = 'Category: TERM;scheme="http://a.a/a#";class=kind'
39
+
40
+ category = Occi::Parser::Text.category category_string
41
+ category.term.should eq 'term'
42
+ category.scheme.should eq 'http://a.a/a#'
43
+ category.class.should eq Occi::Core::Kind
44
+ end
45
+
37
46
  end
38
47
 
39
48
  describe '.resource' do
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.1.1
4
+ version: 4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Feldhaus