lib/each_sql.rb in each_sql-0.2.2 vs lib/each_sql.rb in each_sql-0.2.3
- old
+ new
@@ -93,20 +93,20 @@
# Stops immediately
:pop => true
}
},
:nesting_context => [
- /\A\s*(begin|declare|create\b[^;]+?\b(procedure|function|trigger|package))\b/im
+ /\A\s*(\/\s*)*(begin|declare|create\b[^;]+?\b(procedure|function|trigger|package))\b/im
],
:callbacks => {
/\Abegin\b/ => lambda { |obj, stmt, md|
# Oracle needs this
stmt << ';' if stmt !~ /;\Z/
}
},
:ignore => [],
:replace => { %r[\A/] => '' },
- :strip_delimiter => lambda { |obj, stmt| obj
+ :strip_delimiter => lambda { |obj, stmt|
stmt.gsub(/(#{stmt =~ /;\s*\// ? '/' : ';'})+\Z/, '')
}
}
}
Defaults[:plsql] = Defaults[:oracle] # alias