RUIC 0.4.4 → 0.4.5

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,35 +1,35 @@
1
- <?xml version="1.0" encoding="UTF-8" ?>
2
- <UIP version="3">
3
- <Project>
4
- <ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False"/>
5
- <Graph>
6
- <Scene id="Scene">
7
- <Layer id="Layer">
8
- <Camera id="Camera"/>
9
- <Light id="Light"/>
10
- <Model id="Sphere"><Material id="Material"/></Model>
11
- <Model id="Sphere2"><Material id="Material_001"/></Model>
12
- <Model id="Cube"><Material id="Material_002"/></Model>
13
- <Model id="Sphere3"><Material id="Material_003"/></Model>
14
- </Layer>
15
- </Scene>
16
- </Graph>
17
- <Logic>
18
- <State name="Master Slide" component="#Scene">
19
- <Add ref="#Layer"/>
20
- <Add ref="#Camera"/>
21
- <Add ref="#Light"/>
22
- <Add ref="#Sphere" name="Sphere1" position="-150 60 0" sourcepath="#Sphere"/>
23
- <Add ref="#Material" diffuse="0 0.752941 0"/>
24
- <Add ref="#Sphere2" name="Sphere2" position="150 60.0004 0" sourcepath="#Sphere"/>
25
- <Add ref="#Material_001" diffuse="0 0.75287 0"/>
26
- <Add ref="#Cube" name="Cube" position="0 60 0" rotation="-30 60 -20" sourcepath="#Cube"/>
27
- <Add ref="#Material_002" name="Material" diffuse="0.5 0 0"/>
28
- <State id="Scene-Slide1" name="Slide1">
29
- <Add ref="#Sphere3" name="NonMaster" position="-150 60 0" sourcepath="#Sphere"/>
30
- <Add ref="#Material_003" diffuse="0 0.752941 0"/>
31
- </State>
32
- </State>
33
- </Logic>
34
- </Project>
35
- </UIP>
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <UIP version="3">
3
+ <Project>
4
+ <ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False"/>
5
+ <Graph>
6
+ <Scene id="Scene">
7
+ <Layer id="Layer">
8
+ <Camera id="Camera"/>
9
+ <Light id="Light"/>
10
+ <Model id="Sphere"><Material id="Material"/></Model>
11
+ <Model id="Sphere2"><Material id="Material_001"/></Model>
12
+ <Model id="Cube"><Material id="Material_002"/></Model>
13
+ <Model id="Sphere3"><Material id="Material_003"/></Model>
14
+ </Layer>
15
+ </Scene>
16
+ </Graph>
17
+ <Logic>
18
+ <State name="Master Slide" component="#Scene">
19
+ <Add ref="#Layer"/>
20
+ <Add ref="#Camera"/>
21
+ <Add ref="#Light"/>
22
+ <Add ref="#Sphere" name="Sphere1" position="-150 60 0" sourcepath="#Sphere"/>
23
+ <Add ref="#Material" diffuse="0 0.752941 0"/>
24
+ <Add ref="#Sphere2" name="Sphere2" position="150 60.0004 0" sourcepath="#Sphere"/>
25
+ <Add ref="#Material_001" diffuse="0 0.75287 0"/>
26
+ <Add ref="#Cube" name="Cube" position="0 60 0" rotation="-30 60 -20" sourcepath="#Cube"/>
27
+ <Add ref="#Material_002" name="Material" diffuse="0.5 0 0"/>
28
+ <State id="Scene-Slide1" name="Slide1">
29
+ <Add ref="#Sphere3" name="NonMaster" position="-150 60 0" sourcepath="#Sphere"/>
30
+ <Add ref="#Material_003" diffuse="0 0.752941 0"/>
31
+ </State>
32
+ </State>
33
+ </Logic>
34
+ </Project>
35
+ </UIP>
@@ -1,82 +1,82 @@
1
- #!/usr/bin/env ruic
2
- metadata 'MetaData.xml' # optional; also may be set via -m flag
3
- uia 'projects/BMW_Cluster/BMW_Cluster.uia' # required before other commands
4
-
5
- show "Uh oh!", app.errors if app.errors?
6
-
7
- assert app.filename == 'BMW_Cluster.uia'
8
- assert app.assets.length==10, "There should be 10 assets"
9
- assert app.behaviors.length==3
10
- assert app.presentations.length==6
11
-
12
- assert app['#logic']
13
- assert app['#logic'].datamodel=='{output=output}'
14
- assert app['#logic']==app['states/logic.scxml']
15
- assert app['#logic']==app['./states/logic.scxml']
16
- assert app['#logic']==app['../BMW_Cluster/states/logic.scxml']
17
-
18
- main = app['#main'] # Look up a presentation by asset id
19
- assert main == app.main_presentation # …or ask for the main rendered presentation
20
- assert main == app.main # …also available as a shortcut name
21
- assert main.filename == 'BMW_Cluster.uip' # You can also ask for the full path via .file
22
- assert main == app['BMW_Cluster.uip'] # Look up a presentation by asset id
23
-
24
- assert !app['beejonkers'] # If an asset id doesn't exist, you'll get nil
25
-
26
- scene = app/'main:Scene'
27
- assert scene
28
- assert scene==main.scene
29
- assert scene.type == 'Scene'
30
- assert scene.name == 'Scene'
31
- assert scene['name'].value == 'Scene'
32
-
33
- # Find an element based on path, prefixed with asset id
34
- sm = app/'main:Scene.ClassicContent.ClassicContent.SimpleMedia'
35
- assert sm.name == 'SimpleMedia'
36
- assert sm.type == 'Model'
37
- assert sm.path == 'main:Scene.ClassicContent.ClassicContent.SimpleMedia'
38
-
39
- assert sm==main/'Scene.ClassicContent.ClassicContent.SimpleMedia'
40
-
41
- assert sm.component == (main/'Scene.ClassicContent.ClassicContent')
42
- assert sm.component.slides.length==2
43
- assert sm.component.slides[0].name == 'Master Slide'
44
- assert sm.component.slides[0].index == 0
45
- assert sm.component.slides[2].name == 'CarStatus'
46
- assert sm.component.slides[2].index == 2
47
- assert sm.component.slides['CarStatus'].name == 'CarStatus'
48
- assert sm.component.slides['CarStatus'] == sm.component.slides[2]
49
-
50
- assert sm['endtime',0]==250
51
- assert sm['endtime',1]==500
52
- assert sm['endtime','SimpleMedia']==500
53
- assert sm['endtime','CarStatus' ]==250
54
- assert sm['endtime',99].nil?
55
-
56
- assert sm['position'].linked?
57
- assert !sm['endtime'].linked?
58
- assert sm['endtime'].values == [250,500,250]
59
- assert sm['endtime'].value == 250
60
-
61
- assert sm['endtime',1]==500
62
- assert sm['endtime','SimpleMedia']==500
63
- assert sm['endtime','CarStatus' ]==250
64
-
65
- sm['endtime','CarStatus'] = 750
66
- assert sm['endtime','SimpleMedia']==500
67
- assert sm['endtime','CarStatus' ]==750
68
-
69
- sm['endtime'] = 100
70
- assert sm['endtime',0]==100
71
- assert sm['endtime',1]==100
72
- assert sm['endtime',2]==100
73
-
74
- assert sm['position',0].x==0
75
- assert sm['scale',0].y == 2.88
76
-
77
- sm['position',0].x=42
78
- assert sm['position',0].x==42
79
-
80
- sm['position',0].y=17
81
- assert sm['position',0].y==17
82
- assert sm['position',0].x==42
1
+ #!/usr/bin/env ruic
2
+ metadata 'MetaData.xml' # optional; also may be set via -m flag
3
+ uia 'projects/BMW_Cluster/BMW_Cluster.uia' # required before other commands
4
+
5
+ show "Uh oh!", app.errors if app.errors?
6
+
7
+ assert app.filename == 'BMW_Cluster.uia'
8
+ assert app.assets.length==10, "There should be 10 assets"
9
+ assert app.behaviors.length==3
10
+ assert app.presentations.length==6
11
+
12
+ assert app['#logic']
13
+ assert app['#logic'].datamodel=='{output=output}'
14
+ assert app['#logic']==app['states/logic.scxml']
15
+ assert app['#logic']==app['./states/logic.scxml']
16
+ assert app['#logic']==app['../BMW_Cluster/states/logic.scxml']
17
+
18
+ main = app['#main'] # Look up a presentation by asset id
19
+ assert main == app.main_presentation # …or ask for the main rendered presentation
20
+ assert main == app.main # …also available as a shortcut name
21
+ assert main.filename == 'BMW_Cluster.uip' # You can also ask for the full path via .file
22
+ assert main == app['BMW_Cluster.uip'] # Look up a presentation by asset id
23
+
24
+ assert !app['beejonkers'] # If an asset id doesn't exist, you'll get nil
25
+
26
+ scene = app/'main:Scene'
27
+ assert scene
28
+ assert scene==main.scene
29
+ assert scene.type == 'Scene'
30
+ assert scene.name == 'Scene'
31
+ assert scene['name'].value == 'Scene'
32
+
33
+ # Find an element based on path, prefixed with asset id
34
+ sm = app/'main:Scene.ClassicContent.ClassicContent.SimpleMedia'
35
+ assert sm.name == 'SimpleMedia'
36
+ assert sm.type == 'Model'
37
+ assert sm.path == 'main:Scene.ClassicContent.ClassicContent.SimpleMedia'
38
+
39
+ assert sm==main/'Scene.ClassicContent.ClassicContent.SimpleMedia'
40
+
41
+ assert sm.component == (main/'Scene.ClassicContent.ClassicContent')
42
+ assert sm.component.slides.length==2
43
+ assert sm.component.slides[0].name == 'Master Slide'
44
+ assert sm.component.slides[0].index == 0
45
+ assert sm.component.slides[2].name == 'CarStatus'
46
+ assert sm.component.slides[2].index == 2
47
+ assert sm.component.slides['CarStatus'].name == 'CarStatus'
48
+ assert sm.component.slides['CarStatus'] == sm.component.slides[2]
49
+
50
+ assert sm['endtime',0]==250
51
+ assert sm['endtime',1]==500
52
+ assert sm['endtime','SimpleMedia']==500
53
+ assert sm['endtime','CarStatus' ]==250
54
+ assert sm['endtime',99].nil?
55
+
56
+ assert sm['position'].linked?
57
+ assert !sm['endtime'].linked?
58
+ assert sm['endtime'].values == [250,500,250]
59
+ assert sm['endtime'].value == 250
60
+
61
+ assert sm['endtime',1]==500
62
+ assert sm['endtime','SimpleMedia']==500
63
+ assert sm['endtime','CarStatus' ]==250
64
+
65
+ sm['endtime','CarStatus'] = 750
66
+ assert sm['endtime','SimpleMedia']==500
67
+ assert sm['endtime','CarStatus' ]==750
68
+
69
+ sm['endtime'] = 100
70
+ assert sm['endtime',0]==100
71
+ assert sm['endtime',1]==100
72
+ assert sm['endtime',2]==100
73
+
74
+ assert sm['position',0].x==0
75
+ assert sm['scale',0].y == 2.88
76
+
77
+ sm['position',0].x=42
78
+ assert sm['position',0].x==42
79
+
80
+ sm['position',0].y=17
81
+ assert sm['position',0].y==17
82
+ assert sm['position',0].x==42
@@ -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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RUIC
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Kistner
@@ -78,6 +78,7 @@ extensions: []
78
78
  extra_rdoc_files: []
79
79
  files:
80
80
  - .yardopts
81
+ - HISTORY
81
82
  - LICENSE
82
83
  - README.md
83
84
  - bin/ruic
@@ -196,33 +197,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
197
  version: '0'
197
198
  requirements: []
198
199
  rubyforge_project:
199
- rubygems_version: 2.4.2
200
+ rubygems_version: 2.0.14
200
201
  signing_key:
201
202
  specification_version: 4
202
203
  summary: Library and DSL analyzing and manipulating UI Composer applications and presentations.
203
- test_files:
204
- - test/MetaData-simple.xml
205
- - test/MetaData.xml
206
- - test/customclasses.ruic
207
- - test/filtering.ruic
208
- - test/futureassets.ruic
209
- - test/nonmaster.ruic
210
- - test/paths.ruic
211
- - test/projects/CustomClasses/Brush Strokes.effect
212
- - test/projects/CustomClasses/CustomClasses.uia
213
- - test/projects/CustomClasses/CustomClasses.uip
214
- - test/projects/CustomClasses/FutureAsset.uip
215
- - test/projects/CustomClasses/copper.material
216
- - test/projects/CustomClasses/maps/UV-Checker.png
217
- - test/projects/CustomClasses/maps/effects/brushnoise.dds
218
- - test/projects/CustomClasses/maps/materials/spherical_checker.png
219
- - test/projects/Paths/Paths.uia
220
- - test/projects/Paths/Paths.uip
221
- - test/projects/ReferencedMaterials/ReferencedMaterials.uia
222
- - test/projects/ReferencedMaterials/ReferencedMaterials.uip
223
- - test/projects/SimpleScene/SimpleScene.uia
224
- - test/projects/SimpleScene/SimpleScene.uip
225
- - test/properties.ruic
226
- - test/referencematerials.ruic
227
- - test/usage.ruic
204
+ test_files: []
228
205
  has_rdoc: