Skip to content

Commit e6f031a

Browse files
committed
Finish 2.1.7
2 parents 6e8a32d + 0893dca commit e6f031a

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

Gemfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
source "https://rubygems.org"
22

33
gemspec
4-
gem 'rdf', github: "ruby-rdf/rdf", branch: "develop"
5-
gem 'rdf-spec', github: "ruby-rdf/rdf-spec", branch: "develop"
4+
gem 'rdf', git: "https://github.com/ruby-rdf/rdf", branch: "develop"
5+
gem 'rdf-spec', git: "https://github.com/ruby-rdf/rdf-spec", branch: "develop"
66

77
group :development do
8-
gem 'ebnf', github: "gkellogg/ebnf", branch: "develop"
9-
gem 'sxp', github: "dryruby/sxp.rb", branch: "develop"
10-
gem 'rdf-isomorphic', github: "ruby-rdf/rdf-isomorphic", branch: "develop"
11-
gem 'rdf-trig', github: "ruby-rdf/rdf-trig", branch: "develop"
12-
gem 'rdf-vocab', github: "ruby-rdf/rdf-vocab", branch: "develop"
13-
gem 'rdf-xsd', github: "ruby-rdf/rdf-xsd", branch: "develop"
8+
gem 'ebnf', git: "https://github.com/gkellogg/ebnf", branch: "develop"
9+
gem 'sxp', git: "https://github.com/dryruby/sxp.rb", branch: "develop"
10+
gem 'rdf-isomorphic', git: "https://github.com/ruby-rdf/rdf-isomorphic", branch: "develop"
11+
gem 'rdf-trig', git: "https://github.com/ruby-rdf/rdf-trig", branch: "develop"
12+
gem 'rdf-vocab', git: "https://github.com/ruby-rdf/rdf-vocab", branch: "develop"
13+
gem 'rdf-xsd', git: "https://github.com/ruby-rdf/rdf-xsd", branch: "develop"
1414
gem 'fasterer'
1515
gem 'earl-report'
1616
end
1717

1818
group :development, :test do
19-
gem 'simplecov', require: false, platform: :mri, github: "colszowka/simplecov" # Until Fixnum issues solved
19+
gem 'simplecov', require: false, platform: :mri
2020
gem 'coveralls', require: false, platform: :mri
2121
gem 'psych', platforms: [:mri, :rbx]
2222
gem 'benchmark-ips'

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.6
1+
2.1.7

lib/json/ld/context.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def initialize(term,
113113
def container_mapping=(mapping)
114114
mapping = Array(mapping)
115115
if @as_set = mapping.include?('@set')
116+
mapping = mapping.dup
116117
mapping.delete('@set')
117118
end
118119
@container_mapping = mapping.first
@@ -1616,7 +1617,7 @@ def check_container(container, local_context, defined, term)
16161617
"'@container' on term #{term.inspect} must be a string: #{container.inspect}"
16171618
end
16181619

1619-
val = Array(container)
1620+
val = Array(container).dup
16201621
val.delete('@set') if has_set = val.include?('@set')
16211622

16221623
raise JsonLdError::InvalidContainerMapping,

lib/json/ld/expand.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ def expand(input, active_property, context, ordered: true)
3232
raise JsonLdError::ListOfLists,
3333
"A list may not contain another list" if
3434
is_list && (v.is_a?(Array) || list?(v))
35-
memo << v unless v.nil?
35+
case v
36+
when nil then nil
37+
when Array then memo.concat(v)
38+
else memo << v
39+
end
3640
end
3741

3842
value

spec/expand_spec.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,29 @@
637637
"http://example.com/foo" => []
638638
}]
639639
},
640+
"Free-floating values in sets" => {
641+
input: %({
642+
"@context": {"property": "http://example.com/property"},
643+
"@graph": [{
644+
"@set": [
645+
"free-floating strings in set objects are removed",
646+
{"@id": "http://example.com/free-floating-node"},
647+
{
648+
"@id": "http://example.com/node",
649+
"property": "nodes with properties are not removed"
650+
}
651+
]
652+
}]
653+
}),
654+
output: %([{
655+
"@id": "http://example.com/node",
656+
"http://example.com/property": [
657+
{
658+
"@value": "nodes with properties are not removed"
659+
}
660+
]
661+
}])
662+
}
640663
}.each do |title, params|
641664
it(title) {run_expand params}
642665
end

0 commit comments

Comments
 (0)