ruby3mf 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ruby3mf/model3mf.rb +11 -2
- data/lib/ruby3mf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 737fe004ae04714fe3a70c43ec4ccfa82b0472fb
|
4
|
+
data.tar.gz: 887d66d7fc0779bd0094ebd3c7a09fbfd3c1bc16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cd5a582a8d7450f6f8b9cd8076a674e520c0782061871058371c998b4e06e77bb8e777cc27c0334db083d2f12ce0fefe9833571781ef0aae856046703869694
|
7
|
+
data.tar.gz: 1f0a3bf6e58cdbda7b84506032c1ba08c5ad69fc8edb145f84c06573341c4cb81345add496546cef26e42f215de8deeddf0eae6f9bab9046e42c49ce82c25292
|
data/lib/ruby3mf/model3mf.rb
CHANGED
@@ -34,7 +34,7 @@ class Model3mf
|
|
34
34
|
end
|
35
35
|
|
36
36
|
l.context "verifying requiredextensions" do |l|
|
37
|
-
model_doc.css("//model").map{|node| node.attributes["requiredextensions"]}.compact.each do |required_extension|
|
37
|
+
model_doc.css("//model").map { |node| node.attributes["requiredextensions"] }.compact.each do |required_extension|
|
38
38
|
required_extension.value.split(" ").each do |ns|
|
39
39
|
namespace_uri = model_doc.namespaces["xmlns:#{ns}"]
|
40
40
|
l.error :missing_extension_namespace_uri, ns: ns unless namespace_uri
|
@@ -81,8 +81,11 @@ class Model3mf
|
|
81
81
|
|
82
82
|
l.context "verifying build items" do |l|
|
83
83
|
|
84
|
-
|
84
|
+
build_items = model_doc.css('build/item')
|
85
|
+
object_ids = build_items.map { |x| x.attributes["objectid"].value }
|
86
|
+
other_build_items = object_ids.map { |id| find_model_object(model_doc, id, 'other') }.flatten
|
85
87
|
|
88
|
+
l.error :build_with_other_item if other_build_items.any?
|
86
89
|
end
|
87
90
|
|
88
91
|
l.context "checking metadata" do |l|
|
@@ -117,4 +120,10 @@ class Model3mf
|
|
117
120
|
end
|
118
121
|
model_doc
|
119
122
|
end
|
123
|
+
|
124
|
+
def self.find_model_object(model_doc, id, type)
|
125
|
+
model_doc.css('model/resources/object').select do |item|
|
126
|
+
item.attributes['id'].to_s == id && item.attributes['type'] && item.attributes['type'].value == type
|
127
|
+
end
|
128
|
+
end
|
120
129
|
end
|
data/lib/ruby3mf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby3mf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Whitmarsh, Jeff Porter, and William Hertling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|