Skip to content

LoadError in 1.9, generator.rb gone #1

Description

@philomory

generator.rb has been removed from Ruby 1.9, so when trying to use sortable under 1.9, it fails with a LoadError. sortable.rb isn't really making much use of Generator's features, though, so the patch to fix the issue is pretty simple.

0a1,2
> require 'generator'
> 
211c213,214
<           search_array.each_with_index do |col,i|

---
>           g = Generator.new(search_array)
>           g.each do |col|
213c216
<            columns_to_search += 'OR ' unless i == search_array.length - 1

---
>            columns_to_search += 'OR ' unless g.end?
259c262,263
<           sort_array.each_with_index do |sort_value,i|

---
>           g = Generator.new(sort_array)
>           g.each do |sort_value|
261c265
<             result += ', ' unless i == sort_array.length - 1

---
>             result += ', ' unless g.end?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions