Skip to content

Commit

Permalink
updated to work with ruby 1.9.1p243 (2009-07-16 revision 24175)
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Dec 19, 2009
1 parent 210a1f6 commit 978fc55
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion h-ety-h/boot.rb
@@ -1,4 +1,3 @@
require 'ftools'
require 'hpricot'

module ::HH end
Expand Down
2 changes: 1 addition & 1 deletion h-ety-h/init.rb
Expand Up @@ -28,7 +28,7 @@
end

HH::DOWNLOADS = File.join(HH::USER, 'Downloads')
File.makedirs(HH::DOWNLOADS)
FileUtils.makedirs(HH::DOWNLOADS)
HH::DB = HH::Sequel::SQLite::Database.new(:database => File.join(HH::USER, "+TABLES"))
HH::DB.extend HH::DbMixin
HH::DB.init
Expand Down
2 changes: 1 addition & 1 deletion h-ety-h/sequel/database.rb
Expand Up @@ -40,7 +40,7 @@ def <<(sql)
# overriden in database adapters.
def literal(v)
case v
when String: "'%s'" % v
when String then "'%s'" % v
else v.to_s
end
end
Expand Down
10 changes: 5 additions & 5 deletions h-ety-h/sequel/dataset.rb
Expand Up @@ -73,13 +73,13 @@ def qualified_field_name(field, table)
# Converts a field list into a comma seperated string of field names.
def field_list(fields)
case fields
when Array:
when Array then
if fields.empty?
WILDCARD
else
fields.map {|i| field_name(i)}.join(COMMA_SEPARATOR)
end
when Symbol:
when Symbol then
fields.to_field_name
else
fields
Expand All @@ -89,7 +89,7 @@ def field_list(fields)
# Converts an array of sources into a comma separated list.
def source_list(source)
case source
when Array: source.join(COMMA_SEPARATOR)
when Array then source.join(COMMA_SEPARATOR)
else source
end
end
Expand All @@ -111,9 +111,9 @@ def where_equal_condition(left, right)
# Formats a where clause.
def where_list(where)
case where
when Hash:
when Hash then
where.map {|kv| where_equal_condition(kv[0], kv[1])}.join(AND_SEPARATOR)
when Array:
when Array then
fmt = where.shift
fmt.gsub('?') {|i| literal(where.shift)}
else
Expand Down
8 changes: 4 additions & 4 deletions h-ety-h/sequel/schema.rb
Expand Up @@ -21,10 +21,10 @@ class Schema

def self.on_delete_action(action)
case action
when :restrict: RESTRICT
when :cascade: CASCADE
when :set_null: SET_NULL
when :set_default: SET_DEFAULT
when restrict then RESTRICT
when cascade then CASCADE
when set_null then SET_NULL
when set_default then SET_DEFAULT
else NO_ACTION
end
end
Expand Down

0 comments on commit 978fc55

Please sign in to comment.