rsence-pre 2.1.0.9 → 2.1.0.10
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.
- data/VERSION +1 -1
- data/conf/default_conf.yaml +1 -0
- data/js/lists/propertylist/propertylisteditor/propertylisteditor.js +29 -2
- data/lib/plugins/gui_plugin.rb +13 -13
- data/lib/plugins/plugin_base.rb +14 -0
- data/lib/plugins/pluginmanager.rb +8 -1
- data/plugins/main/main.rb +10 -0
- metadata +4 -4
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            2.1.0. | 
| 1 | 
            +
            2.1.0.10.pre
         | 
    
        data/conf/default_conf.yaml
    CHANGED
    
    
| @@ -54,6 +54,14 @@ HPropertyListEditor = HControl.extend({ | |
| 54 54 | 
             
                  this.numberEditor.hide();
         | 
| 55 55 | 
             
                }
         | 
| 56 56 |  | 
| 57 | 
            +
                if(this.value.type === 'b'){
         | 
| 58 | 
            +
                  this.boolEditor.show();
         | 
| 59 | 
            +
                  this.boolEditor.setValue(this.value.value);
         | 
| 60 | 
            +
                }
         | 
| 61 | 
            +
                else{
         | 
| 62 | 
            +
                  this.boolEditor.hide();
         | 
| 63 | 
            +
                }
         | 
| 64 | 
            +
                
         | 
| 57 65 | 
             
                this.resizeKeyColumn();
         | 
| 58 66 | 
             
              },
         | 
| 59 67 |  | 
| @@ -78,11 +86,13 @@ HPropertyListEditor = HControl.extend({ | |
| 78 86 | 
             
                nameEditor.refresh();
         | 
| 79 87 |  | 
| 80 88 | 
             
                var
         | 
| 81 | 
            -
                stringEditor = this.stringEditor | 
| 82 | 
            -
                numberEditor = this.numberEditor | 
| 89 | 
            +
                stringEditor = this.stringEditor,
         | 
| 90 | 
            +
                numberEditor = this.numberEditor,
         | 
| 91 | 
            +
                boolEditor   = this.boolEditor;
         | 
| 83 92 |  | 
| 84 93 | 
             
                stringEditor.rect.setLeft( parent.valueColumnLeft()+5 );
         | 
| 85 94 | 
             
                numberEditor.rect.setLeft( parent.valueColumnLeft()+4 );
         | 
| 95 | 
            +
                boolEditor.rect.setLeft( parent.valueColumnLeft()+4 );
         | 
| 86 96 |  | 
| 87 97 | 
             
                if(this['typeEditor']){
         | 
| 88 98 | 
             
                  var
         | 
| @@ -95,6 +105,7 @@ HPropertyListEditor = HControl.extend({ | |
| 95 105 |  | 
| 96 106 | 
             
                stringEditor.drawRect();
         | 
| 97 107 | 
             
                numberEditor.drawRect();
         | 
| 108 | 
            +
                boolEditor.drawRect();
         | 
| 98 109 | 
             
              },
         | 
| 99 110 | 
             
              nameEditor: null,
         | 
| 100 111 | 
             
              typeEditor: null,
         | 
| @@ -200,6 +211,22 @@ HPropertyListEditor = HControl.extend({ | |
| 200 211 | 
             
                  }
         | 
| 201 212 | 
             
                );
         | 
| 202 213 |  | 
| 214 | 
            +
                this.boolEditor = HCheckbox.extend({
         | 
| 215 | 
            +
                  lostActiveStatus: function(newActive){
         | 
| 216 | 
            +
                    this.parent.lostActiveStatus(newActive);
         | 
| 217 | 
            +
                    this.base();
         | 
| 218 | 
            +
                  }
         | 
| 219 | 
            +
                }).nu(
         | 
| 220 | 
            +
                  [0,-3,null,24,4,null],
         | 
| 221 | 
            +
                  this, {
         | 
| 222 | 
            +
                    style: [
         | 
| 223 | 
            +
                      [ 'font-size', '11px' ],
         | 
| 224 | 
            +
                      [ 'text-indent', '1px' ]
         | 
| 225 | 
            +
                    ],
         | 
| 226 | 
            +
                    label: "Enabled"
         | 
| 227 | 
            +
                  }
         | 
| 228 | 
            +
                );
         | 
| 229 | 
            +
                
         | 
| 203 230 | 
             
                this.resizeKeyColumn();
         | 
| 204 231 |  | 
| 205 232 | 
             
              }
         | 
    
        data/lib/plugins/gui_plugin.rb
    CHANGED
    
    | @@ -79,7 +79,7 @@ module RSence | |
| 79 79 | 
             
                  # @private Method that implements +client_pkgs.yaml+ loading
         | 
| 80 80 | 
             
                  def install_client_pkgs
         | 
| 81 81 | 
             
                    if @client_pkgs
         | 
| 82 | 
            -
                      warn "install_client_pkgs: called with @client_pkgs defined; returning"
         | 
| 82 | 
            +
                      warn "install_client_pkgs: called with @client_pkgs defined (#{@client_pkgs.inspect}); returning"
         | 
| 83 83 | 
             
                      return
         | 
| 84 84 | 
             
                    end
         | 
| 85 85 | 
             
                    @client_pkgs = yaml_read( 'client_pkgs.yaml' )
         | 
| @@ -87,14 +87,14 @@ module RSence | |
| 87 87 | 
             
                      if @client_pkgs.has_key?(:src_dirs)
         | 
| 88 88 | 
             
                        @client_pkgs[:src_dirs].each do |src_dir|
         | 
| 89 89 | 
             
                          src_dir = bundle_path( src_dir[2..-1] ) if src_dir.start_with?('./')
         | 
| 90 | 
            -
                           | 
| 90 | 
            +
                          client_pkg.add_src_dir( src_dir )
         | 
| 91 91 | 
             
                        end
         | 
| 92 92 | 
             
                      end
         | 
| 93 | 
            -
                       | 
| 94 | 
            -
                       | 
| 95 | 
            -
                       | 
| 96 | 
            -
                       | 
| 97 | 
            -
                       | 
| 93 | 
            +
                      client_pkg.add_packages(       @client_pkgs[:packages      ] ) if @client_pkgs.has_key?(:packages      )
         | 
| 94 | 
            +
                      client_pkg.add_themes(         @client_pkgs[:theme_names   ] ) if @client_pkgs.has_key?(:theme_names   )
         | 
| 95 | 
            +
                      client_pkg.add_gfx_formats(    @client_pkgs[:gfx_formats   ] ) if @client_pkgs.has_key?(:gfx_formats   )
         | 
| 96 | 
            +
                      client_pkg.add_reserved_names( @client_pkgs[:reserved_names] ) if @client_pkgs.has_key?(:reserved_names)
         | 
| 97 | 
            +
                      client_pkg.rebuild_client
         | 
| 98 98 | 
             
                    end
         | 
| 99 99 | 
             
                  end
         | 
| 100 100 |  | 
| @@ -106,14 +106,14 @@ module RSence | |
| 106 106 | 
             
                      if @client_pkgs.has_key?(:src_dirs)
         | 
| 107 107 | 
             
                        @client_pkgs[:src_dirs].each do |src_dir|
         | 
| 108 108 | 
             
                          src_dir = bundle_path( src_dir[2..-1] ) if src_dir.start_with?('./')
         | 
| 109 | 
            -
                           | 
| 109 | 
            +
                          client_pkg.del_src_dir( src_dir )
         | 
| 110 110 | 
             
                        end
         | 
| 111 111 | 
             
                      end
         | 
| 112 | 
            -
                       | 
| 113 | 
            -
                       | 
| 114 | 
            -
                       | 
| 115 | 
            -
                       | 
| 116 | 
            -
                       | 
| 112 | 
            +
                      client_pkg.del_reserved_names( @client_pkgs[:reserved_names] ) if @client_pkgs.has_key?(:reserved_names)
         | 
| 113 | 
            +
                      client_pkg.del_gfx_formats(    @client_pkgs[:gfx_formats   ] ) if @client_pkgs.has_key?(:gfx_formats   )
         | 
| 114 | 
            +
                      client_pkg.del_themes(         @client_pkgs[:theme_names   ] ) if @client_pkgs.has_key?(:theme_names   )
         | 
| 115 | 
            +
                      client_pkg.del_packages(       @client_pkgs[:packages].keys  ) if @client_pkgs.has_key?(:packages      )
         | 
| 116 | 
            +
                      client_pkg.rebuild_client
         | 
| 117 117 | 
             
                    end
         | 
| 118 118 | 
             
                    @client_pkgs = false
         | 
| 119 119 | 
             
                  end
         | 
    
        data/lib/plugins/plugin_base.rb
    CHANGED
    
    | @@ -36,6 +36,11 @@ module RSence | |
| 36 36 | 
             
                # * {GUIPlugin__ GUIPlugin} -- The GUIPlugin base class
         | 
| 37 37 | 
             
                module PluginBase
         | 
| 38 38 |  | 
| 39 | 
            +
                  # When a method is missing, tries a call via pluginmanager. (Eliminates plugins.plugin_name.method_name calls -> plugin_name.method_name)
         | 
| 40 | 
            +
                  def method_missing( sym, *args, &block )
         | 
| 41 | 
            +
                    @plugins.method_missing( sym, *args, &block )
         | 
| 42 | 
            +
                  end
         | 
| 43 | 
            +
                  
         | 
| 39 44 | 
             
                  # @private External accessor for @plugins
         | 
| 40 45 | 
             
                  # @return [PluginManager] The PluginManager the instance belongs to.
         | 
| 41 46 | 
             
                  attr_reader :plugins
         | 
| @@ -124,6 +129,15 @@ module RSence | |
| 124 129 | 
             
                  end
         | 
| 125 130 | 
             
                  alias file_save file_write
         | 
| 126 131 |  | 
| 132 | 
            +
                  # Yaml writer utility.
         | 
| 133 | 
            +
                  #
         | 
| 134 | 
            +
                  # Wrapper for #file_write
         | 
| 135 | 
            +
                  # Converts +data+ to yaml and then calls file_write with the result.
         | 
| 136 | 
            +
                  def yaml_write( path, data )
         | 
| 137 | 
            +
                    file_write( path, data.to_yaml )
         | 
| 138 | 
            +
                  end
         | 
| 139 | 
            +
                  
         | 
| 140 | 
            +
                  
         | 
| 127 141 | 
             
                  # Path utility
         | 
| 128 142 | 
             
                  #
         | 
| 129 143 | 
             
                  # Makes a full, absolute path using the plugin bundle as the default path when a relative path is given. Returns just the bundle's local path, if no parameters given.
         | 
| @@ -142,6 +142,7 @@ module RSence | |
| 142 142 | 
             
                alias run_plugin call
         | 
| 143 143 |  | 
| 144 144 | 
             
                # Prettier error handling.
         | 
| 145 | 
            +
                @@prev_errors = []
         | 
| 145 146 | 
             
                def plugin_error( e, err_location, err_location_descr, eval_repl=false )
         | 
| 146 147 | 
             
                  err_msg = [
         | 
| 147 148 | 
             
                    "*"*40,
         | 
| @@ -152,6 +153,12 @@ module RSence | |
| 152 153 | 
             
                    "\t"+e.backtrace.join("\n\t"),
         | 
| 153 154 | 
             
                    "*"*40
         | 
| 154 155 | 
             
                  ].join("\n")+"\n"
         | 
| 156 | 
            +
                  error_say = "Error! #{err_location_descr.capitalize}. #{e.class.to_s}, #{e.message}?"
         | 
| 157 | 
            +
                  unless @@prev_errors.include?( error_say )
         | 
| 158 | 
            +
                    @@prev_errors.push( error_say )
         | 
| 159 | 
            +
                    say error_say
         | 
| 160 | 
            +
                  end
         | 
| 161 | 
            +
                  @@prev_errors.shift if @@prev_errors.length > 10
         | 
| 155 162 | 
             
                  if eval_repl
         | 
| 156 163 | 
             
                    puts
         | 
| 157 164 | 
             
                    puts "plugin: #{eval_repl}"
         | 
| @@ -516,7 +523,7 @@ module RSence | |
| 516 523 | 
             
                  if RSence.args[:say]
         | 
| 517 524 | 
             
                    Thread.new do
         | 
| 518 525 | 
             
                      Thread.pass
         | 
| 519 | 
            -
                      system(%{say "#{message.gsub('"','')}"})
         | 
| 526 | 
            +
                      system(%{say "#{message.gsub('"',"'").gsub('`',"'")}"})
         | 
| 520 527 | 
             
                    end
         | 
| 521 528 | 
             
                  end
         | 
| 522 529 | 
             
                end
         | 
    
        data/plugins/main/main.rb
    CHANGED
    
    | @@ -83,6 +83,16 @@ class MainPlugin < Plugin | |
| 83 83 |  | 
| 84 84 | 
             
              end
         | 
| 85 85 |  | 
| 86 | 
            +
              # Returns base url of browser (before the '#' sign)
         | 
| 87 | 
            +
              def url( msg )
         | 
| 88 | 
            +
                get_ses( msg )[:url][0]
         | 
| 89 | 
            +
              end
         | 
| 90 | 
            +
              
         | 
| 91 | 
            +
              # Returns pound url of browser (after the '#' sign)
         | 
| 92 | 
            +
              def pound( msg )
         | 
| 93 | 
            +
                get_ses( msg )[:url][1]
         | 
| 94 | 
            +
              end
         | 
| 95 | 
            +
              
         | 
| 86 96 |  | 
| 87 97 | 
             
              # @private new session initialization, called just once per session.
         | 
| 88 98 | 
             
              def init_ses(msg)
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: rsence-pre
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash:  | 
| 4 | 
            +
              hash: 115
         | 
| 5 5 | 
             
              prerelease: false
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 2
         | 
| 8 8 | 
             
              - 1
         | 
| 9 9 | 
             
              - 0
         | 
| 10 | 
            -
              -  | 
| 11 | 
            -
              version: 2.1.0. | 
| 10 | 
            +
              - 10
         | 
| 11 | 
            +
              version: 2.1.0.10
         | 
| 12 12 | 
             
            platform: ruby
         | 
| 13 13 | 
             
            authors: 
         | 
| 14 14 | 
             
            - Riassence Inc.
         | 
| @@ -16,7 +16,7 @@ autorequire: | |
| 16 16 | 
             
            bindir: bin
         | 
| 17 17 | 
             
            cert_chain: []
         | 
| 18 18 |  | 
| 19 | 
            -
            date: 2010-10- | 
| 19 | 
            +
            date: 2010-10-25 00:00:00 +03:00
         | 
| 20 20 | 
             
            default_executable: rsence-pre
         | 
| 21 21 | 
             
            dependencies: 
         | 
| 22 22 | 
             
            - !ruby/object:Gem::Dependency 
         |