RUIC 0.4.1 → 0.4.2

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.
@@ -1,52 +1,52 @@
1
- require 'fileutils'
2
- FileUtils.copy_entry('projects/ReferencedMaterials','projects/_RefMat',false,false,true)
3
-
4
- metadata 'MetaData.xml'
5
-
6
- uia 'projects/_RefMat/ReferencedMaterials.uia'
7
- show app.errors if app.errors?
8
-
9
- layer = app/'main:Scene.Layer'
10
- cubemat = layer/"Cube"/"Material"
11
-
12
- # Ensure that the diffuse attribute is linked and present on multiple slides
13
- assert cubemat['diffuse'].linked?
14
- assert cubemat.has_slide?(0)
15
- assert cubemat.has_slide?(1)
16
- assert cubemat.has_slide?(2)
17
- assert cubemat['diffuse',1].r == 0.5
18
- assert cubemat['diffuse',2].r == 0.5
19
-
20
- # When we do not unlink, values remain shared
21
- cubemat['diffuse',1].r = 1
22
- cubemat['diffuse',2].r = 0.2
23
- assert cubemat['diffuse',1].r == cubemat['diffuse',2].r
24
-
25
- # Ensure that we can unlink an attribute and vary the values per slide
26
- cubemat['diffuse'].unlink
27
- assert !cubemat['diffuse'].linked?
28
- cubemat['diffuse',1].r = 1
29
- cubemat['diffuse',2].r = 0.2
30
- assert cubemat['diffuse',1].r == 1
31
- assert cubemat['diffuse',2].r == 0.2
32
-
33
- # We can swap a material with a referenced material
34
- model = cubemat.parent
35
- assert model
36
- ref = cubemat.replace_with_referenced_material
37
- assert cubemat.parent.nil? # The old material is removed from the graph
38
- assert ref.parent==model # The new material is where the old was
39
- assert ref['id'] == cubemat['id'] # The new material has the same id and name
40
- assert ref.name == 'Material'
41
- assert ref['referencedmaterial',0].object.nil? # New referenced materials start out with no reference
42
- assert ref['referencedmaterial',0].type == :absolute # New references default to absolute
43
-
44
- ref['referencedmaterial'].unlink
45
- %w[Sphere Sphere2].each.with_index do |name,s|
46
- # You can set a reference directly to an object, or alternatively
47
- # ref['referencedmaterial',1].object = layer/name/"Material"
48
- ref['referencedmaterial',s+1] = layer/name/"Material"
49
- ref['referencedmaterial',s+1].type = :path
50
- end
51
-
52
- app.save_all!
1
+ require 'fileutils'
2
+ FileUtils.copy_entry('projects/ReferencedMaterials','projects/_RefMat',false,false,true)
3
+
4
+ metadata 'MetaData.xml'
5
+
6
+ uia 'projects/_RefMat/ReferencedMaterials.uia'
7
+ show app.errors if app.errors?
8
+
9
+ layer = app/'main:Scene.Layer'
10
+ cubemat = layer/"Cube"/"Material"
11
+
12
+ # Ensure that the diffuse attribute is linked and present on multiple slides
13
+ assert cubemat['diffuse'].linked?
14
+ assert cubemat.has_slide?(0)
15
+ assert cubemat.has_slide?(1)
16
+ assert cubemat.has_slide?(2)
17
+ assert cubemat['diffuse',1].r == 0.5
18
+ assert cubemat['diffuse',2].r == 0.5
19
+
20
+ # When we do not unlink, values remain shared
21
+ cubemat['diffuse',1].r = 1
22
+ cubemat['diffuse',2].r = 0.2
23
+ assert cubemat['diffuse',1].r == cubemat['diffuse',2].r
24
+
25
+ # Ensure that we can unlink an attribute and vary the values per slide
26
+ cubemat['diffuse'].unlink
27
+ assert !cubemat['diffuse'].linked?
28
+ cubemat['diffuse',1].r = 1
29
+ cubemat['diffuse',2].r = 0.2
30
+ assert cubemat['diffuse',1].r == 1
31
+ assert cubemat['diffuse',2].r == 0.2
32
+
33
+ # We can swap a material with a referenced material
34
+ model = cubemat.parent
35
+ assert model
36
+ ref = cubemat.replace_with_referenced_material
37
+ assert cubemat.parent.nil? # The old material is removed from the graph
38
+ assert ref.parent==model # The new material is where the old was
39
+ assert ref['id'] == cubemat['id'] # The new material has the same id and name
40
+ assert ref.name == 'Material'
41
+ assert ref['referencedmaterial',0].object.nil? # New referenced materials start out with no reference
42
+ assert ref['referencedmaterial',0].type == :absolute # New references default to absolute
43
+
44
+ ref['referencedmaterial'].unlink
45
+ %w[Sphere Sphere2].each.with_index do |name,s|
46
+ # You can set a reference directly to an object, or alternatively
47
+ # ref['referencedmaterial',1].object = layer/name/"Material"
48
+ ref['referencedmaterial',s+1] = layer/name/"Material"
49
+ ref['referencedmaterial',s+1].type = :path
50
+ end
51
+
52
+ app.save_all!
@@ -1,20 +1,20 @@
1
- metadata 'MetaData.xml' # optional; also may be set via -m flag
2
- # uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
3
- uia 'projects/BMW_Cluster/BMW_Cluster.uia' # required before other commands
4
- show app.errors if app.errors?
5
-
6
- show app.image_usage # hash mapping image paths, relative to uia, to arrays of things referencing them: materials; scxml visual actions; effects;
7
- show app.image_paths # Just the paths
8
- show app.mesh_usage # mapping mesh paths (postfixed with version numbers) to referencing elements
9
- show app.mesh_paths # Just the paths (no version number information)
10
- show app.script_usage # hash mapping lua paths, relative to uia, to arrays of things referencing them: presentation/application behaviors
11
- show app.script_paths # just the paths
12
- show app.material_usage # hash mapping materials paths, relative to uia, to arrays referencing material elements
13
- show app.material_paths # just the paths
14
- show app.font_usage # hash mapping font paths, relative to uia, to arrays of referencing text elements
15
- show app.font_paths # just the paths
16
- show app.effect_usage # hash mapping effect paths, relative to uia, to arrays of referencing effect elements
17
- show app.effect_paths # just the paths
18
-
19
- show app.referenced_paths
20
- show app.unused_files # Remember to check for .uip and .scxml not referenced by .uia
1
+ metadata 'MetaData.xml' # optional; also may be set via -m flag
2
+ # uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
3
+ uia 'projects/BMW_Cluster/BMW_Cluster.uia' # required before other commands
4
+ show app.errors if app.errors?
5
+
6
+ show app.image_usage # hash mapping image paths, relative to uia, to arrays of things referencing them: materials; scxml visual actions; effects;
7
+ show app.image_paths # Just the paths
8
+ show app.mesh_usage # mapping mesh paths (postfixed with version numbers) to referencing elements
9
+ show app.mesh_paths # Just the paths (no version number information)
10
+ show app.script_usage # hash mapping lua paths, relative to uia, to arrays of things referencing them: presentation/application behaviors
11
+ show app.script_paths # just the paths
12
+ show app.material_usage # hash mapping materials paths, relative to uia, to arrays referencing material elements
13
+ show app.material_paths # just the paths
14
+ show app.font_usage # hash mapping font paths, relative to uia, to arrays of referencing text elements
15
+ show app.font_paths # just the paths
16
+ show app.effect_usage # hash mapping effect paths, relative to uia, to arrays of referencing effect elements
17
+ show app.effect_paths # just the paths
18
+
19
+ show app.referenced_paths
20
+ show app.unused_files # Remember to check for .uip and .scxml not referenced by .uia
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RUIC
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Kistner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-16 00:00:00.000000000 Z
11
+ date: 2014-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -77,6 +77,7 @@ executables:
77
77
  extensions: []
78
78
  extra_rdoc_files: []
79
79
  files:
80
+ - .yardopts
80
81
  - LICENSE
81
82
  - README.md
82
83
  - bin/ruic
@@ -193,30 +194,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
194
  version: '0'
194
195
  requirements: []
195
196
  rubyforge_project:
196
- rubygems_version: 2.4.2
197
+ rubygems_version: 2.0.14
197
198
  signing_key:
198
199
  specification_version: 4
199
200
  summary: Library and DSL analyzing and manipulating UI Composer applications and presentations.
200
- test_files:
201
- - test/MetaData-simple.xml
202
- - test/MetaData.xml
203
- - test/customclasses.ruic
204
- - test/filtering.ruic
205
- - test/futureassets.ruic
206
- - test/nonmaster.ruic
207
- - test/paths.ruic
208
- - test/projects/CustomClasses/Brush Strokes.effect
209
- - test/projects/CustomClasses/CustomClasses.uia
210
- - test/projects/CustomClasses/CustomClasses.uip
211
- - test/projects/CustomClasses/FutureAsset.uip
212
- - test/projects/CustomClasses/copper.material
213
- - test/projects/CustomClasses/maps/UV-Checker.png
214
- - test/projects/CustomClasses/maps/effects/brushnoise.dds
215
- - test/projects/CustomClasses/maps/materials/spherical_checker.png
216
- - test/projects/ReferencedMaterials/ReferencedMaterials.uia
217
- - test/projects/ReferencedMaterials/ReferencedMaterials.uip
218
- - test/projects/SimpleScene/SimpleScene.uia
219
- - test/projects/SimpleScene/SimpleScene.uip
220
- - test/properties.ruic
221
- - test/referencematerials.ruic
222
- - test/usage.ruic
201
+ test_files: []
202
+ has_rdoc: