circuitdata 0.5.1 → 0.6.0

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: bcf321b8a7e8598d02416139e9c123515d6c2ab6
4
- data.tar.gz: 6ebd5b1f5db47775a316ccdb8504ea415e726a9d
3
+ metadata.gz: 782183884b382968b49c6b4e2f3bfe9222e1064e
4
+ data.tar.gz: 4153d944609d5aa7644fc52d4f2e8f92ca36ca25
5
5
  SHA512:
6
- metadata.gz: 9b4290b6fcf5f8cdf725f2ef2130699be3c57ba06aae883062c6bf969042ed96b60b1f8556fec7f64848f0d2ada9dc81b39cf61b2bc9ef81bd53ca06e571a232
7
- data.tar.gz: 1b27bb2cb683881085ff3edccc53035c4cf21f9ab242573e86e16d0180547a57f6cae468c3bc47e439ebcaddb32796d9267c4d95e0a787c07e810920822eb2af
6
+ metadata.gz: 9edf4cd6cc18adf6c22e2579b6548bc967baea9854ed9f0f6d86e9f3838155eb7ea66855d019286b3a5e28409e0d178eb7562f1ff9a69ce919f47ef6046cd240
7
+ data.tar.gz: d4b11cce34ab6448afd7789287209bef51b57d262a35bdc8eca5dc9e831fa1211fa6fc92ded3a1b5a4b510f2860fc1b4451f39c35a5426c1b771538804787d4d
data/README.md CHANGED
@@ -26,32 +26,159 @@ require 'circuitdata'
26
26
 
27
27
  ### Commands
28
28
 
29
+ #### `Circuitdata.compatibility_checker`
30
+
31
+ Test one file against the schema
32
+ ```ruby
33
+ Circuitdata.compatibility_checker('testfile-product.json')
34
+ ```
35
+ When valid gives:
36
+ ```ruby
37
+ {
38
+ :error => false,
39
+ :errormessage => "",
40
+ :validationserrors => {},
41
+ :restrictederrors => {},
42
+ :enforcederrors => {},
43
+ :capabilitieserrors => {}
44
+ }
45
+ ```
46
+
47
+ Test two files up against each other (one must be a product file).
48
+ ```ruby
49
+ Circuitdata.compatibility_checker('testfile-product.json','testfile-profile-restricted.json')
50
+ ```
51
+
52
+ When invalid results in:
53
+ ```ruby
54
+ {
55
+ :error => true,
56
+ :errormessage => "The product to check did not meet the requirements",
57
+ :validationserrors => {},
58
+ :restrictederrors => {
59
+ "#/open_trade_transfer_package/products/testproduct/printed_circuits_fabrication_data/board/thickness" => [
60
+ "of type number matched the disallowed schema"
61
+ ]
62
+ },
63
+ :enforcederrors => {},
64
+ :capabilitieserrors => {}
65
+ }
66
+ ```
67
+
68
+ Turn off validation against the schema
69
+ ```ruby
70
+ Circuitdata.compatibility_checker( 'testfile-product.json', 'testfile-profile-restricted.json', false )
29
71
  ```
30
- 2.3.0 :001 > require 'circuitdata'
31
- => true
32
- 2.3.0 :002 > # Test one file against the schema
33
- 2.3.0 :004 > Circuitdata.compatibility_checker( 'testfile-product.json')
34
- => {:error=>false, :errormessage=>"", :validationserrors=>{}, :restrictederrors=>{}, :enforcederrors=>{}, :capabilitieserrors=>{}}
35
- 2.3.0 :005 >
36
- 2.3.0 :006 > # Test two files up against each other (one must be a product file)
37
- 2.3.0 :007 > Circuitdata.compatibility_checker( 'testfile-product.json', 'testfile-profile-restricted.json' )
38
- => {:error=>true, :errormessage=>"The product to check did not meet the requirements", :validationserrors=>{}, :restrictederrors=>{"#/open_trade_transfer_package/products/testproduct/printed_circuits_fabrication_data/board/thickness"=>["of type number matched the disallowed schema"]}, :enforcederrors=>{}, :capabilitieserrors=>{}}
39
- 2.3.0 :005 >
40
- 2.3.0 :009 > # Turn off validation against the schema
41
- 2.3.0 :008 > Circuitdata.compatibility_checker( 'testfile-product.json', 'testfile-profile-restricted.json', false )
42
- => {:error=>true, :errormessage=>"The product to check did not meet the requirements", :validationserrors=>{}, :restrictederrors=>{"#/open_trade_transfer_package/products/testproduct/printed_circuits_fabrication_data/board/thickness"=>["of type number matched the disallowed schema"]}, :enforcederrors=>{}, :capabilitieserrors=>{}}
43
- 2.3.0 :005 > # Run a test with several files against each other and get a complete list of values and conflicts, and a summary
44
- 2.3.0 :006 > product1 = File.join(File.dirname(__FILE__), 'test/test_data/test_product1.json')
45
- => "./test/test_data/test_product1.json"
46
- 2.3.0 :007 > profile_restricted = File.join(File.dirname(__FILE__), 'test/test_data/testfile-profile-restricted.json')
47
- => "./test/test_data/testfile-profile-restricted.json"
48
- 2.3.0 :008 > profile_default = File.join(File.dirname(__FILE__), 'test/test_data/testfile-profile-default.json')
49
- => "./test/test_data/testfile-profile-default.json"
50
- 2.3.0 :009 > file_hash = {product1: product1, restricted: profile_restricted, default: profile_default}
51
- => {:product1=>"./test/test_data/test_product1.json", :restricted=>"./test/test_data/testfile-profile-restricted.json", :default=>"./test/test_data/testfile-profile-default.json"}
52
- 2.3.0 :010 > Circuitdata.compare_files(file_hash, true)
53
- => {:error=>false, :message=>nil, :conflict=>false, :product_name=>"testproduct", :columns=>[:summary, :product1, :restricted, :default], :master_column=>nil, :rows=>{:rigid_conductive_layer=>{:count=>{:product1=>{:value=>11, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :restricted=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :default=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :summary=>{:value=>11, :conflict=>false, :conflicts_with=>[:product1], :conflict_message=>[]}}, :minimum_external_track_width=>{:product1=>{:value=>0.14, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :restricted=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :default=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :summary=>{:value=>0.14, :conflict=>false, :conflicts_with=>[:product1], :conflict_message=>[]}}, :minimum_external_spacing_width=>{:product1=>{:value=>0.14, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :restricted=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :default=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :summary=>{:value=>0.14, :conflict=>false, :conflicts_with=>[:product1], :conflict_message=>[]}}, :copper_foil_roughness=>{:product1=>{:value=>"L", :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :restricted=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :default=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :summary=>{:value=>"L", :conflict=>false, :conflicts_with=>[:product1], :conflict_message=>[]}}}, :legend=>{:color=>{:product1=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :restricted=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :default=>{:value=>"white", :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :summary=>{:value=>"white", :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}}}, :array=>{:fiducials_number=>{:product1=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :restricted=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :default=>{:value=>3, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :summary=>{:value=>3, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}}, :fiducials_shape=>{:product1=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :restricted=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :default=>{:value=>"circle", :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :summary=>{:value=>"circle", :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}}, :breakaway_method=>{:product1=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :restricted=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :default=>{:value=>"routing", :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :summary=>{:value=>"routing", :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}}, :mouse_bites=>{:product1=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :restricted=>{:value=>nil, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :default=>{:value=>true, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}, :summary=>{:value=>true, :conflict=>false, :conflicts_with=>[], :conflict_message=>[]}}}}}
72
+ Gives:
73
+ ```ruby
74
+ {
75
+ :error => true,
76
+ :errormessage => "The product to check did not meet the requirements",
77
+ :validationserrors => {},
78
+ :restrictederrors => {
79
+ "#/open_trade_transfer_package/products/testproduct/printed_circuits_fabrication_data/board/thickness" => ["of type number matched the disallowed schema"]
80
+ },
81
+ :enforcederrors => {},
82
+ :capabilitieserrors => {}
83
+ }
84
+
85
+ ```
86
+
87
+ #### `Circuitdata.compare_files`
88
+
89
+ Run a test with several files against each other and get a complete list of values and conflicts, and a summary
90
+ ```ruby
91
+ product1 = File.join(__dir__, 'test/test_data/test_product1.json')
92
+ profile_restricted = File.join(__dir__, 'test/test_data/testfile-profile-restricted.json')
93
+ profile_default = File.join(__dir__, 'test/test_data/testfile-profile-default.json')
94
+ file_hash = {product1: product1, restricted: profile_restricted, default: profile_default}
95
+
96
+ Circuitdata.compare_files(file_hash, true)
97
+ ```
98
+
99
+ Results in:
100
+ ```ruby
101
+ {
102
+ :error=>false,
103
+ :message=>nil,
104
+ :conflict=>false,
105
+ :product_name=>"testproduct",
106
+ :columns=>[
107
+ :summary,
108
+ :product1,
109
+ :restricted,
110
+ :default
111
+ ],
112
+ :master_column=>nil,
113
+ :rows=>{
114
+ :rigid_conductive_layer=>{
115
+ :count=>{
116
+ :product1=>{
117
+ :value=>11,
118
+ :conflict=>false,
119
+ :conflicts_with=>[],
120
+ :conflict_message=>[]
121
+ },
122
+ :restricted=>{
123
+ :value=>nil,
124
+ :conflict=>false,
125
+ :conflicts_with=>[],
126
+ :conflict_message=>[]
127
+ },
128
+ :default=>{
129
+ :value=>nil,
130
+ :conflict=>false,
131
+ :conflicts_with=>[],
132
+ :conflict_message=>[]
133
+ },
134
+ :summary=>{
135
+ :value=>11,
136
+ :conflict=>false,
137
+ :conflicts_with=>[:product1],
138
+ :conflict_message=>[]
139
+ }
140
+ }
141
+ # ...
142
+ }
143
+ }
144
+ }
54
145
  ```
55
146
 
147
+ #### `Circuitdata.dereferenced_schema`
148
+
149
+ This returns the JSON schema used internally to validate the Circuit Data information. It
150
+ returns the schema without any usage of `$ref` so that it can be utilized without any knowledge of the internal paths.
151
+
152
+ #### `Circuitdata::Profile.schema`
153
+
154
+ Returns a subset of the Circuit Data schema that relates to profiles. This is a schema without any `$ref`s.
155
+ #### `Circuitdata::Profile.questions`
156
+ Returns a list of grouped questions that can be used for populating an input interface related to profiles.
157
+
158
+ Example output:
159
+ ```ruby
160
+ [
161
+ {
162
+ id: :rigid_conductive_layer,
163
+ name: 'Rigid conductive layer',
164
+ questions: [
165
+ {
166
+ code: :copper_foil_roughness,
167
+ name: 'Copper foil roughness',
168
+ defaults: {
169
+ descriptor: {
170
+ type: "string",
171
+ enum: ["S", "L", "V"],
172
+ uom: ["um"],
173
+ description: "The roughness of the copper foil."
174
+ },
175
+ path: "/open_trade_transfer_package/profiles/defaults/printed_circuits_fabrication_data/rigid_conductive_layer/copper_foil_roughness"
176
+ }
177
+ },
178
+ ]
179
+ }
180
+ # ...
181
+ ]
182
+ ```
56
183
  ## License
57
184
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -1,8 +1,14 @@
1
1
  module Circuitdata
2
2
  # SHOULD ONLY HOUSE COMMON FUNCTIONS ONLY
3
3
  require 'active_support/all'
4
- require 'circuitdata/file_comparer'
5
- require 'circuitdata/compatibility_checker'
4
+ require 'json-schema'
5
+ require_relative './circuitdata/file_comparer'
6
+ require_relative './circuitdata/compatibility_checker'
7
+ require_relative './circuitdata/dereferencer'
8
+ require_relative './circuitdata/profile'
9
+
10
+ SCHEMA_PATH = 'circuitdata/schema_files/v1/ottp_circuitdata_schema.json'
11
+ SCHEMA_FULL_PATH = File.join(__dir__, SCHEMA_PATH)
6
12
 
7
13
  def self.get_data_summary(data)
8
14
  types = []
@@ -26,7 +32,6 @@ module Circuitdata
26
32
  end
27
33
 
28
34
  def self.read_json(file)
29
- require 'json'
30
35
  error, message, data = false, nil, nil
31
36
 
32
37
  if file.is_a? Hash
@@ -51,13 +56,10 @@ module Circuitdata
51
56
  end
52
57
 
53
58
  def self.validate(content)
54
- require 'json-schema'
55
59
  error, message, validations_errors = false, nil, {}
56
- schema = File.join(File.dirname(__FILE__), 'circuitdata/schema_files/v1/ottp_circuitdata_schema.json')
57
- # schema = 'http://schema.circuitdata.org/v1/ottp_circuitdata_schema.json'
58
60
 
59
61
  begin
60
- validated = JSON::Validator.fully_validate(schema, content, :errors_as_objects => true)
62
+ validated = JSON::Validator.fully_validate(SCHEMA_FULL_PATH, content, :errors_as_objects => true)
61
63
  rescue JSON::Schema::ReadFailed
62
64
  error = true
63
65
  message = "Could not read the validating schema"
@@ -83,6 +85,20 @@ module Circuitdata
83
85
  return error, message, validations_errors
84
86
  end
85
87
 
88
+ def self.schema
89
+ JSON.parse(
90
+ File.read(SCHEMA_FULL_PATH),
91
+ symbolize_names: true
92
+ )
93
+ end
94
+
95
+ def self.dereferenced_schema
96
+ Dereferencer.dereference(
97
+ schema,
98
+ File.dirname(Circuitdata::SCHEMA_FULL_PATH)
99
+ )
100
+ end
101
+
86
102
  def self.compare_files(file_hash, validate_origins=false)
87
103
  comparer = FileComparer.new(file_hash, validate_origins)
88
104
  comparer.compare
@@ -22,9 +22,12 @@ class Circuitdata::CompatibilityChecker
22
22
  @fh[:error], @fh[:message], @fh[:errors][:validation] = Circuitdata.validate(check_data)
23
23
  return @fh if @fh[:error]
24
24
  f2_types = Circuitdata.get_data_summary(check_data)[1]
25
+
25
26
  # read the schema
26
27
  schema_path = File.join(File.dirname(__FILE__), 'schema_files/v1/ottp_circuitdata_skeleton_schema.json')
27
- restricted_schema = enforced_schema = capability_schema = Circuitdata.read_json(schema_path)[2]
28
+ schema = JSON.parse(File.read(schema_path), symbolize_names: true)
29
+ deref_schema = Circuitdata::Dereferencer.dereference(schema, File.dirname(Circuitdata::SCHEMA_FULL_PATH))
30
+ restricted_schema = enforced_schema = capability_schema = deref_schema
28
31
  # Compare the content
29
32
  perform_comparison(product_data, check_data, restricted_schema, 'restricted') if f2_types.include? 'profile_restricted'
30
33
  perform_comparison(product_data, check_data, enforced_schema, 'enforced') if f2_types.include? 'profile_enforced'
@@ -0,0 +1,75 @@
1
+ module Circuitdata
2
+ class Dereferencer
3
+
4
+ def self.dereference(schema, base_path)
5
+ d = new(base_path)
6
+ d.start(schema)
7
+ end
8
+
9
+ def initialize(base_path)
10
+ @base_path = base_path
11
+ end
12
+
13
+ def start(schema)
14
+ hash_iterator(schema)
15
+ end
16
+
17
+ private
18
+
19
+ attr_reader :base_path
20
+
21
+ def read_file(file_path)
22
+ full_path = File.expand_path(file_path, base_path)
23
+ file = File.read(full_path)
24
+ JSON.parse(file)
25
+ end
26
+
27
+ def get_ref(ref)
28
+ file_path, pointer = ref.split('#')
29
+ data = read_file(file_path)
30
+ pointer_parts = pointer.split('/').reject(&:blank?)
31
+ result = data.dig(*pointer_parts)
32
+ if result.nil?
33
+ fail "Unable to dereference ref=#{ref}"
34
+ end
35
+ result
36
+ end
37
+
38
+
39
+ def hash_iterator(h)
40
+ h = h.clone
41
+ h.each_pair do |k,v|
42
+ if v.is_a?(Hash)
43
+ res = hash_iterator(v)
44
+ if res[:"$ref"]
45
+ h[k] = res[:"$ref"]
46
+ else
47
+ h[k] = res
48
+ end
49
+ elsif v.is_a?(Array)
50
+ h[k] = array_iterator(v)
51
+ else
52
+ if k == :"$ref"
53
+ ref_schema = get_ref(v)
54
+ return hash_iterator(ref_schema)
55
+ else
56
+ h[k] = v
57
+ end
58
+ end
59
+ end
60
+ h
61
+ end
62
+
63
+ def array_iterator(arr)
64
+ arr.map do |v|
65
+ if v.is_a?(Hash)
66
+ hash_iterator(v)
67
+ elsif v.is_a?(Array)
68
+ array_iterator(arr)
69
+ else
70
+ v
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,80 @@
1
+ module Circuitdata
2
+ class Profile
3
+ def self.schema
4
+ schema = Circuitdata.dereferenced_schema
5
+ ottp = schema.dig(
6
+ :properties,
7
+ :open_trade_transfer_package,
8
+ )
9
+ ottp[:properties] = ottp[:properties].slice(:profiles)
10
+ schema
11
+ end
12
+
13
+ def self.questions
14
+ questions_for_type(:profiles, schema)
15
+ end
16
+
17
+ private
18
+
19
+ CATEGORY_PATH = [:properties, :printed_circuits_fabrication_data, :properties]
20
+
21
+ def self.questions_for_type(type, schema)
22
+ pointer_path = [
23
+ :properties,
24
+ :open_trade_transfer_package,
25
+ :properties,
26
+ type,
27
+ :properties
28
+ ]
29
+ types_schema = schema.dig(*pointer_path)
30
+ result = []
31
+ types_schema.each do |question_type, type_schema|
32
+ categories_schema = type_schema.dig(*CATEGORY_PATH)
33
+ categories_schema.each do |category_id, category_schema|
34
+ next if category_id == :version
35
+ category = result.find {|cat| cat[:id] == category_id }
36
+ if category.nil?
37
+ category = {
38
+ id: category_id,
39
+ name: category_id.to_s.humanize,
40
+ questions: []
41
+ }
42
+ result << category
43
+ end
44
+ extract_questions_for_category(
45
+ question_type,
46
+ category,
47
+ category_schema,
48
+ pointer_path + [question_type] + CATEGORY_PATH + [category_id]
49
+ )
50
+ end
51
+ end
52
+ result
53
+ end
54
+
55
+ def self.extract_questions_for_category(question_type, category, category_schema, path)
56
+ # Ignore question arrays for now.
57
+ return if category_schema[:type] == "array"
58
+ category_questions = category[:questions]
59
+
60
+ category_schema[:properties].each do |question_code, descriptor|
61
+ question = category_questions.find {|question| question[:code] == question_code }
62
+ if question.nil?
63
+ question = {
64
+ code: question_code,
65
+ name: question_code.to_s.humanize
66
+ }
67
+ category_questions << question
68
+ end
69
+ question[question_type] = {
70
+ descriptor: descriptor,
71
+ path: json_pointer(path + [question_code])
72
+ }
73
+ end
74
+ end
75
+
76
+ def self.json_pointer(path_parts)
77
+ ([""] + path_parts - [:properties]).join('/')
78
+ end
79
+ end
80
+ end
@@ -1,6 +1,5 @@
1
1
  {
2
- // "$schema": "http://json-schema.org/draft-04/schema#",
3
- // "id": "http://schema.circuitdata.org/v1/ottp_circuitdata_schema.json",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
4
3
  "type": "object",
5
4
  "additionalProperties": false,
6
5
  "required": ["open_trade_transfer_package"],
@@ -857,7 +856,7 @@
857
856
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/depth_routing_bottom"
858
857
  },
859
858
  "counterboring_top": {
860
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/ecounterboring_top"
859
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/counterboring_top"
861
860
  },
862
861
  "counterboring_bottom": {
863
862
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/counterboring_bottom"
@@ -1001,7 +1000,7 @@
1001
1000
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/nadcap"
1002
1001
  },
1003
1002
  "rw_en45545_2_2013": {
1004
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/rw_en45545_2_2013"
1003
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/rw_en45545_2_2013"
1005
1004
  },
1006
1005
  "rw_nf_f_16_101": {
1007
1006
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/rw_nf_f_16_101"
@@ -1018,8 +1017,8 @@
1018
1017
  "ipc_6010_compliance_level": {
1019
1018
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ipc_6010_compliance_level"
1020
1019
  },
1021
- "pc_6010_copper_plating_thickness_level": {
1022
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/pc_6010_copper_plating_thickness_level"
1020
+ "ipc_6010_copper_plating_thickness_level": {
1021
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ipc_6010_copper_plating_thickness_level"
1023
1022
  },
1024
1023
  "ipc_6010_annular_ring_level": {
1025
1024
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ipc_6010_annular_ring_level"
@@ -1588,7 +1587,7 @@
1588
1587
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/depth_routing_bottom"
1589
1588
  },
1590
1589
  "counterboring_top": {
1591
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/ecounterboring_top"
1590
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/counterboring_top"
1592
1591
  },
1593
1592
  "counterboring_bottom": {
1594
1593
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/counterboring_bottom"
@@ -1687,7 +1686,7 @@
1687
1686
  "additionalProperties": false,
1688
1687
  "properties": {
1689
1688
  "ul": {
1690
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/ul"
1689
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ul"
1691
1690
  },
1692
1691
  "c_ul": {
1693
1692
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/c_ul"
@@ -1723,7 +1722,7 @@
1723
1722
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/nadcap"
1724
1723
  },
1725
1724
  "rw_en45545_2_2013": {
1726
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/rw_en45545_2_2013"
1725
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/rw_en45545_2_2013"
1727
1726
  },
1728
1727
  "rw_nf_f_16_101": {
1729
1728
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/rw_nf_f_16_101"
@@ -1740,8 +1739,8 @@
1740
1739
  "ipc_6010_compliance_level": {
1741
1740
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ipc_6010_compliance_level"
1742
1741
  },
1743
- "pc_6010_copper_plating_thickness_level": {
1744
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/pc_6010_copper_plating_thickness_level"
1742
+ "ipc_6010_copper_plating_thickness_level": {
1743
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ipc_6010_copper_plating_thickness_level"
1745
1744
  },
1746
1745
  "ipc_6010_annular_ring_level": {
1747
1746
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ipc_6010_annular_ring_level"
@@ -2900,7 +2899,7 @@
2900
2899
  {"$ref": "ottp_circuitdata_schema_definitions.json#/definitions/generics/string"}
2901
2900
  ]
2902
2901
  },
2903
- "pc_6010_copper_plating_thickness_level": {
2902
+ "ipc_6010_copper_plating_thickness_level": {
2904
2903
  "anyOf": [
2905
2904
  {"$ref": "ottp_circuitdata_schema_definitions.json#/definitions/generics/range"},
2906
2905
  {"$ref": "ottp_circuitdata_schema_definitions.json#/definitions/generics/number"},
@@ -4130,7 +4129,7 @@
4130
4129
  {"$ref": "ottp_circuitdata_schema_definitions.json#/definitions/generics/string"}
4131
4130
  ]
4132
4131
  },
4133
- "pc_6010_copper_plating_thickness_level": {
4132
+ "ipc_6010_copper_plating_thickness_level": {
4134
4133
  "anyOf": [
4135
4134
  {"$ref": "ottp_circuitdata_schema_definitions.json#/definitions/generics/range"},
4136
4135
  {"$ref": "ottp_circuitdata_schema_definitions.json#/definitions/generics/number"},
@@ -4999,7 +4998,7 @@
4999
4998
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/depth_routing_bottom"
5000
4999
  },
5001
5000
  "counterboring_top": {
5002
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/ecounterboring_top"
5001
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/counterboring_top"
5003
5002
  },
5004
5003
  "counterboring_bottom": {
5005
5004
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/counterboring_bottom"
@@ -5038,7 +5037,7 @@
5038
5037
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/selective_plated_pads/present"
5039
5038
  },
5040
5039
  "layers": {
5041
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/board/layers"
5040
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/selective_plated_pads/layers"
5042
5041
  }
5043
5042
  },
5044
5043
  "aliases": "selective hard gold",
@@ -5107,7 +5106,7 @@
5107
5106
  "additionalProperties": false,
5108
5107
  "properties": {
5109
5108
  "ul": {
5110
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/ul"
5109
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ul"
5111
5110
  },
5112
5111
  "c_ul": {
5113
5112
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/c_ul"
@@ -5143,7 +5142,7 @@
5143
5142
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/nadcap"
5144
5143
  },
5145
5144
  "rw_en45545_2_2013": {
5146
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/mechanical/rw_en45545_2_2013"
5145
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/rw_en45545_2_2013"
5147
5146
  },
5148
5147
  "rw_nf_f_16_101": {
5149
5148
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/rw_nf_f_16_101"
@@ -5160,8 +5159,8 @@
5160
5159
  "ipc_6010_compliance_level": {
5161
5160
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ipc_6010_compliance_level"
5162
5161
  },
5163
- "pc_6010_copper_plating_thickness_level": {
5164
- "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/pc_6010_copper_plating_thickness_level"
5162
+ "ipc_6010_copper_plating_thickness_level": {
5163
+ "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ipc_6010_copper_plating_thickness_level"
5165
5164
  },
5166
5165
  "ipc_6010_annular_ring_level": {
5167
5166
  "$ref": "ottp_circuitdata_schema_definitions.json#/definitions/elements/standards/ipc_6010_annular_ring_level"
@@ -387,7 +387,7 @@
387
387
  "accept_equivalent": {
388
388
  "type": "boolean",
389
389
  "uom": null,
390
- "description": "If alternative to DuPont™ Kapton® HN general-purpose film can be used"
390
+ "description": "If alternative to DuPont Kapton® HN general-purpose film can be used"
391
391
  },
392
392
  "top": {
393
393
  "type": "boolean",
@@ -1,5 +1,5 @@
1
1
  {
2
- // "$schema": "http://json-schema.org/draft-04/schema#",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "type": "object",
4
4
  "additionalProperties": false,
5
5
  "required": ["open_trade_transfer_package"],
@@ -12,8 +12,7 @@
12
12
  "pattern": "^1.0$"
13
13
  },
14
14
  "information": {
15
- "$ref": "https://raw.githubusercontent.com/elmatica/Open-Trade-Transfer-Package/master/v1/ottp_schema_definitions.json#/definitions/information"
16
- // "$ref": "circuitdata/schema_files/v1/ottp_schema_definitions.json#/definitions/information"
15
+ "$ref": "ottp_schema_definitions.json#/definitions/information"
17
16
  },
18
17
  "products": {
19
18
  "type": "object",
@@ -1,3 +1,3 @@
1
1
  module Circuitdata
2
- VERSION = '0.5.1'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circuitdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Lydersen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-29 00:00:00.000000000 Z
11
+ date: 2017-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema
@@ -24,6 +24,48 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '12.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '12.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: activesupport
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '4.2'
27
69
  description: This gem allows you to do basic test and comparison of JSON files agains
28
70
  the CircuitData JSON schema
29
71
  email:
@@ -38,7 +80,9 @@ files:
38
80
  - lib/circuitdata.rb
39
81
  - lib/circuitdata/bk_comparer.rb
40
82
  - lib/circuitdata/compatibility_checker.rb
83
+ - lib/circuitdata/dereferencer.rb
41
84
  - lib/circuitdata/file_comparer.rb
85
+ - lib/circuitdata/profile.rb
42
86
  - lib/circuitdata/schema_files/v1/ottp_circuitdata_schema.json
43
87
  - lib/circuitdata/schema_files/v1/ottp_circuitdata_schema_definitions.json
44
88
  - lib/circuitdata/schema_files/v1/ottp_circuitdata_skeleton_schema.json
@@ -64,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
108
  version: '0'
65
109
  requirements: []
66
110
  rubyforge_project:
67
- rubygems_version: 2.6.8
111
+ rubygems_version: 2.6.13
68
112
  signing_key:
69
113
  specification_version: 4
70
114
  summary: This gem allows you to do basic test and comparison of JSON files agains