occi-core 5.0.1 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -14
  3. data/.rubocop_todo.yml +5 -0
  4. data/CHANGELOG.md +6 -0
  5. data/README.md +1 -0
  6. data/lib/occi/core/action_instance.rb +3 -2
  7. data/lib/occi/core/entity.rb +5 -5
  8. data/lib/occi/core/helpers/error_handler.rb +1 -1
  9. data/lib/occi/core/helpers/raw_json_parser.rb +1 -1
  10. data/lib/occi/core/locations.rb +2 -2
  11. data/lib/occi/core/parsers/json/validator.rb +1 -1
  12. data/lib/occi/core/parsers/json_parser.rb +1 -1
  13. data/lib/occi/core/version.rb +1 -1
  14. data/lib/occi/core/warehouse.rb +1 -1
  15. data/lib/occi/core/warehouse/kinds/attributes/occi.core.title.yml +1 -1
  16. data/lib/occi/infrastructure/warehouse.rb +1 -1
  17. data/lib/occi/infrastructure/warehouse/actions/compute_save.yml +1 -1
  18. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.hostname.yml +1 -1
  19. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.state.message.yml +1 -1
  20. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.network.label.yml +1 -1
  21. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.network.state.message.yml +1 -1
  22. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.networkinterface.interface.yml +1 -1
  23. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.networkinterface.state.message.yml +1 -1
  24. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storage.state.message.yml +1 -1
  25. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storagelink.deviceid.yml +1 -1
  26. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storagelink.mountpoint.yml +1 -1
  27. data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storagelink.state.message.yml +1 -1
  28. data/lib/occi/infrastructure_ext/warehouse.rb +1 -1
  29. data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.ipreservation.state.message.yml +1 -1
  30. data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.securitygroup.state.message.yml +1 -1
  31. data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.securitygrouplink.state.message.yml +1 -1
  32. data/occi-core.gemspec +0 -1
  33. metadata +3 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d523a58448adfcac4670df02b7666b1a9e48c7da
4
- data.tar.gz: 2442b720cd5e338f33bfcf92f3da9ce1a3bff0c0
3
+ metadata.gz: 136ea405fc28df1ba974238e15868846e6b9c642
4
+ data.tar.gz: d143cff13d9d828ff10b8b895d01a096e9c5795e
5
5
  SHA512:
6
- metadata.gz: 02bf8369a2c0c5a084e670b2f106d43ba83312ba0e0bd2ae7b84421da32e2aa592f7f95b51a2c892f7ea5160cf7aa72a894245c1e91e194e13acb4859874f217
7
- data.tar.gz: f8565410f77fd48b20aff72581fb2e477c00e3f8a5e42afc784988b01395360fdcdf3d5329d23b6c2a54b9e905ea26d98c8be2378e6257951a199f46c52032fb
6
+ metadata.gz: c71d4e04e3b60b555e0f81f21eeedb536c748d09cb25039dfa4e8e1e05e9b6d2b2f8d35baf785cfd106fb87bdd89cb99645b2359679c78e418dd503a6c2d5a70
7
+ data.tar.gz: 5141b7ed36095b8d3a2ac55aed12e050a2d8eeae87c6414b7662b9434969a5a226ea1b03bad5d205293e466c27ee567b864097919b7b3ca09078c19b9e1e76c1
@@ -1,4 +1,3 @@
1
- require: rubocop-rspec
2
1
  inherit_from: .rubocop_todo.yml
3
2
 
4
3
  Metrics/ModuleLength:
@@ -44,7 +43,7 @@ Style/NilComparison:
44
43
  Exclude:
45
44
  - 'spec/occi/core/category_spec.rb'
46
45
 
47
- Style/FileName:
46
+ Naming/FileName:
48
47
  Exclude:
49
48
  - 'lib/occi/infrastructure-ext.rb'
50
49
 
@@ -52,16 +51,6 @@ Style/YodaCondition:
52
51
  Exclude:
53
52
  - 'lib/occi/core/helpers/parser_dereferencer.rb'
54
53
 
55
- RSpec/MultipleExpectations:
56
- Max: 5
57
-
58
- RSpec/MessageSpies:
59
- EnforcedStyle: receive
60
-
61
- RSpec/SubjectStub:
62
- Exclude:
63
- - 'spec/**/*'
64
-
65
- RSpec/MessageExpectation:
54
+ Lint/Void:
66
55
  Exclude:
67
- - 'spec/**/*'
56
+ - '**/*'
@@ -2,3 +2,8 @@ Style/RescueModifier:
2
2
  Exclude:
3
3
  - 'lib/occi/core/parsers/json/entity.rb'
4
4
  - 'lib/occi/core/parsers/text/entity.rb'
5
+
6
+ Lint/RescueWithoutErrorClass:
7
+ Exclude:
8
+ - 'lib/occi/core/parsers/json/entity.rb'
9
+ - 'lib/occi/core/parsers/text/entity.rb'
@@ -1,4 +1,10 @@
1
1
 
2
+ 5.0.2 / 2017-09-27
3
+ ==================
4
+
5
+ * Relaxing strict Regexp patterns on attrs
6
+ * DOI for releases from ZENODO
7
+
2
8
  5.0.1 / 2017-09-05
3
9
  ==================
4
10
 
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![Gemnasium](https://img.shields.io/gemnasium/the-rocci-project/rOCCI-core.svg?style=flat-square)](https://gemnasium.com/the-rocci-project/rOCCI-core)
4
4
  [![Gem](https://img.shields.io/gem/v/occi-core.svg?style=flat-square)](https://rubygems.org/gems/occi-core)
5
5
  [![Code Climate](https://img.shields.io/codeclimate/github/the-rocci-project/rOCCI-core.svg?style=flat-square)](https://codeclimate.com/github/the-rocci-project/rOCCI-core)
6
+ [![DOI](https://zenodo.org/badge/101084614.svg)](https://zenodo.org/badge/latestdoi/101084614)
6
7
 
7
8
  ## Requirements
8
9
  ### Ruby
@@ -16,7 +16,8 @@ module Occi
16
16
  include Helpers::ArgumentValidator
17
17
  include Helpers::InstanceAttributeResetter
18
18
 
19
- attr_accessor :action, :attributes
19
+ attr_reader :action
20
+ attr_accessor :attributes
20
21
 
21
22
  ERRORS = [
22
23
  Occi::Core::Errors::AttributeValidationError,
@@ -133,7 +134,7 @@ module Occi
133
134
  # :nodoc:
134
135
  def valid_attribute!(name, attribute)
135
136
  attribute.valid!
136
- rescue => ex
137
+ rescue StandardError => ex
137
138
  raise ex, "Attribute #{name.inspect} invalid: #{ex}", ex.backtrace
138
139
  end
139
140
  end
@@ -24,8 +24,9 @@ module Occi
24
24
  include Helpers::InstanceAttributeResetter
25
25
  include Helpers::MixinSelector
26
26
 
27
- attr_accessor :kind, :actions, :attributes, :mixins
27
+ attr_reader :kind, :mixins
28
28
  attr_writer :location
29
+ attr_accessor :actions, :attributes
29
30
 
30
31
  ERRORS = [
31
32
  Occi::Core::Errors::AttributeValidationError, Occi::Core::Errors::AttributeDefinitionError,
@@ -295,7 +296,7 @@ module Occi
295
296
  #
296
297
  # @return [NilClass] when entity instance is valid
297
298
  def valid!
298
- %i[kind location attributes mixins actions].each do |attr|
299
+ %i[kind attributes mixins actions].each do |attr|
299
300
  unless send(attr)
300
301
  raise Occi::Core::Errors::InstanceValidationError,
301
302
  "Missing valid #{attr}"
@@ -334,7 +335,7 @@ module Occi
334
335
  # :nodoc:
335
336
  def valid_attribute!(name, attribute)
336
337
  attribute.valid!
337
- rescue => ex
338
+ rescue StandardError => ex
338
339
  raise ex, "Attribute #{name.inspect} invalid: #{ex}", ex.backtrace
339
340
  end
340
341
 
@@ -376,8 +377,7 @@ module Occi
376
377
  # @return [URI] generated location
377
378
  def generate_location
378
379
  if id.blank?
379
- raise Occi::Core::Errors::MandatoryArgumentError,
380
- 'Cannot generate default location without an `id`'
380
+ raise Occi::Core::Errors::MandatoryArgumentError, 'Cannot generate default location without an `id`'
381
381
  end
382
382
  URI.parse "#{kind.location}#{id}"
383
383
  end
@@ -14,7 +14,7 @@ module Occi
14
14
  raise 'You have to provide a block' unless block_given?
15
15
  begin
16
16
  yield # do whatever you need to do
17
- rescue => ex
17
+ rescue StandardError => ex
18
18
  raise klass, ex.message
19
19
  end
20
20
  end
@@ -9,7 +9,7 @@ module Occi
9
9
  # :nodoc:
10
10
  def raw_hash(body)
11
11
  JSON.parse body, symbolize_names: true
12
- rescue => ex
12
+ rescue StandardError => ex
13
13
  raise Occi::Core::Errors::ParsingError, "JSON parsing failed: #{ex.message}"
14
14
  end
15
15
  end
@@ -61,7 +61,7 @@ module Occi
61
61
  def valid?
62
62
  valid!
63
63
  true
64
- rescue => ex
64
+ rescue StandardError => ex
65
65
  logger.warn "Location invalid: #{ex.message}"
66
66
  false
67
67
  end
@@ -73,7 +73,7 @@ module Occi
73
73
  # @raise [Occi::Core::Errors::LocationValidationError] if some location is invalid
74
74
  def valid!
75
75
  map! { |uri| return_or_convert uri }
76
- rescue => ex
76
+ rescue StandardError => ex
77
77
  raise Occi::Core::Errors::LocationValidationError, ex.message
78
78
  end
79
79
  alias convert! valid!
@@ -11,7 +11,7 @@ module Occi
11
11
 
12
12
  # Repository constants
13
13
  SCHEMA_DIR = 'validator'.freeze
14
- SCHEMA_REPO = File.join(File.expand_path(File.dirname(__FILE__)), SCHEMA_DIR)
14
+ SCHEMA_REPO = File.join(__dir__, SCHEMA_DIR)
15
15
  BASE_SCHEMAS = %i[occi-schema].freeze
16
16
 
17
17
  class << self
@@ -88,7 +88,7 @@ module Occi
88
88
  begin
89
89
  Json::Validator.validate! body, type
90
90
  found = type
91
- rescue => ex
91
+ rescue StandardError => ex
92
92
  logger.debug { "Moving on, body does not contain valid #{type} - #{ex.message.inspect}" }
93
93
  end
94
94
  end
@@ -2,7 +2,7 @@ module Occi
2
2
  module Core
3
3
  MAJOR_VERSION = 5 # Major update constant
4
4
  MINOR_VERSION = 0 # Minor update constant
5
- PATCH_VERSION = 1 # Patch/Fix version constant
5
+ PATCH_VERSION = 2 # Patch/Fix version constant
6
6
  STAGE_VERSION = nil # use `nil` for production releases
7
7
 
8
8
  unless defined?(::Occi::Core::VERSION)
@@ -40,7 +40,7 @@ module Occi
40
40
 
41
41
  # :nodoc:
42
42
  def whereami
43
- File.expand_path(File.dirname(__FILE__))
43
+ __dir__
44
44
  end
45
45
 
46
46
  # :nodoc:
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: true
5
5
  default: ~
6
6
  description: Title assigned to this entity sub-type instance.
7
- pattern: !ruby/regexp '/^[[:word:]]([[:blank:]]|[[:word:]]|\-)*$/'
7
+ pattern: !ruby/regexp '/^.+$/'
@@ -12,7 +12,7 @@ module Occi
12
12
 
13
13
  # :nodoc:
14
14
  def whereami
15
- File.expand_path(File.dirname(__FILE__))
15
+ __dir__
16
16
  end
17
17
  end
18
18
  end
@@ -16,4 +16,4 @@ attributes:
16
16
  mutable: true
17
17
  default: ~
18
18
  description: Name of the copy
19
- pattern: !ruby/regexp '/^[[:alnum:]]+$/'
19
+ pattern: !ruby/regexp '/^.+$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: true
5
5
  default: ~
6
6
  description: Compute FQDN.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.+$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Human-readable description of the current state.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.*$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: true
5
5
  default: ~
6
6
  description: Label of the network instance.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.+$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Human-readable description of the current state.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.*$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Network interface name.
7
- pattern: !ruby/regexp '/^[[:alnum:]]+$/'
7
+ pattern: !ruby/regexp '/^.+$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Human-readable description of the current state.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.*$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Human-readable description of the current state.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.*$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Block device ID.
7
- pattern: !ruby/regexp '/^([[:alnum:]]|-|_|\/)+$/'
7
+ pattern: !ruby/regexp '/^.+$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Block device mount point.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.+$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Human-readable description of the current state.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.*$/'
@@ -12,7 +12,7 @@ module Occi
12
12
 
13
13
  # :nodoc:
14
14
  def whereami
15
- File.expand_path(File.dirname(__FILE__))
15
+ __dir__
16
16
  end
17
17
  end
18
18
  end
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Human-readable description of the current state.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.*$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Human-readable description of the current state.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.*$/'
@@ -4,4 +4,4 @@ required: false
4
4
  mutable: false
5
5
  default: ~
6
6
  description: Human-readable description of the current state.
7
- pattern: ~
7
+ pattern: !ruby/regexp '/^.*$/'
@@ -28,7 +28,6 @@ Gem::Specification.new do |gem|
28
28
  gem.add_development_dependency 'simplecov', '>= 0.11', '< 1'
29
29
  gem.add_development_dependency 'pry', '>= 0.10', '< 1'
30
30
  gem.add_development_dependency 'rubocop', '>= 0.32', '< 1'
31
- gem.add_development_dependency 'rubocop-rspec', '>= 1.5', '< 2'
32
31
  gem.add_development_dependency 'rubygems-tasks', '>= 0.2', '< 1'
33
32
  gem.add_development_dependency 'yard', '>= 0.8', '< 1'
34
33
  gem.add_development_dependency 'fasterer', '>= 0.3.2', '< 0.4'
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: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Parak
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-05 00:00:00.000000000 Z
12
+ date: 2017-09-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -211,26 +211,6 @@ dependencies:
211
211
  - - "<"
212
212
  - !ruby/object:Gem::Version
213
213
  version: '1'
214
- - !ruby/object:Gem::Dependency
215
- name: rubocop-rspec
216
- requirement: !ruby/object:Gem::Requirement
217
- requirements:
218
- - - ">="
219
- - !ruby/object:Gem::Version
220
- version: '1.5'
221
- - - "<"
222
- - !ruby/object:Gem::Version
223
- version: '2'
224
- type: :development
225
- prerelease: false
226
- version_requirements: !ruby/object:Gem::Requirement
227
- requirements:
228
- - - ">="
229
- - !ruby/object:Gem::Version
230
- version: '1.5'
231
- - - "<"
232
- - !ruby/object:Gem::Version
233
- version: '2'
234
214
  - !ruby/object:Gem::Dependency
235
215
  name: rubygems-tasks
236
216
  requirement: !ruby/object:Gem::Requirement
@@ -594,7 +574,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
594
574
  version: '0'
595
575
  requirements: []
596
576
  rubyforge_project:
597
- rubygems_version: 2.6.12
577
+ rubygems_version: 2.6.13
598
578
  signing_key:
599
579
  specification_version: 4
600
580
  summary: The rOCCI core toolkit