Permalink
Browse files

Fixed crash in RubyRunner::RubyRunnerPlugin#option_for

The crash was caused by attempting to access the option in the document
and project without checking whether they contained it and rescuing the
wrong exception if they didn't
  • Loading branch information...
1 parent 4c1b381 commit e88ac9024f9f750637040c9bd0e612de3bc02534 @stcrocco committed Oct 20, 2011
Showing with 5 additions and 8 deletions.
  1. +3 −6 CHANGES
  2. +2 −2 plugins/ruby_runner/ruby_runner.rb
View
@@ -12,10 +12,11 @@ h3. Features
syntax of a document
* Ruby and YAML syntax checker now are in their own plugin, rather than being part
of the syntax checker plugin
-* The auto end plugin doesn't use indentation to decide whether the end keyword
- should be inserted or not. It performs a syntax check instead and only inserts
+* The auto end plugin doesn't use indentation anymore to decide whether the end keyword
+ should be inserted or not. Instead, it performs a syntax check and only inserts
end if ruby reports a missing end keyword. This should improve the accuracy of
the plugin
+* The Auto End plugin now inserts the @end@ keyword after a @case@ expression
* Clicking on a file name in an output widget with the middle mouse button now
prevents the tool widget from being hidden, as if the pin button were clicked
* Changed the interface to specify patterns in the RSpec plugin
@@ -46,10 +47,6 @@ h2. Ruber 0.0.9
h3. Features
-h2. Ruber 0.0.9
-
-h3. Features
-
* It is now possible to have more than one open project at the same time
* When a project is active, only the editors associated with it are visibile
* Editors not associated with a project are visible only when there's no active
@@ -346,7 +346,7 @@ def initialize pso, group, rules = {}, order = nil, line_buffered = true
current project, even if _target_ is a {Document} or the name of a file belonging
to it
@param [Boolean] abs it has the same meaning as in {SettingsContainer#[]}
-@raise ArgumentError if the option can be found
+@raise [IndexError] if the option can't be found
=end
def option_for target, group, name, ignore_project = false, abs = false
cont = []
@@ -363,7 +363,7 @@ def option_for target, group, name, ignore_project = false, abs = false
abs = :abs if abs
cont.each_with_index do |c, i|
begin return c[group, name, abs]
- rescue ArgumentError
+ rescue IndexError
raise if i == cont.size - 1
end
end

0 comments on commit e88ac90

Please sign in to comment.