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.
- checksums.yaml +4 -4
- data/.yardopts +3 -3
- data/HISTORY +52 -0
- data/README.md +219 -278
- data/bin/ruic +0 -0
- 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 +175 -175
- data/lib/ruic/application.rb +0 -0
- data/lib/ruic/assets.rb +421 -421
- data/lib/ruic/attributes.rb +165 -165
- data/lib/ruic/behaviors.rb +0 -0
- data/lib/ruic/interfaces.rb +0 -0
- data/lib/ruic/presentation.rb +0 -0
- data/lib/ruic/ripl-after-result.rb +24 -24
- data/lib/ruic/statemachine.rb +0 -0
- data/lib/ruic/version.rb +2 -2
- data/ruic.gemspec +25 -25
- data/test/MetaData-simple.xml +28 -28
- data/test/MetaData.xml +435 -435
- data/test/customclasses.ruic +21 -21
- data/test/filtering.ruic +43 -43
- data/test/futureassets.ruic +8 -8
- data/test/nonmaster.ruic +0 -0
- data/test/paths.ruic +18 -18
- data/test/projects/CustomClasses/CustomClasses.uia +7 -7
- data/test/projects/CustomClasses/FutureAsset.uip +17 -17
- 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 +82 -82
- data/test/referencematerials.ruic +52 -52
- data/test/usage.ruic +20 -20
- metadata +4 -27
    
        data/lib/ruic/attributes.rb
    CHANGED
    
    | @@ -1,165 +1,165 @@ | |
| 1 | 
            -
            #encoding: utf-8
         | 
| 2 | 
            -
            class UIC::Property
         | 
| 3 | 
            -
            	class << self; attr_accessor :default; end
         | 
| 4 | 
            -
            	def initialize(el); @el = el; end
         | 
| 5 | 
            -
            	def name; @name||=@el['name']; end
         | 
| 6 | 
            -
            	def type; @type||=@el['type']; end
         | 
| 7 | 
            -
            	def formal; @formal||=@el['formalName'] || @el['name']; end
         | 
| 8 | 
            -
            	def min; @el['min']; end
         | 
| 9 | 
            -
            	def max; @el['max']; end
         | 
| 10 | 
            -
            	def description; @desc||=@el['description']; end
         | 
| 11 | 
            -
            	def default; @def ||= (@el['default'] || self.class.default); end
         | 
| 12 | 
            -
            	def get(asset,slide)
         | 
| 13 | 
            -
            		if asset.slide? || asset.has_slide?(slide)
         | 
| 14 | 
            -
            			asset.presentation.get_attribute(asset,name,slide) || default
         | 
| 15 | 
            -
            		end
         | 
| 16 | 
            -
            	end
         | 
| 17 | 
            -
            	def set(asset,new_value,slide_name_or_index)
         | 
| 18 | 
            -
            		asset.presentation.set_attribute(asset,name,slide_name_or_index,new_value)
         | 
| 19 | 
            -
            	end
         | 
| 20 | 
            -
            	def inspect
         | 
| 21 | 
            -
            		"<#{type} '#{name}'>"
         | 
| 22 | 
            -
            	end
         | 
| 23 | 
            -
             | 
| 24 | 
            -
            	class String < self
         | 
| 25 | 
            -
            		self.default = ''
         | 
| 26 | 
            -
            	end
         | 
| 27 | 
            -
            	MultiLineString = String
         | 
| 28 | 
            -
             | 
| 29 | 
            -
            	class Float < self
         | 
| 30 | 
            -
            		self.default = 0.0
         | 
| 31 | 
            -
            		def get(asset,slide); super.to_f; end
         | 
| 32 | 
            -
            	end
         | 
| 33 | 
            -
            	class Long < self
         | 
| 34 | 
            -
            		self.default = 0
         | 
| 35 | 
            -
            		def get(asset,slide); super.to_i; end
         | 
| 36 | 
            -
            	end
         | 
| 37 | 
            -
            	class Boolean < self
         | 
| 38 | 
            -
            		self.default = false
         | 
| 39 | 
            -
            		def get(asset,slide); super=='True'; end
         | 
| 40 | 
            -
            		def set(asset,new_value,slide_name_or_index)
         | 
| 41 | 
            -
            			super( asset, new_value ? 'True' : 'False', slide_name_or_index )
         | 
| 42 | 
            -
            		end
         | 
| 43 | 
            -
            	end
         | 
| 44 | 
            -
            	class Vector < self
         | 
| 45 | 
            -
            		self.default = '0 0 0'
         | 
| 46 | 
            -
            		def get(asset,slide)
         | 
| 47 | 
            -
            			VectorValue.new(asset,self,slide,super)
         | 
| 48 | 
            -
            		end
         | 
| 49 | 
            -
            		def set(asset,new_value,slide_name_or_index)
         | 
| 50 | 
            -
            			new_value = new_value.join(' ') if new_value.is_a?(Array)
         | 
| 51 | 
            -
            			super( asset, new_value, slide_name_or_index )
         | 
| 52 | 
            -
            		end
         | 
| 53 | 
            -
            	end
         | 
| 54 | 
            -
            	Rotation = Vector
         | 
| 55 | 
            -
            	Color    = Vector
         | 
| 56 | 
            -
            	Float2   = Vector
         | 
| 57 | 
            -
            	class Image < self
         | 
| 58 | 
            -
            		self.default = nil
         | 
| 59 | 
            -
            		def get(asset,slide)
         | 
| 60 | 
            -
            			if idref = super
         | 
| 61 | 
            -
            				result = asset.presentation.asset_by_id( idref[1..-1] )
         | 
| 62 | 
            -
            				slide ? result.on_slide( slide ) : result
         | 
| 63 | 
            -
            			end
         | 
| 64 | 
            -
            		end
         | 
| 65 | 
            -
            		def set(asset,new_value,slide)
         | 
| 66 | 
            -
            			raise "Setting image attributes not yet supported"
         | 
| 67 | 
            -
            		end
         | 
| 68 | 
            -
            	end
         | 
| 69 | 
            -
            	class Texture < String
         | 
| 70 | 
            -
            		def get(asset,slide)
         | 
| 71 | 
            -
            			if path=super
         | 
| 72 | 
            -
            				path.empty? ? nil : path.gsub( '\\', '/' ).sub( /^.\// ,'' )
         | 
| 73 | 
            -
            			end
         | 
| 74 | 
            -
            		end
         | 
| 75 | 
            -
            	end
         | 
| 76 | 
            -
             | 
| 77 | 
            -
            	class ObjectRef < self
         | 
| 78 | 
            -
            		self.default = nil
         | 
| 79 | 
            -
            		def get(asset,slide)
         | 
| 80 | 
            -
            			ref  = super
         | 
| 81 | 
            -
            			type = :absolute
         | 
| 82 | 
            -
            			obj  = nil
         | 
| 83 | 
            -
            			unless ref=='' || ref.nil?
         | 
| 84 | 
            -
            				type = ref[0]=='#' ? :absolute : :path
         | 
| 85 | 
            -
            				ref = type==:absolute ? asset.presentation.asset_by_id( ref[1..-1] ) : asset.presentation.at( ref, asset )
         | 
| 86 | 
            -
            			end
         | 
| 87 | 
            -
            			ObjectReference.new(asset,self,slide,ref,type)
         | 
| 88 | 
            -
            		end
         | 
| 89 | 
            -
            		def set(asset,new_object,slide)
         | 
| 90 | 
            -
            			get(asset,slide).object = new_object
         | 
| 91 | 
            -
            		end
         | 
| 92 | 
            -
            	end
         | 
| 93 | 
            -
             | 
| 94 | 
            -
            	class ObjectReference
         | 
| 95 | 
            -
            		attr_reader :object, :type
         | 
| 96 | 
            -
            		def initialize(asset,property,slide,object=nil,type=nil)
         | 
| 97 | 
            -
            			@asset    = asset
         | 
| 98 | 
            -
            			@name     = property.name
         | 
| 99 | 
            -
            			@slide    = slide
         | 
| 100 | 
            -
            			@object   = object
         | 
| 101 | 
            -
            			@type     = type
         | 
| 102 | 
            -
            		end
         | 
| 103 | 
            -
            		def object=(new_object)
         | 
| 104 | 
            -
            			raise "ObjectRef must be set to an asset (not a #{new_object.class.name})" unless new_object.is_a?(UIC::MetaData::AssetBase)
         | 
| 105 | 
            -
            			@object = new_object
         | 
| 106 | 
            -
            			write_value!
         | 
| 107 | 
            -
            		end
         | 
| 108 | 
            -
            		def type=(new_type)
         | 
| 109 | 
            -
            			raise "ObjectRef types must be either :absolute or :path (not #{new_type.inspect})" unless [:absolute,:path].include?(new_type)
         | 
| 110 | 
            -
            			@type = new_type
         | 
| 111 | 
            -
            			write_value!
         | 
| 112 | 
            -
            		end
         | 
| 113 | 
            -
            		private
         | 
| 114 | 
            -
            		def write_value!
         | 
| 115 | 
            -
            			path = case @object
         | 
| 116 | 
            -
            				when NilClass then ""
         | 
| 117 | 
            -
            				else case @type
         | 
| 118 | 
            -
            					when :absolute then "##{@object.el['id']}"
         | 
| 119 | 
            -
            					when :path     then @asset.presentation.path_to( @object, @asset ).sub(/^[^:.]+:/,'')
         | 
| 120 | 
            -
            					# when :root     then @asset.presentation.path_to( @object ).sub(/^[^:.]+:/,'')
         | 
| 121 | 
            -
            				end
         | 
| 122 | 
            -
            			end
         | 
| 123 | 
            -
            			@asset.presentation.set_attribute( @asset, @name, @slide, path )
         | 
| 124 | 
            -
            		end
         | 
| 125 | 
            -
            	end
         | 
| 126 | 
            -
             | 
| 127 | 
            -
            	Import     = String #TODO: a real class
         | 
| 128 | 
            -
            	Mesh       = String #TODO: a real class
         | 
| 129 | 
            -
            	Renderable = String #TODO: a real class
         | 
| 130 | 
            -
            	Font       = String #TODO: a real class
         | 
| 131 | 
            -
            	FontSize   = Long
         | 
| 132 | 
            -
             | 
| 133 | 
            -
            	StringListOrInt = String #TODO: a real class
         | 
| 134 | 
            -
             | 
| 135 | 
            -
            	class VectorValue
         | 
| 136 | 
            -
            		attr_reader :x, :y, :z
         | 
| 137 | 
            -
            		def initialize(asset,property,slide,str)
         | 
| 138 | 
            -
            			@asset    = asset
         | 
| 139 | 
            -
            			@property = property
         | 
| 140 | 
            -
            			@slide    = slide
         | 
| 141 | 
            -
            			@x, @y, @z = str.split(/\s+/).map(&:to_f)
         | 
| 142 | 
            -
            		end
         | 
| 143 | 
            -
            		def setall
         | 
| 144 | 
            -
            			@property.set( @asset, to_s, @slide )
         | 
| 145 | 
            -
            		end
         | 
| 146 | 
            -
            		def x=(n); @x=n; setall end
         | 
| 147 | 
            -
            		def y=(n); @y=n; setall end
         | 
| 148 | 
            -
            		def z=(n); @z=n; setall end
         | 
| 149 | 
            -
            		alias_method :r, :x
         | 
| 150 | 
            -
            		alias_method :g, :y
         | 
| 151 | 
            -
            		alias_method :b, :z
         | 
| 152 | 
            -
            		alias_method :r=, :x=
         | 
| 153 | 
            -
            		alias_method :g=, :y=
         | 
| 154 | 
            -
            		alias_method :b=, :z=
         | 
| 155 | 
            -
            		def inspect
         | 
| 156 | 
            -
            			"<#{@asset.path}.#{@property.name}: #{self}>"
         | 
| 157 | 
            -
            		end
         | 
| 158 | 
            -
            		def to_s
         | 
| 159 | 
            -
            			to_a.join(' ')
         | 
| 160 | 
            -
            		end
         | 
| 161 | 
            -
            		def to_a
         | 
| 162 | 
            -
            			[x,y,z]
         | 
| 163 | 
            -
            		end
         | 
| 164 | 
            -
            	end
         | 
| 165 | 
            -
            end
         | 
| 1 | 
            +
            #encoding: utf-8
         | 
| 2 | 
            +
            class UIC::Property
         | 
| 3 | 
            +
            	class << self; attr_accessor :default; end
         | 
| 4 | 
            +
            	def initialize(el); @el = el; end
         | 
| 5 | 
            +
            	def name; @name||=@el['name']; end
         | 
| 6 | 
            +
            	def type; @type||=@el['type']; end
         | 
| 7 | 
            +
            	def formal; @formal||=@el['formalName'] || @el['name']; end
         | 
| 8 | 
            +
            	def min; @el['min']; end
         | 
| 9 | 
            +
            	def max; @el['max']; end
         | 
| 10 | 
            +
            	def description; @desc||=@el['description']; end
         | 
| 11 | 
            +
            	def default; @def ||= (@el['default'] || self.class.default); end
         | 
| 12 | 
            +
            	def get(asset,slide)
         | 
| 13 | 
            +
            		if asset.slide? || asset.has_slide?(slide)
         | 
| 14 | 
            +
            			asset.presentation.get_attribute(asset,name,slide) || default
         | 
| 15 | 
            +
            		end
         | 
| 16 | 
            +
            	end
         | 
| 17 | 
            +
            	def set(asset,new_value,slide_name_or_index)
         | 
| 18 | 
            +
            		asset.presentation.set_attribute(asset,name,slide_name_or_index,new_value)
         | 
| 19 | 
            +
            	end
         | 
| 20 | 
            +
            	def inspect
         | 
| 21 | 
            +
            		"<#{type} '#{name}'>"
         | 
| 22 | 
            +
            	end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            	class String < self
         | 
| 25 | 
            +
            		self.default = ''
         | 
| 26 | 
            +
            	end
         | 
| 27 | 
            +
            	MultiLineString = String
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            	class Float < self
         | 
| 30 | 
            +
            		self.default = 0.0
         | 
| 31 | 
            +
            		def get(asset,slide); super.to_f; end
         | 
| 32 | 
            +
            	end
         | 
| 33 | 
            +
            	class Long < self
         | 
| 34 | 
            +
            		self.default = 0
         | 
| 35 | 
            +
            		def get(asset,slide); super.to_i; end
         | 
| 36 | 
            +
            	end
         | 
| 37 | 
            +
            	class Boolean < self
         | 
| 38 | 
            +
            		self.default = false
         | 
| 39 | 
            +
            		def get(asset,slide); super=='True'; end
         | 
| 40 | 
            +
            		def set(asset,new_value,slide_name_or_index)
         | 
| 41 | 
            +
            			super( asset, new_value ? 'True' : 'False', slide_name_or_index )
         | 
| 42 | 
            +
            		end
         | 
| 43 | 
            +
            	end
         | 
| 44 | 
            +
            	class Vector < self
         | 
| 45 | 
            +
            		self.default = '0 0 0'
         | 
| 46 | 
            +
            		def get(asset,slide)
         | 
| 47 | 
            +
            			VectorValue.new(asset,self,slide,super)
         | 
| 48 | 
            +
            		end
         | 
| 49 | 
            +
            		def set(asset,new_value,slide_name_or_index)
         | 
| 50 | 
            +
            			new_value = new_value.join(' ') if new_value.is_a?(Array)
         | 
| 51 | 
            +
            			super( asset, new_value, slide_name_or_index )
         | 
| 52 | 
            +
            		end
         | 
| 53 | 
            +
            	end
         | 
| 54 | 
            +
            	Rotation = Vector
         | 
| 55 | 
            +
            	Color    = Vector
         | 
| 56 | 
            +
            	Float2   = Vector
         | 
| 57 | 
            +
            	class Image < self
         | 
| 58 | 
            +
            		self.default = nil
         | 
| 59 | 
            +
            		def get(asset,slide)
         | 
| 60 | 
            +
            			if idref = super
         | 
| 61 | 
            +
            				result = asset.presentation.asset_by_id( idref[1..-1] )
         | 
| 62 | 
            +
            				slide ? result.on_slide( slide ) : result
         | 
| 63 | 
            +
            			end
         | 
| 64 | 
            +
            		end
         | 
| 65 | 
            +
            		def set(asset,new_value,slide)
         | 
| 66 | 
            +
            			raise "Setting image attributes not yet supported"
         | 
| 67 | 
            +
            		end
         | 
| 68 | 
            +
            	end
         | 
| 69 | 
            +
            	class Texture < String
         | 
| 70 | 
            +
            		def get(asset,slide)
         | 
| 71 | 
            +
            			if path=super
         | 
| 72 | 
            +
            				path.empty? ? nil : path.gsub( '\\', '/' ).sub( /^.\// ,'' )
         | 
| 73 | 
            +
            			end
         | 
| 74 | 
            +
            		end
         | 
| 75 | 
            +
            	end
         | 
| 76 | 
            +
             | 
| 77 | 
            +
            	class ObjectRef < self
         | 
| 78 | 
            +
            		self.default = nil
         | 
| 79 | 
            +
            		def get(asset,slide)
         | 
| 80 | 
            +
            			ref  = super
         | 
| 81 | 
            +
            			type = :absolute
         | 
| 82 | 
            +
            			obj  = nil
         | 
| 83 | 
            +
            			unless ref=='' || ref.nil?
         | 
| 84 | 
            +
            				type = ref[0]=='#' ? :absolute : :path
         | 
| 85 | 
            +
            				ref = type==:absolute ? asset.presentation.asset_by_id( ref[1..-1] ) : asset.presentation.at( ref, asset )
         | 
| 86 | 
            +
            			end
         | 
| 87 | 
            +
            			ObjectReference.new(asset,self,slide,ref,type)
         | 
| 88 | 
            +
            		end
         | 
| 89 | 
            +
            		def set(asset,new_object,slide)
         | 
| 90 | 
            +
            			get(asset,slide).object = new_object
         | 
| 91 | 
            +
            		end
         | 
| 92 | 
            +
            	end
         | 
| 93 | 
            +
             | 
| 94 | 
            +
            	class ObjectReference
         | 
| 95 | 
            +
            		attr_reader :object, :type
         | 
| 96 | 
            +
            		def initialize(asset,property,slide,object=nil,type=nil)
         | 
| 97 | 
            +
            			@asset    = asset
         | 
| 98 | 
            +
            			@name     = property.name
         | 
| 99 | 
            +
            			@slide    = slide
         | 
| 100 | 
            +
            			@object   = object
         | 
| 101 | 
            +
            			@type     = type
         | 
| 102 | 
            +
            		end
         | 
| 103 | 
            +
            		def object=(new_object)
         | 
| 104 | 
            +
            			raise "ObjectRef must be set to an asset (not a #{new_object.class.name})" unless new_object.is_a?(UIC::MetaData::AssetBase)
         | 
| 105 | 
            +
            			@object = new_object
         | 
| 106 | 
            +
            			write_value!
         | 
| 107 | 
            +
            		end
         | 
| 108 | 
            +
            		def type=(new_type)
         | 
| 109 | 
            +
            			raise "ObjectRef types must be either :absolute or :path (not #{new_type.inspect})" unless [:absolute,:path].include?(new_type)
         | 
| 110 | 
            +
            			@type = new_type
         | 
| 111 | 
            +
            			write_value!
         | 
| 112 | 
            +
            		end
         | 
| 113 | 
            +
            		private
         | 
| 114 | 
            +
            		def write_value!
         | 
| 115 | 
            +
            			path = case @object
         | 
| 116 | 
            +
            				when NilClass then ""
         | 
| 117 | 
            +
            				else case @type
         | 
| 118 | 
            +
            					when :absolute then "##{@object.el['id']}"
         | 
| 119 | 
            +
            					when :path     then @asset.presentation.path_to( @object, @asset ).sub(/^[^:.]+:/,'')
         | 
| 120 | 
            +
            					# when :root     then @asset.presentation.path_to( @object ).sub(/^[^:.]+:/,'')
         | 
| 121 | 
            +
            				end
         | 
| 122 | 
            +
            			end
         | 
| 123 | 
            +
            			@asset.presentation.set_attribute( @asset, @name, @slide, path )
         | 
| 124 | 
            +
            		end
         | 
| 125 | 
            +
            	end
         | 
| 126 | 
            +
             | 
| 127 | 
            +
            	Import     = String #TODO: a real class
         | 
| 128 | 
            +
            	Mesh       = String #TODO: a real class
         | 
| 129 | 
            +
            	Renderable = String #TODO: a real class
         | 
| 130 | 
            +
            	Font       = String #TODO: a real class
         | 
| 131 | 
            +
            	FontSize   = Long
         | 
| 132 | 
            +
             | 
| 133 | 
            +
            	StringListOrInt = String #TODO: a real class
         | 
| 134 | 
            +
             | 
| 135 | 
            +
            	class VectorValue
         | 
| 136 | 
            +
            		attr_reader :x, :y, :z
         | 
| 137 | 
            +
            		def initialize(asset,property,slide,str)
         | 
| 138 | 
            +
            			@asset    = asset
         | 
| 139 | 
            +
            			@property = property
         | 
| 140 | 
            +
            			@slide    = slide
         | 
| 141 | 
            +
            			@x, @y, @z = str.split(/\s+/).map(&:to_f)
         | 
| 142 | 
            +
            		end
         | 
| 143 | 
            +
            		def setall
         | 
| 144 | 
            +
            			@property.set( @asset, to_s, @slide )
         | 
| 145 | 
            +
            		end
         | 
| 146 | 
            +
            		def x=(n); @x=n; setall end
         | 
| 147 | 
            +
            		def y=(n); @y=n; setall end
         | 
| 148 | 
            +
            		def z=(n); @z=n; setall end
         | 
| 149 | 
            +
            		alias_method :r, :x
         | 
| 150 | 
            +
            		alias_method :g, :y
         | 
| 151 | 
            +
            		alias_method :b, :z
         | 
| 152 | 
            +
            		alias_method :r=, :x=
         | 
| 153 | 
            +
            		alias_method :g=, :y=
         | 
| 154 | 
            +
            		alias_method :b=, :z=
         | 
| 155 | 
            +
            		def inspect
         | 
| 156 | 
            +
            			"<#{@asset.path}.#{@property.name}: #{self}>"
         | 
| 157 | 
            +
            		end
         | 
| 158 | 
            +
            		def to_s
         | 
| 159 | 
            +
            			to_a.join(' ')
         | 
| 160 | 
            +
            		end
         | 
| 161 | 
            +
            		def to_a
         | 
| 162 | 
            +
            			[x,y,z]
         | 
| 163 | 
            +
            		end
         | 
| 164 | 
            +
            	end
         | 
| 165 | 
            +
            end
         | 
    
        data/lib/ruic/behaviors.rb
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/ruic/interfaces.rb
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/ruic/presentation.rb
    CHANGED
    
    | 
            File without changes
         | 
| @@ -1,25 +1,25 @@ | |
| 1 | 
            -
            # Allows [Ripl](https://github.com/cldwalker/ripl) to execute code or print a message after every result.
         | 
| 2 | 
            -
            #
         | 
| 3 | 
            -
            # @example 1) Printing a blank line after each result
         | 
| 4 | 
            -
            #  require_relative 'ripl-after-result'
         | 
| 5 | 
            -
            #  Ripl::Shell.include Ripl::AfterResult
         | 
| 6 | 
            -
            #  Ripl.config.merge! after_result:"\n"
         | 
| 7 | 
            -
            #
         | 
| 8 | 
            -
            # @example 2) Executing arbitrary code with the result
         | 
| 9 | 
            -
            #  results = []
         | 
| 10 | 
            -
            #  require_relative 'ripl-after-result'
         | 
| 11 | 
            -
            #  Ripl::Shell.include Ripl::AfterResult
         | 
| 12 | 
            -
            #  Ripl.config.merge! after_result:proc{ |result| results << result }
         | 
| 13 | 
            -
            module Ripl::AfterResult
         | 
| 14 | 
            -
            	# @private no need to document the method
         | 
| 15 | 
            -
            	def print_result(result)
         | 
| 16 | 
            -
            		super
         | 
| 17 | 
            -
            		if after=config[:after_result]
         | 
| 18 | 
            -
            			if after.respond_to?(:call)
         | 
| 19 | 
            -
            				after.call(result)
         | 
| 20 | 
            -
            			else
         | 
| 21 | 
            -
            				puts after
         | 
| 22 | 
            -
            			end
         | 
| 23 | 
            -
            		end
         | 
| 24 | 
            -
            	end
         | 
| 1 | 
            +
            # Allows [Ripl](https://github.com/cldwalker/ripl) to execute code or print a message after every result.
         | 
| 2 | 
            +
            #
         | 
| 3 | 
            +
            # @example 1) Printing a blank line after each result
         | 
| 4 | 
            +
            #  require_relative 'ripl-after-result'
         | 
| 5 | 
            +
            #  Ripl::Shell.include Ripl::AfterResult
         | 
| 6 | 
            +
            #  Ripl.config.merge! after_result:"\n"
         | 
| 7 | 
            +
            #
         | 
| 8 | 
            +
            # @example 2) Executing arbitrary code with the result
         | 
| 9 | 
            +
            #  results = []
         | 
| 10 | 
            +
            #  require_relative 'ripl-after-result'
         | 
| 11 | 
            +
            #  Ripl::Shell.include Ripl::AfterResult
         | 
| 12 | 
            +
            #  Ripl.config.merge! after_result:proc{ |result| results << result }
         | 
| 13 | 
            +
            module Ripl::AfterResult
         | 
| 14 | 
            +
            	# @private no need to document the method
         | 
| 15 | 
            +
            	def print_result(result)
         | 
| 16 | 
            +
            		super
         | 
| 17 | 
            +
            		if after=config[:after_result]
         | 
| 18 | 
            +
            			if after.respond_to?(:call)
         | 
| 19 | 
            +
            				after.call(result)
         | 
| 20 | 
            +
            			else
         | 
| 21 | 
            +
            				puts after
         | 
| 22 | 
            +
            			end
         | 
| 23 | 
            +
            		end
         | 
| 24 | 
            +
            	end
         | 
| 25 25 | 
             
            end
         | 
    
        data/lib/ruic/statemachine.rb
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/ruic/version.rb
    CHANGED
    
    | @@ -1,3 +1,3 @@ | |
| 1 | 
            -
            class RUIC
         | 
| 2 | 
            -
            	VERSION = '0.4. | 
| 1 | 
            +
            class RUIC
         | 
| 2 | 
            +
            	VERSION = '0.4.5'
         | 
| 3 3 | 
             
            end
         | 
    
        data/ruic.gemspec
    CHANGED
    
    | @@ -1,26 +1,26 @@ | |
| 1 | 
            -
            # encoding: UTF-8
         | 
| 2 | 
            -
            $: << File.expand_path("../lib", __FILE__)
         | 
| 3 | 
            -
            require "ruic/version"
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            Gem::Specification.new do |s|
         | 
| 6 | 
            -
              s.name        = "RUIC"
         | 
| 7 | 
            -
              s.version     = RUIC::VERSION
         | 
| 8 | 
            -
              s.platform    = Gem::Platform::RUBY
         | 
| 9 | 
            -
              s.authors     = ["Gavin Kistner"]
         | 
| 10 | 
            -
              s.email       = ["gavin@phrogz.net"]
         | 
| 11 | 
            -
              s.license     = "MIT License"
         | 
| 12 | 
            -
              s.summary     = %q{Library and DSL analyzing and manipulating UI Composer applications and presentations.}
         | 
| 13 | 
            -
              s.description = %q{RUIC is a library that understands the XML formats used by NVIDIA's "UI Composer" tool suite. In addition to APIs for analyzing and manipulating these files—the UIC portion of the library—it also includes a mini DSL for writing scripts that can be run by the `ruic` interpreter.}
         | 
| 14 | 
            -
              s.homepage    = "https://github.com/Phrogz/RUIC"
         | 
| 15 | 
            -
             | 
| 16 | 
            -
              s.add_runtime_dependency "nokogiri", '~> 1'
         | 
| 17 | 
            -
              s.add_runtime_dependency "ripl", '~> 0'
         | 
| 18 | 
            -
              s.add_runtime_dependency "ripl-multi_line", '~> 0'
         | 
| 19 | 
            -
              s.add_runtime_dependency "ripl-irb", '~> 0'
         | 
| 20 | 
            -
             | 
| 21 | 
            -
              s.files         = `git ls-files`.split("\n")
         | 
| 22 | 
            -
              s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
         | 
| 23 | 
            -
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         | 
| 24 | 
            -
              s.require_paths = ["lib"]
         | 
| 25 | 
            -
              s.bindir        = 'bin'
         | 
| 1 | 
            +
            # encoding: UTF-8
         | 
| 2 | 
            +
            $: << File.expand_path("../lib", __FILE__)
         | 
| 3 | 
            +
            require "ruic/version"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            Gem::Specification.new do |s|
         | 
| 6 | 
            +
              s.name        = "RUIC"
         | 
| 7 | 
            +
              s.version     = RUIC::VERSION
         | 
| 8 | 
            +
              s.platform    = Gem::Platform::RUBY
         | 
| 9 | 
            +
              s.authors     = ["Gavin Kistner"]
         | 
| 10 | 
            +
              s.email       = ["gavin@phrogz.net"]
         | 
| 11 | 
            +
              s.license     = "MIT License"
         | 
| 12 | 
            +
              s.summary     = %q{Library and DSL analyzing and manipulating UI Composer applications and presentations.}
         | 
| 13 | 
            +
              s.description = %q{RUIC is a library that understands the XML formats used by NVIDIA's "UI Composer" tool suite. In addition to APIs for analyzing and manipulating these files—the UIC portion of the library—it also includes a mini DSL for writing scripts that can be run by the `ruic` interpreter.}
         | 
| 14 | 
            +
              s.homepage    = "https://github.com/Phrogz/RUIC"
         | 
| 15 | 
            +
             | 
| 16 | 
            +
              s.add_runtime_dependency "nokogiri", '~> 1'
         | 
| 17 | 
            +
              s.add_runtime_dependency "ripl", '~> 0'
         | 
| 18 | 
            +
              s.add_runtime_dependency "ripl-multi_line", '~> 0'
         | 
| 19 | 
            +
              s.add_runtime_dependency "ripl-irb", '~> 0'
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              s.files         = `git ls-files`.split("\n")
         | 
| 22 | 
            +
              s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
         | 
| 23 | 
            +
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         | 
| 24 | 
            +
              s.require_paths = ["lib"]
         | 
| 25 | 
            +
              s.bindir        = 'bin'
         | 
| 26 26 | 
             
            end
         | 
    
        data/test/MetaData-simple.xml
    CHANGED
    
    | @@ -1,28 +1,28 @@ | |
| 1 | 
            -
            <?xml version="1.0" encoding="UTF-8"?>
         | 
| 2 | 
            -
            <MetaData>
         | 
| 3 | 
            -
              <Alias/>
         | 
| 4 | 
            -
              <Asset>
         | 
| 5 | 
            -
                <Property name="eyeball" formalName="Visible" type="Boolean" default="True" hidden="True" />
         | 
| 6 | 
            -
              </Asset>
         | 
| 7 | 
            -
              <Behavior/>
         | 
| 8 | 
            -
              <Camera/>
         | 
| 9 | 
            -
              <Component/>
         | 
| 10 | 
            -
              <Effect/>
         | 
| 11 | 
            -
              <Group/>
         | 
| 12 | 
            -
              <Image/>
         | 
| 13 | 
            -
              <Layer/>
         | 
| 14 | 
            -
              <Light/>
         | 
| 15 | 
            -
              <MaterialBase/>
         | 
| 16 | 
            -
              <Material/>
         | 
| 17 | 
            -
              <ReferencedMaterial/>
         | 
| 18 | 
            -
              <Model/>
         | 
| 19 | 
            -
              <Node/>
         | 
| 20 | 
            -
              <Path/>
         | 
| 21 | 
            -
              <PathAnchorPoint/>
         | 
| 22 | 
            -
              <RenderPlugin/>
         | 
| 23 | 
            -
              <Scene/>
         | 
| 24 | 
            -
              <Slide/>
         | 
| 25 | 
            -
              <SlideOwner/>
         | 
| 26 | 
            -
              <Text/>
         | 
| 27 | 
            -
              <XYZZY/>
         | 
| 28 | 
            -
            </MetaData>
         | 
| 1 | 
            +
            <?xml version="1.0" encoding="UTF-8"?>
         | 
| 2 | 
            +
            <MetaData>
         | 
| 3 | 
            +
              <Alias/>
         | 
| 4 | 
            +
              <Asset>
         | 
| 5 | 
            +
                <Property name="eyeball" formalName="Visible" type="Boolean" default="True" hidden="True" />
         | 
| 6 | 
            +
              </Asset>
         | 
| 7 | 
            +
              <Behavior/>
         | 
| 8 | 
            +
              <Camera/>
         | 
| 9 | 
            +
              <Component/>
         | 
| 10 | 
            +
              <Effect/>
         | 
| 11 | 
            +
              <Group/>
         | 
| 12 | 
            +
              <Image/>
         | 
| 13 | 
            +
              <Layer/>
         | 
| 14 | 
            +
              <Light/>
         | 
| 15 | 
            +
              <MaterialBase/>
         | 
| 16 | 
            +
              <Material/>
         | 
| 17 | 
            +
              <ReferencedMaterial/>
         | 
| 18 | 
            +
              <Model/>
         | 
| 19 | 
            +
              <Node/>
         | 
| 20 | 
            +
              <Path/>
         | 
| 21 | 
            +
              <PathAnchorPoint/>
         | 
| 22 | 
            +
              <RenderPlugin/>
         | 
| 23 | 
            +
              <Scene/>
         | 
| 24 | 
            +
              <Slide/>
         | 
| 25 | 
            +
              <SlideOwner/>
         | 
| 26 | 
            +
              <Text/>
         | 
| 27 | 
            +
              <XYZZY/>
         | 
| 28 | 
            +
            </MetaData>
         |