Skip to content

Commit

Permalink
Merge branch 'master' into 5.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Parak committed Nov 10, 2017
2 parents 70935fc + c736bb5 commit e0a1c68
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

5.0.4 / 2017-11-10
==================

* Forcing attribute type on occi.core.{source,target} to URI

5.0.3 / 2017-10-19
==================
* Added missing support for legacy context mixins
Expand Down
12 changes: 10 additions & 2 deletions lib/occi/core/parsers/json/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def attribute_definitions(raw)
unless def_hsh[:type]
raise Occi::Core::Errors::ParsingError, "Attribute #{k.to_s.inspect} has no type"
end
attr_defs[k.to_s] = Occi::Core::AttributeDefinition.new def_hsh
fix_links!(k, def_hsh)
attr_defs[k.to_s] = Occi::Core::AttributeDefinition.new(def_hsh)
end

attr_defs
Expand Down Expand Up @@ -113,7 +114,14 @@ def lookup_depends_references!(mixin, derefd, parsed_rel)
parsed_rel.each { |mxn| mixin.depends << first_or_die(derefd, mxn) }
end

private :lookup_applies_references!, :lookup_depends_references!
# :nodoc:
def fix_links!(name, definition_hash)
return unless %w[occi.core.source occi.core.target].include?(name.to_s)
logger.debug { "Forcing attribute type on #{name.to_s.inspect} from #{definition_hash[:type]} to URI" }
definition_hash[:type] = URI # forcing 'string' to URI for validation purposes
end

private :lookup_applies_references!, :lookup_depends_references!, :fix_links!
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/occi/core/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Occi
module Core
MAJOR_VERSION = 5 # Major update constant
MINOR_VERSION = 0 # Minor update constant
PATCH_VERSION = 3 # Patch/Fix version constant
PATCH_VERSION = 4 # Patch/Fix version constant
STAGE_VERSION = nil # use `nil` for production releases

unless defined?(::Occi::Core::VERSION)
Expand Down

0 comments on commit e0a1c68

Please sign in to comment.