RUIC 0.6.0 → 0.6.1
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/.yardopts +3 -3
- data/HISTORY +110 -86
- data/README.md +220 -220
- data/bin/ruic +61 -61
- data/gui/TODO +2 -2
- data/gui/appattributesmodel.rb +51 -51
- data/gui/appelementsmodel.rb +126 -126
- data/gui/launch.rb +19 -19
- data/gui/makefile +14 -14
- data/gui/resources/style/dark.qss +459 -459
- data/gui/window.rb +90 -90
- data/gui/window.ui +753 -753
- data/lib/ruic.rb +191 -190
- data/lib/ruic/application.rb +25 -3
- data/lib/ruic/assets.rb +441 -436
- data/lib/ruic/attributes.rb +179 -178
- data/lib/ruic/behaviors.rb +0 -0
- data/lib/ruic/effect.rb +31 -31
- data/lib/ruic/interfaces.rb +0 -0
- data/lib/ruic/nicebytes.rb +29 -0
- data/lib/ruic/presentation.rb +6 -3
- data/lib/ruic/renderplugin.rb +17 -17
- data/lib/ruic/ripl.rb +45 -45
- data/lib/ruic/statemachine.rb +6 -0
- data/lib/ruic/version.rb +3 -3
- data/ruic.gemspec +25 -25
- data/test/MetaData-simple.xml +28 -28
- data/test/MetaData.xml +435 -435
- data/test/customclasses.ruic +29 -29
- data/test/filtering.ruic +42 -42
- data/test/futureassets.ruic +7 -7
- data/test/nonmaster.ruic +20 -20
- data/test/paths.ruic +16 -16
- data/test/projects/CustomClasses/CustomClasses.uia +7 -7
- data/test/projects/CustomClasses/CustomClasses.uip +40 -40
- data/test/projects/CustomClasses/FutureAsset.uip +17 -17
- data/test/projects/MissingAssets/Existing.uip +87 -87
- data/test/projects/MissingAssets/MissingAssets.uia +0 -0
- data/test/projects/MissingAssets/MissingAssets.uia-user +14 -14
- data/test/projects/MissingAssets/RoundedPlane-1/RoundedPlane-1.import +18 -18
- data/test/projects/MissingAssets/RoundedPlane-1/meshes/RoundedPlane.mesh +0 -0
- data/test/projects/MissingAssets/effects/effects.txt +0 -0
- data/test/projects/MissingAssets/effects/existing.effect +0 -0
- data/test/projects/MissingAssets/fonts/Arimo-Regular.ttf +0 -0
- data/test/projects/MissingAssets/fonts/Chivo-Black.ttf +0 -0
- data/test/projects/MissingAssets/fonts/OFL.txt +0 -0
- data/test/projects/MissingAssets/maps/effects/brushnoise.dds +0 -0
- data/test/projects/MissingAssets/maps/existing.png +0 -0
- data/test/projects/MissingAssets/maps/maps.txt +0 -0
- data/test/projects/MissingAssets/maps/materials/concrete_plain.png +0 -0
- data/test/projects/MissingAssets/maps/materials/concrete_plain_bump.png +0 -0
- data/test/projects/MissingAssets/maps/materials/spherical_checker.png +0 -0
- data/test/projects/MissingAssets/materials/concrete.material +0 -0
- data/test/projects/MissingAssets/materials/materials.txt +0 -0
- data/test/projects/MissingAssets/scripts/existing1.lua +0 -0
- data/test/projects/MissingAssets/scripts/existing2.lua +0 -0
- data/test/projects/MissingAssets/states/existing.scxml +0 -0
- data/test/projects/MissingAssets/tests/interface-navigation.scxml-test +0 -0
- data/test/projects/Paths/Paths.uia +4 -4
- data/test/projects/Paths/Paths.uip +98 -98
- data/test/projects/SimpleScene/SimpleScene.uia +4 -4
- data/test/projects/SimpleScene/SimpleScene.uip +35 -35
- data/test/properties.ruic +80 -80
- data/test/referencematerials.ruic +50 -50
- data/test/usage.ruic +54 -54
- metadata +5 -54
@@ -1,50 +1,50 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
FileUtils.copy_entry('projects/ReferencedMaterials','projects/_RefMat',false,false,true)
|
3
|
-
|
4
|
-
metadata 'MetaData.xml'
|
5
|
-
uia 'projects/_RefMat/ReferencedMaterials.uia'
|
6
|
-
|
7
|
-
layer = app/'main:Scene.Layer'
|
8
|
-
cubemat = layer/"Cube"/"Material"
|
9
|
-
|
10
|
-
# Ensure that the diffuse attribute is linked and present on multiple slides
|
11
|
-
assert cubemat['diffuse'].linked?
|
12
|
-
assert cubemat.has_slide?(0)
|
13
|
-
assert cubemat.has_slide?(1)
|
14
|
-
assert cubemat.has_slide?(2)
|
15
|
-
assert cubemat['diffuse',1].r == 0.5
|
16
|
-
assert cubemat['diffuse',2].r == 0.5
|
17
|
-
|
18
|
-
# When we do not unlink, values remain shared
|
19
|
-
cubemat['diffuse',1].r = 1
|
20
|
-
cubemat['diffuse',2].r = 0.2
|
21
|
-
assert cubemat['diffuse',1].r == cubemat['diffuse',2].r
|
22
|
-
|
23
|
-
# Ensure that we can unlink an attribute and vary the values per slide
|
24
|
-
cubemat['diffuse'].unlink
|
25
|
-
assert !cubemat['diffuse'].linked?
|
26
|
-
cubemat['diffuse',1].r = 1
|
27
|
-
cubemat['diffuse',2].r = 0.2
|
28
|
-
assert cubemat['diffuse',1].r == 1
|
29
|
-
assert cubemat['diffuse',2].r == 0.2
|
30
|
-
|
31
|
-
# We can swap a material with a referenced material
|
32
|
-
model = cubemat.parent
|
33
|
-
assert model
|
34
|
-
ref = cubemat.replace_with_referenced_material
|
35
|
-
assert cubemat.parent.nil? # The old material is removed from the graph
|
36
|
-
assert ref.parent==model # The new material is where the old was
|
37
|
-
assert ref['id'] == cubemat['id'] # The new material has the same id and name
|
38
|
-
assert ref.name == 'Material'
|
39
|
-
assert ref['referencedmaterial',0].object.nil? # New referenced materials start out with no reference
|
40
|
-
assert ref['referencedmaterial',0].type == :absolute # New references default to absolute
|
41
|
-
|
42
|
-
ref['referencedmaterial'].unlink
|
43
|
-
%w[Sphere Sphere2].each.with_index do |name,s|
|
44
|
-
# You can set a reference directly to an object, or alternatively
|
45
|
-
# ref['referencedmaterial',1].object = layer/name/"Material"
|
46
|
-
ref['referencedmaterial',s+1] = layer/name/"Material"
|
47
|
-
ref['referencedmaterial',s+1].type = :path
|
48
|
-
end
|
49
|
-
|
50
|
-
app.save_all!
|
1
|
+
require 'fileutils'
|
2
|
+
FileUtils.copy_entry('projects/ReferencedMaterials','projects/_RefMat',false,false,true)
|
3
|
+
|
4
|
+
metadata 'MetaData.xml'
|
5
|
+
uia 'projects/_RefMat/ReferencedMaterials.uia'
|
6
|
+
|
7
|
+
layer = app/'main:Scene.Layer'
|
8
|
+
cubemat = layer/"Cube"/"Material"
|
9
|
+
|
10
|
+
# Ensure that the diffuse attribute is linked and present on multiple slides
|
11
|
+
assert cubemat['diffuse'].linked?
|
12
|
+
assert cubemat.has_slide?(0)
|
13
|
+
assert cubemat.has_slide?(1)
|
14
|
+
assert cubemat.has_slide?(2)
|
15
|
+
assert cubemat['diffuse',1].r == 0.5
|
16
|
+
assert cubemat['diffuse',2].r == 0.5
|
17
|
+
|
18
|
+
# When we do not unlink, values remain shared
|
19
|
+
cubemat['diffuse',1].r = 1
|
20
|
+
cubemat['diffuse',2].r = 0.2
|
21
|
+
assert cubemat['diffuse',1].r == cubemat['diffuse',2].r
|
22
|
+
|
23
|
+
# Ensure that we can unlink an attribute and vary the values per slide
|
24
|
+
cubemat['diffuse'].unlink
|
25
|
+
assert !cubemat['diffuse'].linked?
|
26
|
+
cubemat['diffuse',1].r = 1
|
27
|
+
cubemat['diffuse',2].r = 0.2
|
28
|
+
assert cubemat['diffuse',1].r == 1
|
29
|
+
assert cubemat['diffuse',2].r == 0.2
|
30
|
+
|
31
|
+
# We can swap a material with a referenced material
|
32
|
+
model = cubemat.parent
|
33
|
+
assert model
|
34
|
+
ref = cubemat.replace_with_referenced_material
|
35
|
+
assert cubemat.parent.nil? # The old material is removed from the graph
|
36
|
+
assert ref.parent==model # The new material is where the old was
|
37
|
+
assert ref['id'] == cubemat['id'] # The new material has the same id and name
|
38
|
+
assert ref.name == 'Material'
|
39
|
+
assert ref['referencedmaterial',0].object.nil? # New referenced materials start out with no reference
|
40
|
+
assert ref['referencedmaterial',0].type == :absolute # New references default to absolute
|
41
|
+
|
42
|
+
ref['referencedmaterial'].unlink
|
43
|
+
%w[Sphere Sphere2].each.with_index do |name,s|
|
44
|
+
# You can set a reference directly to an object, or alternatively
|
45
|
+
# ref['referencedmaterial',1].object = layer/name/"Material"
|
46
|
+
ref['referencedmaterial',s+1] = layer/name/"Material"
|
47
|
+
ref['referencedmaterial',s+1].type = :path
|
48
|
+
end
|
49
|
+
|
50
|
+
app.save_all!
|
data/test/usage.ruic
CHANGED
@@ -1,54 +1,54 @@
|
|
1
|
-
metadata 'MetaData.xml'
|
2
|
-
uia 'projects/MissingAssets/MissingAssets.uia'
|
3
|
-
|
4
|
-
missing = app.missing_files.map(&app.method(:relative_path))
|
5
|
-
show missing
|
6
|
-
%w[
|
7
|
-
Missing.uip
|
8
|
-
maps/missing.png
|
9
|
-
maps/missing2.png
|
10
|
-
maps/missing3.png
|
11
|
-
materials/missing.material
|
12
|
-
effects/missing.effect
|
13
|
-
scripts/missing1.lua
|
14
|
-
scripts/missing2.lua
|
15
|
-
scripts/missing.so
|
16
|
-
states/missing.scxml
|
17
|
-
].each{ |path| warn "File '#{path}' should be reported as missing, but it is not." unless missing.include?(path) }
|
18
|
-
|
19
|
-
unused = app.unused_files.map(&app.method(:relative_path))
|
20
|
-
show "Unused"
|
21
|
-
show unused
|
22
|
-
%w[
|
23
|
-
MissingAssets.uia
|
24
|
-
Existing.uip
|
25
|
-
scripts/existing1.lua
|
26
|
-
scripts/existing2.lua
|
27
|
-
states/existing.scxml
|
28
|
-
maps/existing.png
|
29
|
-
maps/existing2.png
|
30
|
-
].each{ |path| warn "File '#{path}' should be reported as used, but it is not." if unused.include?(path) }
|
31
|
-
|
32
|
-
assert !missing.include?("maps/existing.png")
|
33
|
-
|
34
|
-
exit
|
35
|
-
|
36
|
-
unused = app.unused_files
|
37
|
-
|
38
|
-
assert unused.grep
|
39
|
-
|
40
|
-
show app.image_usage # hash mapping image paths, relative to uia, to arrays of things referencing them: materials; scxml visual actions; effects;
|
41
|
-
show app.image_paths # Just the paths
|
42
|
-
show app.mesh_usage # mapping mesh paths (postfixed with version numbers) to referencing elements
|
43
|
-
show app.mesh_paths # Just the paths (no version number information)
|
44
|
-
show app.script_usage # hash mapping lua paths, relative to uia, to arrays of things referencing them: presentation/application behaviors
|
45
|
-
show app.script_paths # just the paths
|
46
|
-
show app.material_usage # hash mapping materials paths, relative to uia, to arrays referencing material elements
|
47
|
-
show app.material_paths # just the paths
|
48
|
-
show app.font_usage # hash mapping font paths, relative to uia, to arrays of referencing text elements
|
49
|
-
show app.font_paths # just the paths
|
50
|
-
show app.effect_usage # hash mapping effect paths, relative to uia, to arrays of referencing effect elements
|
51
|
-
show app.effect_paths # just the paths
|
52
|
-
|
53
|
-
show app.referenced_paths
|
54
|
-
show app.unused_files # Remember to check for .uip and .scxml not referenced by .uia
|
1
|
+
metadata 'MetaData.xml'
|
2
|
+
uia 'projects/MissingAssets/MissingAssets.uia'
|
3
|
+
|
4
|
+
missing = app.missing_files.map(&app.method(:relative_path))
|
5
|
+
show missing
|
6
|
+
%w[
|
7
|
+
Missing.uip
|
8
|
+
maps/missing.png
|
9
|
+
maps/missing2.png
|
10
|
+
maps/missing3.png
|
11
|
+
materials/missing.material
|
12
|
+
effects/missing.effect
|
13
|
+
scripts/missing1.lua
|
14
|
+
scripts/missing2.lua
|
15
|
+
scripts/missing.so
|
16
|
+
states/missing.scxml
|
17
|
+
].each{ |path| warn "File '#{path}' should be reported as missing, but it is not." unless missing.include?(path) }
|
18
|
+
|
19
|
+
unused = app.unused_files.map(&app.method(:relative_path))
|
20
|
+
show "Unused"
|
21
|
+
show unused
|
22
|
+
%w[
|
23
|
+
MissingAssets.uia
|
24
|
+
Existing.uip
|
25
|
+
scripts/existing1.lua
|
26
|
+
scripts/existing2.lua
|
27
|
+
states/existing.scxml
|
28
|
+
maps/existing.png
|
29
|
+
maps/existing2.png
|
30
|
+
].each{ |path| warn "File '#{path}' should be reported as used, but it is not." if unused.include?(path) }
|
31
|
+
|
32
|
+
assert !missing.include?("maps/existing.png")
|
33
|
+
|
34
|
+
exit
|
35
|
+
|
36
|
+
unused = app.unused_files
|
37
|
+
|
38
|
+
assert unused.grep
|
39
|
+
|
40
|
+
show app.image_usage # hash mapping image paths, relative to uia, to arrays of things referencing them: materials; scxml visual actions; effects;
|
41
|
+
show app.image_paths # Just the paths
|
42
|
+
show app.mesh_usage # mapping mesh paths (postfixed with version numbers) to referencing elements
|
43
|
+
show app.mesh_paths # Just the paths (no version number information)
|
44
|
+
show app.script_usage # hash mapping lua paths, relative to uia, to arrays of things referencing them: presentation/application behaviors
|
45
|
+
show app.script_paths # just the paths
|
46
|
+
show app.material_usage # hash mapping materials paths, relative to uia, to arrays referencing material elements
|
47
|
+
show app.material_paths # just the paths
|
48
|
+
show app.font_usage # hash mapping font paths, relative to uia, to arrays of referencing text elements
|
49
|
+
show app.font_paths # just the paths
|
50
|
+
show app.effect_usage # hash mapping effect paths, relative to uia, to arrays of referencing effect elements
|
51
|
+
show app.effect_paths # just the paths
|
52
|
+
|
53
|
+
show app.referenced_paths
|
54
|
+
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.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Kistner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- lib/ruic/behaviors.rb
|
150
150
|
- lib/ruic/effect.rb
|
151
151
|
- lib/ruic/interfaces.rb
|
152
|
+
- lib/ruic/nicebytes.rb
|
152
153
|
- lib/ruic/presentation.rb
|
153
154
|
- lib/ruic/renderplugin.rb
|
154
155
|
- lib/ruic/ripl.rb
|
@@ -225,59 +226,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
226
|
version: '0'
|
226
227
|
requirements: []
|
227
228
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.4.
|
229
|
+
rubygems_version: 2.4.5
|
229
230
|
signing_key:
|
230
231
|
specification_version: 4
|
231
232
|
summary: Library and DSL analyzing and manipulating UI Composer applications and presentations.
|
232
|
-
test_files:
|
233
|
-
- test/MetaData-simple.xml
|
234
|
-
- test/MetaData.xml
|
235
|
-
- test/customclasses.ruic
|
236
|
-
- test/filtering.ruic
|
237
|
-
- test/futureassets.ruic
|
238
|
-
- test/nonmaster.ruic
|
239
|
-
- test/paths.ruic
|
240
|
-
- test/projects/CustomClasses/Brush Strokes.effect
|
241
|
-
- test/projects/CustomClasses/CustomClasses.uia
|
242
|
-
- test/projects/CustomClasses/CustomClasses.uip
|
243
|
-
- test/projects/CustomClasses/FutureAsset.uip
|
244
|
-
- test/projects/CustomClasses/copper.material
|
245
|
-
- test/projects/CustomClasses/maps/UV-Checker.png
|
246
|
-
- test/projects/CustomClasses/maps/effects/brushnoise.dds
|
247
|
-
- test/projects/CustomClasses/maps/materials/spherical_checker.png
|
248
|
-
- test/projects/CustomClasses/scripts/DataDrivenTime.lua
|
249
|
-
- test/projects/CustomClasses/scripts/TimeDrivenAttribute.lua
|
250
|
-
- test/projects/MissingAssets/Existing.uip
|
251
|
-
- test/projects/MissingAssets/MissingAssets.uia
|
252
|
-
- test/projects/MissingAssets/MissingAssets.uia-user
|
253
|
-
- test/projects/MissingAssets/RoundedPlane-1/RoundedPlane-1.import
|
254
|
-
- test/projects/MissingAssets/RoundedPlane-1/meshes/RoundedPlane.mesh
|
255
|
-
- test/projects/MissingAssets/effects/effects.txt
|
256
|
-
- test/projects/MissingAssets/effects/existing.effect
|
257
|
-
- test/projects/MissingAssets/fonts/Arimo-Regular.ttf
|
258
|
-
- test/projects/MissingAssets/fonts/Chivo-Black.ttf
|
259
|
-
- test/projects/MissingAssets/fonts/OFL.txt
|
260
|
-
- test/projects/MissingAssets/maps/effects/brushnoise.dds
|
261
|
-
- test/projects/MissingAssets/maps/existing.png
|
262
|
-
- test/projects/MissingAssets/maps/existing2.png
|
263
|
-
- test/projects/MissingAssets/maps/maps.txt
|
264
|
-
- test/projects/MissingAssets/maps/materials/concrete_plain.png
|
265
|
-
- test/projects/MissingAssets/maps/materials/concrete_plain_bump.png
|
266
|
-
- test/projects/MissingAssets/maps/materials/spherical_checker.png
|
267
|
-
- test/projects/MissingAssets/maps/unused.png
|
268
|
-
- test/projects/MissingAssets/materials/concrete.material
|
269
|
-
- test/projects/MissingAssets/materials/materials.txt
|
270
|
-
- test/projects/MissingAssets/scripts/existing1.lua
|
271
|
-
- test/projects/MissingAssets/scripts/existing2.lua
|
272
|
-
- test/projects/MissingAssets/states/existing.scxml
|
273
|
-
- test/projects/MissingAssets/tests/interface-navigation.scxml-test
|
274
|
-
- test/projects/Paths/Paths.uia
|
275
|
-
- test/projects/Paths/Paths.uip
|
276
|
-
- test/projects/ReferencedMaterials/ReferencedMaterials.uia
|
277
|
-
- test/projects/ReferencedMaterials/ReferencedMaterials.uip
|
278
|
-
- test/projects/SimpleScene/SimpleScene.uia
|
279
|
-
- test/projects/SimpleScene/SimpleScene.uip
|
280
|
-
- test/properties.ruic
|
281
|
-
- test/referencematerials.ruic
|
282
|
-
- test/usage.ruic
|
233
|
+
test_files: []
|
283
234
|
has_rdoc:
|