[#389624] Good GUI for buisness focused application — Jaxxa <jaxxa90@...>
What would be a good Graphical User interface for use with a buisness
[#389628] how to make interface explicit with Hash stores? — Reginald Tan <redge.tan@...>
I have a class that uses hash as its internal store. What's a good way
[#389643] Ruby and Telnet — "Leo M." <leo.mmcm@...>
Hello!
[#389648] Sort order dilemma — Wayne Brissette <waynefb@...>
I've got a array that I need sorted in a certain way and I'm struggling to figure out how to make it happen the way I want.
[#389671] Importing Ruby-Lang into Xcode — "Dustin E." <dustyeike@...>
How do i Import an Existing Non-Xcode Project Into Xcode, specifically
On Wed, Nov 2, 2011 at 7:14 PM, Dustin E. <dustyeike@gmail.com> wrote:
In Xcode4, none that i see. There's import files to an existing project
[#389699] Setting systems date and time - Windows — Saul Glass <quati10@...>
Hi Guys,
[#389721] 'require' problem — Kaye Ng <sbstn26@...>
Hi guys!
you need
If you're not on 1.9.2 and don't have require_relative, I believe this
> Sam Rose wrote in post #1030126:
Hi guys! Yes, I'm using 1.9.2 .
[#389732] arcadia editor 0.11.0 released — Antonio Galeone <antonio.galeone@...>
Hi,
[#389733] What happens in dual sorts with nil values? — Wayne Brissette <waynefb@...>
I've put together an array that has a map. I did this so I could do some multi-level sorting of data. For example, if I had a map with:
[#389739] Ruby Challenge — teresa nuagen <unguyen90@...>
Here is a ruby challenge for all you computer science lovers out there,
Totally unrelated to any husker computer science programs right? Like
Jonan S. wrote in post #1030330:
> You mean like the professor for the course? Because that would be me .
On Wed, Nov 9, 2011 at 4:52 AM, aseret nuagen <unguyen90@aim.com> wrote:
Come on. Let's not be so harsh. If truth is being told, then this girl has
On Wed, Nov 9, 2011 at 22:08, Ryan Davis <ryand-ruby@zenspider.com> wrote:
[#389755] Are there two kinds of 'require' ? — Kaye Ng <sbstn26@...>
I'm reading a tutorial and it has an example like this"
[#389760] ANSI v1.4.0 released — transfire@...
ANSI 1.4.0 has been released.
Alternatively you can use isna which has simpler approach.
[#389770] need spome help please :) — "marcin k." <doreklamster@...>
Hello :)
[#389772] ruby instance inside Textmate bundle — Matthew Johnson <musical.matthew@...>
This is probably a pretty unusual request, but I'd like to create a
http://beginrescueend.com/rvm/install/
C. Zona wrote in post #1030343:
[#389792] Tricky DSL, how to do it? — Intransition <transfire@...>
I'd want to write a DSL such that a surface method_missing catches
You are missing a `super` on the method_missing. first you should ask if is
> Any ideas?
[#389803] Good debugging mechanism — Uma Mahesh <umamahesh_nyros@...>
Hi,
[#389804] best IDE — Uma Mahesh <umamahesh_nyros@...>
Hi,
I think it is better to use a very easy editor, like bluefish, and
[#389816] scite - F5 command not working for code execution — Piotr Swoboda <piotr.swoboda1@...>
I am learning Ruby from scratch using a beginner's tutorial. I have
[#389817] How to include a function from a different file in a module — "Andreas L." <andreas.lundgren@...>
Hi!
[#389824] Confection v0.0.1 released — transfire@...
Confection 0.0.1 has been released.
On Tue, Nov 08, 2011 at 02:26:31AM +0900, transfire@gmail.com wrote:
[#389826] Ruby OpenSSL: Why valid TLS certs are not detected? — Iñaki Baz Castillo <ibc@...>
Hi, I'm playing with Ruby OpenSSL in order to validate certificates.
One thing to note is that the github.com cert you've provided isn't
2011/11/7 John Downey <jdowney@gmail.com>:
[#389845] minitest-debugger 1.0.0 Released — Ryan Davis <ryand-ruby@...>
minitest-debugger version 1.0.0 has been released!
[#389857] ruby encryption & decryption using rsa — varma potthuri <pothuri_satish@...>
Concept: I want to encrypt a string(hello) should give say xxx(private
[#389858] Compiling Ruby Inline C code - resolving errors — Martin Hansen <mail@...>
I am trying to get this Ruby inline C code http://pastie.org/2825882 to
I was in doubt whether to use:
[#389861] About the main RubyGems application, gem — Kaye Ng <sbstn26@...>
Hi!
[#389868] Understanding the use of double pipes in Ruby — Fily Salas <fs_tigre@...>
Hi,
[#389879] Getting certain characters from a string — Reese Chappuis <c0dege3k@...>
I have a string that I need to get certain characters at a given index.
[#389895] Parsing data with ruby — Ronald Craft <admin@...>
Hiya,
[#389928] Forming a Ruby meetup group... — "Darryl L. Pierce" <mcpierce@...>
Where I work we have a local Ruby group that used to meet up, until the
One thing you can do is take some of the more interesting questions asked
[#389929] Can't get "or" or "||" to work. — james gallagher <lollyproductions@...>
Hi. I have a stupid question.
[#389938] How can I overwrite class variables — Fily Salas <fs_tigre@...>
Hi,
[#389950] The faster way to read files — "Noé Alejandro" <casanejo@...>
Does anybody know which is the fastest way to read a file? Lets say
Sequentially... The point is that I need to process each pair of files,
I mean, the final processing is about compare (preprocessed) content of
2011/11/11 NoAlejandro <casanejo@gmail.com>:
On Fri, Nov 11, 2011 at 10:07 PM, Ryan Davis <ryand-ruby@zenspider.com> wrote:
[#389964] Strings are not equal — "Mike S." <antsinyourpants128@...>
I am testing two strings to see if they are equal.
[#389966] Argument error --- How to solve? — Ar Ik <arsi.ikonen@...>
I´m at the very beginning with Ruby and give again and again this error
[#389968] Ruby script for creating TLS certificates — Iñaki Baz Castillo <ibc@...>
Hi, I've coded a Ruby script that creates autosigned TLS certificates
You actually send them what is called a certificate signing request (CSR).
2011/11/9 John Downey <jdowney@gmail.com>:
[#389993] Dividing a gem into 2 or 3 gems — Rahul Kumar <sentinel1879@...>
I have a gem that has been growing for a while (e.g. mygem). There's a
[#389994] How to kill an exist tcpserver or tcpsocket? — Fengfeng Li <lifengfeng@...>
Hi everyone,
[#390006] Navigating through the official Ruby documentation — Fily Salas <fs_tigre@...>
Hi,
[#390016] ruby is scripting language — "Harish M." <erharish43.malik@...>
Hello!
[#390021] How Am I to Understand This Class Behavior? — "Nik Z." <esperantoca@...>
Hi, Gurus,
[#390037] Reading CSV File — "Darren H." <dhulem1@...>
Hi all
[#390040] can't find/uninstall installed gems — Neubyr Neubyr <neubyr@...>
I am having some issues while trying to uninstall a gem. I am using Mac
[#390043] Hashery v1.5.0 released — transfire@...
Hashery 1.5.0 has been released.
[#390049] To convert a Ruby tk script to *.exe — "Manju M." <manjuvpm12@...>
Hi,
[#390059] Beginner: how to use gedcom parser — François Boone <francois.boone@...>
Hi,
[#390060] Windows Repository — Mario Ruiz <tcblues@...>
This is my situation. I have one machine called mygemserver and I've
I don't know much about Gem hosting, but don't you need a gem server to do
[#390061] windows pry editor setup — Kevin <darkintent@...>
Does anyone know the correct way to configure Pry's editor variable on
[#390064] referring to version numbers in a gem — Chad Perrin <code@...>
How do I specify and access a gem's version number within the code of the
On 11/11/2011 14:28, Chad Perrin wrote:
On Sat, Nov 12, 2011 at 05:28:15AM +0900, Chad Perrin wrote:
Keep the data where ever you want, Rubygems has tossed the FHS out the
[#390080] calculating the prime factors of a very large number — Ja xv <jeniferjblack@...>
question:
[#390093] Share stories about using Ruby outside of pet projects — Kevin <darkintent@...>
I recently decided to take another stab at Clojure and came across
On 12/11/11 08:21 , Kevin wrote:
[#390104] Using Ruby to install/manage something from source - Features? — Marc Heiler <shevegen@...>
Hi,
[#390105] Advanced Ruby: Eval over multiple Bindings? — Intransition <transfire@...>
This is an extremely advanced Ruby question. Given:
-----BEGIN PGP SIGNED MESSAGE-----
On Saturday, November 12, 2011 4:10:09 PM UTC-5, Quintus wrote:
[#390110] Syntax Error — "Darren H." <dhulem1@...>
Hi All,
[#390121] Using gets and split — Reese Chappuis <c0dege3k@...>
I'm working on a challenge that tells me that the input is given at the
hi Reese,
Ok, that does work- so the problem is with how the data is being inputted,
[#390140] model "lift-passengers" and concurrent programming — Roman Faceless <ya1krabe@...>
Hi,
[#390143] How to use csv files in ruby — Mrin alini <m.mrinali@...>
I am able to write parts of the code but I am not able to join the code
[#390153] Binding#with — Intransition <transfire@...>
Binding#with
On Sun, Nov 13, 2011 at 8:30 PM, Intransition <transfire@gmail.com> wrote:
[#390162] Noob question regarding custom method — Junayeed Ahnaf Nirjhor <zombiegenerator@...>
Hello,
"setter" methods that have "set" in the name are far more idiomatic of
On Mon, Nov 14, 2011 at 1:29 PM, Sam Rose <samwho@lbak.co.uk> wrote:
[#390163] Exclamation marks in method names — Sylvester Keil <sylvester.keil@...>
Dear all,
[#390173] cant install ruby using rvm on osx lion — "Tomas R." <jtomasrl@...>
% Total % Received % Xferd Average Speed Time Time Time
[#390184] Binding#self — Intransition <transfire@...>
Hi,
[#390193] Ruby for Windows — Jim Wood <info@...>
I'm interested in Ruby for Windows.
[#390196] Autocompletion of commands & arguments — Sophie <itsme213@...>
I want to build a Ruby app with the following broad properties
[#390197] search through a csv file — Aksh Akku <akshathakshu@...>
i have a person details csv file. I am trying to write a code to search
[#390204] Logical operator || — "Damián M. González" <gonzalezdamianm@...>
Ey guys. Look at this:
[#390209] Regex to divide document into sections? — Intransition <transfire@...>
Any expert regexp wrangler around here. I can't quite find a way to split a
Hi,
The actual content shouldn't really matter. Sorry, I should have been more
[#390219] Certificate ssl and encrypt... — Diego Soreira <diegosoreira@...>
Hi,
[#390220] SSH hangs for 30 sec on AIX — Claus Folke Brobak <cfb@...>
Environment:
[#390222] Literate programming and Ruby — Michael Sokol <mikaa123@...>
Hey there,
[#390238] RVM problem, plz help — Misha Ognev <b1368810@...>
Hi, I have this problem:
[#390241] Ruby, How Do I Love Thee? Let Me Count the Ways... — "Aaron D. Gifford" <astounding@...>
I just have to say that Ruby is very, very convenient.
[#390242] Speedup Ruby 1.9.3 on Windows a lot — Jarmo Pertman <jarmo.p@...>
Hello!
On Thu, Nov 17, 2011 at 12:06 AM, Jarmo Pertman <jarmo.p@gmail.com> wrote:
[#390257] Help a newbie-The page isn't redirecting properly — Linda Fay <lfay@...>
With good intention I was helping someone with a ruby site but now I've
[#390261] Possible to run Ruby on Apache Tomcat server? — Rm Mz <ruthmizzi@...>
This might be a bit of an unusual set up but I'd like to have Java
[#390279] Problem on hash with default value — "Florent G." <florent2@...>
Hi,
[#390295] WIN32OLE return type USERDEFINED — Dominic Sisneros <dsisnero@...>
I am trying to use WIN32OLE to automate Microstation
Hello
Try the following.
Hello,
> Ooops, sorry.
Hello,
2011/11/19 Masaki Suketa <masaki.suketa@nifty.ne.jp>
[#390303] Problem with action — pololo pololo <ulybkii@...>
Hi,
[#390306] Ruby-GNOME2 moves to GitHub — Kouhei Sutou <kou@...>
Hi!
[#390308] any command line tools for querying yaml files — Rahul Kumar <sentinel1879@...>
(Sorry, this is not exactly a ruby question).
On Fri, Nov 18, 2011 at 3:58 PM, Dave Baldwin <dave.baldwin@3dlabs.com> wrote:
[#390309] www.ruby-lang.org is back — Shugo Maeda <shugo@...>
Hello,
Thanks, i was trying it to find out which the latest 1.9.3 release is
On Fri, Nov 18, 2011 at 10:48:29PM +0900, R. Kumar wrote:
[#390328] Anyone know of free Ruby on Rails hosting for registered charities? — Mike Bethany <mikbe.tk@...>
I'm doing some volunteer web development for a Florida veteran's
[#390338] Newbie - cmd question — Otto Dydakt <ottodydakt@...>
I've literally JUST downloaded ruby from rubyinstaller.org.
OK thank you, I uninstalled & reinstalled, checking the three boxes at
did you type "irb" first to bring up the ruby command prompt?
Hi all,
Hussain A. wrote in post #1036281:
> There is an option in the installer to make Ruby and other Ruby provided
Hussain A. wrote in post #1036449:
> Are you talking about a fresh command prompt *after* you installed?
Hussain A. wrote in post #1036509:
> So C:\Ruby193\bin *is* in the PATH.
[#390365] How to run a program (Newbie) — Otto Dydakt <ottodydakt@...>
Another newbie question here:
[#390374] Principle of Best Principles — Intransition <transfire@...>
I seem to run into a couple of design issue a lot and I never know what is
On Sun, Nov 20, 2011 at 8:42 PM, Intransition <transfire@gmail.com> wrote:
As it turns out you (and others) are pretty spot on, though I'm not sure
[#390396] how to call Function argument into another ruby script. — hari mahesh <harismahesh@...>
Consider I have a ruby file called library.rb.
On Mon, Nov 21, 2011 at 6:55 PM, hari mahesh <harismahesh@gmail.com> wrote:
[#390425] run an script without waiting to be done — Mario Ruiz <tcblues@...>
Hi, I would like to know if it is possible to run an script without
On 11/22/2011 07:39 AM, Mario Ruiz wrote:
[#390442] Create Excel Sheet(.xls/.xlsx) — Mamba Black <micky.tour@...>
Hi,
[#390446] Newbie: Calling dll functions from Ruby for a customer dll — "Omran N." <omran_nazir@...>
Hello,
An example of calling a method would then be:
[#390449] private and protected — Николай <godsent@...>
Could anybody explain me this, please?
[#390458] need help with gsub a string — skolo pen <skolopen@...>
Lacking in regular expressions knowledge, I am having difficulty
[#390465] url normalization — rubix Rubix <aggouni2002@...>
Hi,
[#390474] NOKIGIRI XPATH — Ruby Mania <prateek123@...>
I have a long XML like below .. I wish to select DATA ("cdef" in this
On Thu, Nov 24, 2011 at 9:43 AM, Ruby Mania <prateek123@gmail.com> wrote:
Thanks a lot for help. But it matched CDEF and all nodes after that even
On Thu, Nov 24, 2011 at 12:30 PM, Ruby Mania <prateek123@gmail.com> wrote:
[#390484] check if a element with a specific value exists in a xml using REXML — "mythpills p." <mithunpillay@...>
i have attached a sample xml. I am currently using REXML ..basically i
[#390492] Understanding Ruby blocks — Fily Salas <fs_tigre@...>
Hi,
[#390496] How to make 1.9.2 my default version using RVM — Fily Salas <fs_tigre@...>
Hi,
ruby-1.9.2-p290:
Thanks for your help.
First of all thank you all for your help!
On 24/11/11 21:59, "Fily Salas" <fs_tigre@hotmail.com> wrote:
[#390528] set logger.progname on a per thread basis — Kassym Dorsel <k.dorsel@...>
I have this :
[#390535] Is high-speed sorting impossible with Ruby? — "Gaurav C." <chande.gaurav@...>
Well, first of all, I'm new to Ruby, and to this forum. So, hello. :)
Hi Matthias,
Here is a port of the fastest solution on that site in Ruby. It of course
This counting sort implementation is a great optimization you can do
Hi,
Joao Pedrosa wrote in post #1033884:
A big gain can be had by disabling the garbage collector. Here is my best
I've thrown various solutions up on github here:
Ryan Davis wrote in post #1034037:
Just playing with the code a little, more education than speed.
2011/11/28 Matthias W臘hter <matthias@waechter.wiz.at>
Douglas Seifert wrote in post #1033963:
>
Douglas Seifert wrote in post #1034017:
[#390563] Simplest way for secure, JSON-based client/server solution? — Robert Feldt <robert.feldt@...>
Dear ruby-talk'ers,
[#390566] Does the configure step of compiling work on OS X Snow Leopard? — Andrew Grimm <andrew.j.grimm@...>
I tried compiling the trunk version on OS X Snow Leopard, and it
[#390571] Your best Project — "Mathew S." <onetproductions@...>
What is you personal best app/project you have made.
[#390584] question about overloading — Vitit Kantabutra <vkantabu@...>
Back in 2007, somebody posted a question asking whether or not it is
On Sun, Nov 27, 2011 at 1:38 AM, Vitit Kantabutra <vkantabu@gmail.com>wrote:
[#390590] Creating 2-D array from 1-D array — "J. Marshal" <windbreiz@...>
Hello, I am relatively new to Ruby. I have an existing array:
[#390604] How to call an array from one ruby script to another — hari mahesh <harismahesh@...>
Can we call an array from one ruby script to another and access array
[#390638] Ruby Code help — Tridib Bandopadhyay <tridib04@...>
I am trying to print out the Garbage Collection behavior. I tried the
[#390639] Help Needed urgently — Tridib Bandopadhyay <tridib04@...>
I am able to implement manual memory management in Ruby.I can allocate
[#390650] Loading a faulty ruby file - forcing this — Marc Heiler <shevegen@...>
Hi.
[#390652] Garbage collection and define_finalizer — Garthy D <garthy_lmkltybr@...>
[#390659] What's wrong with this code? — "Kenley T." <kenleytan@...>
I made a program to motivate me for the last day of NaNoWriMo, but it
[#390689] Stupid question — James Gallagher <lollyproductions@...>
Hi everyone.
On Wed, Nov 30, 2011 at 09:10, James Gallagher <lollyproductions@mac.com> wrote:
On Wed, Nov 30, 2011 at 19:23, Dave Aronson
On Wed, Nov 30, 2011 at 14:26, Adam Prescott <adam@aprescott.com> wrote:
[#390706] errors with respond_to? and inject — "Sébastien M." <stkfdt@...>
Hello,
[#390715] DCell 0.0.1: Distributed actors for Ruby — Tony Arcieri <tony.arcieri@...>
DCell is a distributed actor framework for Ruby. Somewhat similar to DRb,
On Thu, Dec 01, 2011 at 05:49:10AM +0900, Tony Arcieri wrote:
ANN: Sequel 3.29.0 Released
Sequel is a lightweight database access toolkit for Ruby.
* Sequel provides thread safety, connection pooling and a concise
DSL for constructing SQL queries and table schemas.
* Sequel includes a comprehensive ORM layer for mapping records to
Ruby objects and handling associated records.
* Sequel supports advanced database features such as prepared
statements, bound variables, stored procedures, savepoints,
two-phase commit, transaction isolation, master/slave
configurations, and database sharding.
* Sequel currently has adapters for ADO, Amalgalite, DataObjects,
DB2, DBI, Firebird, IBM_DB, Informix, JDBC, MySQL, Mysql2, ODBC,
OpenBase, Oracle, PostgreSQL, SQLite3, Swift, and TinyTDS.
Sequel 3.29.0 has been released and should be available on the gem
mirrors.
= New Adapter Support
* Sequel now has much better support for Oracle, both in the
ruby-oci8-based oracle adapter and in the jdbc/oracle adapter.
* Sequel now has much better support for connecting to HSQLDB
using the jdbc adapter. This support does not work correctly
with the jdbc-hsqldb gem, since the version it uses is too
old. You'll need to load the .jar file manually until the
gem is updated.
* Sequel now has much better support for connecting to Apache
Derby databases using the jdbc adapter. This works with
the jdbc-derby gem, but it's recommend you grab an updated
.jar file as the jdbc-derby gem doesn't currently support
truncate or booleans.
* The db2 adapter has had most of the remaining issues fixed,
and can now run Sequel's test suite cleanly. It's still
recommended that users switch to the ibmdb adapter if they
are connecting to DB2.
* A mock adapter has been added which provides a mock Database
object that allows you to easily set the returned rows, the
number of rows modified by update/delete, and the
autogenerating primary key integer for insert. It also allows
you to set specific columns in the dataset when retrieving
rows. The specs were full of partial implementations of
mock adapters, this mock adapter is much more complete and
offers full support for mocking transactions and database
sharding. Example:
DB = Sequel.mock(:fetch=>{:id=>1}, :numrows=>2, :autoid=>3)
DB[:items].all # => [{:id => 1}]
DB[:items].insert # => 3
DB[:items].insert # => 4
DB[:items].delete # => 2
DB[:items].update(:id=>2) # => 2
DB.sqls # => ['SELECT ...', 'INSERT ...', ...]
In addition to being useful in the specs, the mock adapter is
also used if you use bin/sequel without a database argument,
which makes it much easier to play around with Sequel on the
command line without being tied to a real database.
= New Transaction Features
* Database after_commit and after_rollback hooks have been added,
allowing you to set procs that are called after the currently-
in-effect transaction commits or rolls back. If the Database
is not currently in a transaction, the after_commit proc is
called immediately and the after_rollback proc is ignored.
* Model after_commit, after_rollback, after_destroy_commit, and
after_destroy_rollback hooks have been added that use the new
Database after_commit/after_rollback hook to execute code after
commit or rollback.
* Database#transaction now supports a :rollback => :reraise option
to reraise any Sequel::Rollback exceptions raised by the block.
* Database#transaction now supports a :rollback => :always option
to always rollback the transaction, which is mostly useful when
using transaction-based testing.
* Sequel.transaction has been added, allowing you to run
simultaneous transactions on multiple Database objects:
Sequel.transaction([DB1, DB2]){...}
# similar to:
DB1.transaction{DB2.transaction{...}}
You can combine this with the :rollback => :always option to
easily use multiple databases in the same test suite and make sure
that changes are rolled back on all of them.
* Database#in_transaction? has been added so that users can detect
whether the code is currently inside a transaction.
* The generic JDBC transaction support, used by 6 of Sequel's jdbc
subapters, now supports savepoints if the underlying JDBC driver
supports savepoints.
= Other New Features
* A dataset_associations plugin has been added, allowing datasets
to call association methods, which return datasets of rows in
the associated table that are associated to rows in the current
dataset.
# Dataset of tracks from albums with name < 'M'
# by artists with name > 'M'
Artist.filter(:name > 'M').albums.filter(:name < 'M').tracks
# SELECT * FROM tracks
# WHERE (tracks.album_id IN (
# SELECT albums.id FROM albums
# WHERE ((albums.artist_id IN (
# SELECT artists.id FROM artists
# WHERE (name > 'M')))
# AND (name < 'M'))))
* Database#extend_datasets has been added, allowing you to do the
equivalent of extending all of the database's future datasets
with a module. For performance, it creates an anonymous
subclass of the current dataset class and includes a module in
it, and uses the subclass to create future datasets.
Using this feature allows you to override any dataset method
and call super, similar to how Sequel::Model plugins work. The
method takes either a module:
Sequel.extension :columns_introspection
DB.extend_datasets(Sequel::ColumnsIntrospection)
or a block that it uses to create an anonymous module:
DB.extend_datasets do
# Always select from table.* instead of *
def from(*tables)
ds = super
if !@opts[:select] || @opts[:select].empty?
ds = ds.select_all(*tables)
end
ds
end
end
* Database#<< and Dataset#<< now return self, which allow them
to be used in chaining:
DB << "UPADTE foo SET bar_id = NULL" << "DROP TABLE bars"
DB[:foo] << {:bar_id=>0} << DB[:bars].select(:id)
* A Database#timezone accessor has been added, allowing you to
override Sequel.database_timezone on a per-Database basis, which
allows you to use two separate Database objects in the same
process that have different timezones.
* You can now modify the type conversion procs on a per-Database
basis when using the mysql, sqlite, and ibmdb adapters, by
modifying the hash returned by Database#conversion_procs.
* Model.dataset_module now accepts a Module instance as an argument,
and extends the model's dataset with that module.
* When using the postgres adapter with the pg driver, you can now
use Database#listen to wait for notifications. All adapters that
connect to postgres now support Database#notify to send
notifications:
# process 1
DB.listen('foo') do |ev, pid, payload|
ev # => 'foo'
notify_pid # => some Integer
payload # => 'bar'
end
# process 2
DB.notify('foo', :payload=>'bar')
* many_to_one associations now have a :qualify option that can be set
to false to not qualify the primary key when loading the
association. This shouldn't be necessary to use in most cases, but
in some cases qualifying a primary key breaks certain queries (e.g.
using JOIN USING on the same column on Oracle).
* Database#schema can now take a dataset as an argument if it just
selects from a single table. If a dataset is provided, the
schema parsing will use that dataset's identifier_input_method
and identifier_output_method for the parsing, instead of the
database's default. This makes it possible for Model classes
to correctly get the table schema if they use a dataset whose
identifier_(input|output)_method differs from the database
default.
* On databases that support common table expressions (CTEs) but do
not support CTE usage in subselects, Sequel now emulates support
by moving CTEs from the subselect to the main select when using
the Dataset from, from_self, with, with_recursive, union,
intersect, and except methods.
* The bitwise compliment operator is now emulated on H2.
* You can now set the convert_tinyint_to_bool setting on a
per-Database basis in the mysql and mysql2 adapters.
* You can now set the convert_invalid_date_time setting on a
per-Database basis in the mysql adapter.
* Database instances now have a dataset_class accessor that allows
you to set which class is used when creating datasets. This is
mostly used to implement the extend_datasets support, but it
could be useful for other purposes.
* Dataset#unused_table_alias now accepts an optional 2nd argument,
which should be an array of additional symbols that should be
considered as already used.
* Dataset#requires_placeholder_type_specifiers? has been added to
check if the dataset requires you use type specifiers for
bound variable placeholders.
The prepared_statements plugin now checks this setting and works
correctly on adapters that set it to true, such as oracle.
* Dataset#recursive_cte_requires_column_aliases? has been added
to check if you must provide a column list for a recursive CTE.
The rcte_tree plugin now checks this setting an works correctly
on databases that set it to true, such as Oracle and HSQLDB.
= Performance Improvements
* Numerous optimizations were made to loading model objects from
the database, resulting in a 7-16% speedup.
Model.call was added, and now .load is just an alias for .call.
This allows you to make the model dataset's row_proc the model
itself, instead of needing a separate block, which improves
performance.
While Model.load used to call .new (and therefore #initialize),
Model.call uses .allocate/#set_values/#after_initialize for speed.
This saves a method call or two, and skips setting the @new
instance variable.
* Dataset#map, #to_hash, #select_map, #select_order_map, and
#select_hash are now faster if any of the provided arguments are
an array of symbols.
* The Model.[] optimization is now applied in more cases.
= Other Improvements
* Sequel now creates accessor methods for all columns in a model's
table, even if the dataset doesn't select the columns. This has
been the specified behavior for a while, but the spec was broken.
This allows you do to:
Model.dataset = DB[:table].select(:column1, :column2)
Model.select_more(:column3).first.column3
* Model.def_dataset_method now correctly handles method names that
can't be used directly (such as method names with spaces). This
isn't so the method can be used with arbitrary user input, but
it will allow safe creation of dataset methods that are derived
from column names, which could contain spaces.
* Model.def_dataset_method no longer overrides private model
methods.
* The optimization that Model.[] uses now works correctly if the
model's dataset uses a different identifier_input_method than
the database.
* Sharding is supported correctly by default for the transactions
used by model objects. Previously, you had to use the sharding
plugin to make sure the same shard was used for transactions as
for the insert/update/delete statements.
* Sequel now fully supports using an aliased table for the
:join_table option of a many_to_many association. The only real
use case for an aliased :join_table option is when the join table
is the same as the associated model table.
* A bug when eagerly loading a many_through_many association with
composite keys where one of the join tables requires an alias
has been fixed.
* Sequel's transaction internals have had substantial improvments.
You can now open up simultaneous transactions on two separate
shards of the same Database object in the same thread. The new
design allows for future support of connection pools that aren't
based on threads. Sequel no longer abuses thread-local variables
to store savepoint state.
* Dataset#select_map and #select_order_map now return an array of
single element arrays if given an array with a single entry as
an argument. Previously, they returned an array of values, which
wasn't consistent.
* Sequel's emulation of bitwise operators with more than 2 arguments
now works on all adapters that use the emulation. The emulation
was broken in 3.28.0 when more than 2 arguments were used on H2,
DB2, Microsoft SQL Server, PostgreSQL, and SQLite.
* Dataset#columns now correctly handles the emulated offset support
used on DB2, Oracle, and Microsoft SQL Server when using the
jdbc, odbc, ado, and dbi adapters. Previously, Dataet#columns
could contain the row number column, which wasn't in the
hashes yielded by Dataset#each.
* Sequel can now parse primary key information on Microsoft SQL
Server. Previously, the only adapter that supported this was the
jdbc adapter, which uses the generic JDBC support. The shared
mssql adapter now supports parsing the information directly from
the database system tables. This means that if you are using
Model objects with a Microsoft SQL Server database using the
tinytds, odbc, or ado adapters, the model primary key
information will be set automatically.
* Sequel's prepared statement support no longer defines singleton
methods on the prepared statement objects.
* StringMethods#like is now case sensitive on SQLite and Microsoft
SQL Server, making it more similar to other databases.
* Sequel now works around an SQLite column naming bug if you select
columns qualified with the alias of a subselect without providing
an alias for the column itself.
* Sequel now handles more bound variable types when using bound
variables outside of prepared statements on SQLite.
* Sequel now works around a bug in certain versions of the
JDBC/SQLite driver when emulating alter table support for
operations such as drop_column.
* Sequel now emulates the add_constraint and drop_constraint
alter table operations on SQLite, though the emulation has
issues.
* Sequel now correctly handles composite primary keys when
emulating alter_table operations on SQLite.
* Sequel now applies the correct PRAGMA statements by default when
connecting to SQLite via the amalgalite and swift adapters.
* Sequel now supports using savepoints inside prepared transactions
on MySQL.
* Sequel now closes JDBC ResultSet objects as soon as it is done
using them, leading to potentially lower memory usage in the JDBC
adapter, and fixes issues if you try to drop a table before
GC has collected a related ResultSet.
* Sequel can now correctly insert all default values into a table
on DB2. Before, this didn't work correctly if the table had more
than one column.
* Another type of disconnection error is now recognized in the
mysql2 adapter.
* Sequel now uses better error messages if you attempt to execute a
prepared statement without a name using the postgres, mysql, and
mysql2 adapters.
* Some small fixes have been made that allow Sequel to run better
when $SAFE=1. However, Sequel is not officially supported using
$SAFE > 0, so there could be many issues remaining.
* Sequel's core and model specs were cleaned up by using the mock
adapter to eliminate a lot of redundant code.
* Sequel's integration tests were sped up considerably, halving
the execution time on some adapters.
= Backwards Compatibility
* Because Model.load is now an alias for .call, plugins should no
longer override load. Instead, they should override .call.
* Loading model objects from the database no longer calls
Model#initialize. Instead, it calls Model.allocate,
Model#set_values, and Model#after_initialize. So if you were
overriding #initialize and expecting the changes to affect model
objects loaded from the database, you need to change your code.
Additionally, @new is no longer set to false for objects retieved
from the database, since setting it to false hurts performance.
Model#new? still returns true or false, so this only affects you
if you are checking the instance variables directly.
* Dataset#<< no longer returns the autogenerated primary key for the
inserted row. As mentioned above, it now returns self to allow for
chaining. If you were previously relying on the return value,
switch from #<< to #insert.
* Dataset#map no longer calls the row_proc if given an argument, and
Dataset#to_hash no longer calls the row_proc if given two arguments.
This should only affect your code if you were using a row_proc that
modified the content of the hash (e.g. Model#after_initialize). If
you were relying on the old behavior, switch:
dataset.map(:foo)
# to
dataset.map{|r| r[:foo]}
dataset.to_hash(:foo, :bar)
# to
h = {}
dataset.each{|r| h[r[:foo]] = r[:bar]}
h
* Model classes now need to have a dataset before you can define
associations on them.
* Model classes now pass their dataset to Database#schema, instead of
their table name.
* The :eager_block association option (which defaults to the
association's block argument) is now called before the :eager_graph
association option has been applied, instead of after.
* The many_to_many association reflection :qualified_right_key entry
is now a method named qualified_right_key. Switch any
code using association_reflection[:qualified_right_key] to use
association_reflection.qualified_right_key.
* If you are using like on SQLite and Microsoft SQL Server and want
it to be case insensitive, switch to using ilike:
# Case sensitive
DB[:foos].where(:name.like('bar%'))
# Case insensitive
DB[:foos].where(:name.ilike('bar%'))
Sequel now sets the case_sensitive_like PRAGMA to true by default
on SQLite. To set it to false instead, pass the
:case_sensitive_like=>false option to the database when creating it.
* Sequel's alter table emulation on SQLite now renames the current
table then populates the replacement table, instead of
populating the replacement table at a temporary name, dropping
the current table, and then renaming the replacement table.
* The strings 'n' and 'no' (case insensitive) when typecasted to
boolean are now considered false values instead of true.
* The transaction internals had extensive changes, if you have any
code that depended on the transaction internals, it will probably
require changes.
* Using the Sequel::MySQL module settings for convert_tinyint_to_bool
and convert_invalid_date_time now only affects future Database
objects. You should switch to using the per-Database methods
if you are currently using the Sequel::MySQL module methods.
* The customized transaction support in the do (DataObjects) adapter
was removed. All three subadapters (postgres, mysql, sqlite) of
the do adapter implement their own transaction support, so this
should have no effect unless you were using the do adapter with
a different database type.
* The oracle support changed dramatically, so if you were relying
on the internals of the oracle support, you should take extra
care when upgrading.
= Advance Notice
* The next release of Sequel will contain significant changes to
how a dataset is literalized into an SQL string. If you have
a custom plugin, extension, or adapter that overrides a
method containing "literal", "sql", or "quote", or you make
other modifications or extensions to how Sequel currently
literalizes datasets to SQL, your code will likely need to
be modified to support the next release.
Thanks,
Jeremy
* {Website}[http://sequel.rubyforge.org]
* {Source code}[http://github.com/jeremyevans/sequel]
* {Blog}[http://sequel.heroku.com]
* {Bug tracking}[http://github.com/jeremyevans/sequel/issues]
* {Google group}[http://groups.google.com/group/sequel-talk]
* {RDoc}[http://sequel.rubyforge.org/rdoc]
--
Posted via http://www.ruby-forum.com/.