[#329967] Ruby beginner Problem — Zayd Connor <devrubygem@...>

I get the following error message when running the code below:

18 messages 2009/03/01
[#329972] Re: Ruby beginner Problem — lasitha <lasitha.ranatunga@...> 2009/03/01

On Sun, Mar 1, 2009 at 10:46 AM, Zayd Connor <devrubygem@gmail.com> wrote:

[#329973] Re: Ruby beginner Problem — Zayd Abdullah <devrubygem@...> 2009/03/01

Thanks Lasitha that worked perfect. I'm slowly getting more comfortable with

[#329975] Re: Ruby beginner Problem — Justin Collins <justincollins@...> 2009/03/01

Zayd Abdullah wrote:

[#330022] Delegating class methods — abc <arcadiorubiogarcia@...>

Hi all,

17 messages 2009/03/01

[#330038] Rub 1.9: "inline rescue" doesn't work? — Iñaki Baz Castillo <ibc@...>

Hi, is there any explanation for the folowing big difference between the sa=

11 messages 2009/03/01

[#330067] passing a method as a paramter — Sarah Allen <sarah@...>

I'm probably missing some basic Ruby syntax, but I'm relatively new to

13 messages 2009/03/02

[#330097] Compiling a Ruby app — Sharagoz -- <blashyrkh1@...>

Hi

22 messages 2009/03/02
[#330193] Re: Compiling a Ruby app — David Masover <ninja@...> 2009/03/03

Sharagoz -- wrote:

[#330209] expanding environment variable — Daniel Schoch <trash@...>

Hi,

13 messages 2009/03/03
[#330212] Re: expanding environment variable — Dominik Honnef <dominikho@...> 2009/03/03

On [Tue, 03.03.2009 23:28], Daniel Schoch wrote:

[#330246] fixnum problem plz help — Guy Dols <guy_dols@...>

hy

14 messages 2009/03/03

[#330287] Any solutions to Ruby's inconsistencies? — "C. Dagnon" <c-soc-rubyforum@...>

Ruby has definite positives over Java and even other scripting

29 messages 2009/03/04
[#330292] Re: Any solutions to Ruby's inconsistencies? — Yossef Mendelssohn <ymendel@...> 2009/03/04

On Mar 4, 10:02=A0am, "C. Dagnon" <c-soc-rubyfo...@dagnon.net> wrote:

[#330322] Re: Any solutions to Ruby's inconsistencies? — "C. Dagnon" <c-soc-rubyforum@...> 2009/03/04

Yossef Mendelssohn wrote:

[#330388] Re: Any solutions to Ruby's inconsistencies? — Yossef Mendelssohn <ymendel@...> 2009/03/05

On Mar 4, 3:32=A0pm, "C. Dagnon" <c-soc-rubyfo...@dagnon.net> wrote:

[#330401] Re: Any solutions to Ruby's inconsistencies? — "C. Dagnon" <c-soc-rubyforum@...> 2009/03/05

Yossef Mendelssohn wrote:

[#330363] Ruby -Question about Framewroks — jazzez ravi <jazzezravi@...>

Hi All,

12 messages 2009/03/05

[#330383] add a new line after, w/txtfile thats comma delimited — Mmcolli00 Mom <mmc_collins@...>

How do you add a new line after you have split a text file with

16 messages 2009/03/05

[#330387] Ruby - Imperative Language Features? — Mike Stephens <rubfor@...>

The Wikipedia entry for Ruby says:

12 messages 2009/03/05

[#330601] how to un-ragged a 2D array? — Phlip <phlip2005@...>

Rubies:

12 messages 2009/03/07

[#330630] Can I access or find a object from it's instance variable? — Aki Wakabayashi <zzyzx2001@...>

Hello.

14 messages 2009/03/08

[#330638] OO style tutorials? — Paul Archer <paul@...>

I'm pretty new to Ruby, and while I've read (and mostly get) several books

20 messages 2009/03/08

[#330665] What are the 5 most innovative ruby projects/libraries? — Camille Roux <roux.camille@...>

Hi,

27 messages 2009/03/08

[#330701] Ruby OpenGL Gears example that uses shiny and velvet GLSL shaders — Michael Brooks <michael.brooks@...>

Hello:

11 messages 2009/03/09
[#330722] Re: Ruby OpenGL Gears example that uses shiny and velvet GLSL shaders — Matthias Reitinger <reitinge@...> 2009/03/09

Michael Brooks wrote:

[#330718] MacRuby 0.4 — Laurent Sansonetti <laurent.sansonetti@...>

Hi,

17 messages 2009/03/09

[#330954] How Many hours in A day — Zayd Connor <devrubygem@...>

I have a very simple ? How many hours in a day should someone who is new

17 messages 2009/03/11

[#330990] How to read a charecters from and image? — rails and rails only <mjayakumar2k6@...>

16 messages 2009/03/12
[#330993] Re: How to read a charecters from and image? — pjb@... (Pascal J. Bourguignon) 2009/03/12

rails and rails only <mjayakumar2k6@yahoo.com> writes:

[#330994] Re: How to read a charecters from and image? — Redd Vinylene <reddvinylene@...> 2009/03/12

Stop that! He's probably looking to crack CAPTCHAs.

[#331216] does IO.read block? — Michael Malone <michael.malone@...>

Hi All,

16 messages 2009/03/15
[#331218] Re: does IO.read block? — Robert Klemme <shortcutter@...> 2009/03/15

On 15.03.2009 23:02, Michael Malone wrote:

[#331307] Trying to install Fox, FXRuby, and IFMapper on Mac OS X — kpkilburn@...

I can't seem to find a specific answer on this...

12 messages 2009/03/16

[#331326] Dynamically extending modules once they have been included — pete@...373.net

It doesn't seem possible to dynamically extend modules once they have

14 messages 2009/03/17

[#331371] free RAM problem — Edouard Dantes <edrd.dantes@...>

Hi,

14 messages 2009/03/17

[#331411] hpricot 0.7 — _why <why@...>

Please enjoy a succulent, new Hpricot. A bit faster, some Ruby 1.9

25 messages 2009/03/17

[#331476] Complex sort of matrix possible, e.g. like Excel? — RichardOnRails <RichardDummyMailbox58407@...>

Hi,

18 messages 2009/03/18

[#331478] REXML get specific element — Pierre Pat <theyojimbo@...>

All,

15 messages 2009/03/18

[#331568] Modulo ? — Zayd Connor <devrubygem@...>

Maybe i need to get some sleep, but can someone explain how modulos

16 messages 2009/03/19

[#331628] Passing a named function instead of a code block? — Paul Jungwirth <once@9stmaryrd.com>

Hello,

13 messages 2009/03/20
[#331630] Re: Passing a named function instead of a code block? — Matthias Reitinger <reitinge@...> 2009/03/20

Paul Jungwirth wrote:

[#331760] Ruby GUI Libs — ntwrkd <ntwrkd@...>

Is there a nicer GUI framework for Ruby other than RubyGoo?

12 messages 2009/03/21

[#331793] Newbie needs help with first project — Daniel Dale <dochappy@...>

I was told about Ruby several weeks ago and started my journey lol. I've

15 messages 2009/03/22
[#331796] Re: Newbie needs help with first project — Stefan Codrescu <fixxie.wits@...> 2009/03/22

On Sun, Mar 22, 2009 at 9:32 AM, Daniel Dale <dochappy@gmail.com> wrote:

[#331803] convert PNG to hex — jeljer te Wies <jeljer@...>

Hey people! ..

20 messages 2009/03/22

[#331899] Test::Unit - same test, different "args" — "Luke St.Clair" <secureboot@...>

I need to run the same unit test case more than 10 times (around 150

14 messages 2009/03/23

[#331924] Mimic AES_ENCRYPT and AES_DECRYPT functions in Ruby — Felipe Coury <felipe.coury@...>

Hello there!

20 messages 2009/03/24
[#331931] Re: Mimic AES_ENCRYPT and AES_DECRYPT functions in Ruby — gcristelli <giovanni.cristelli@...> 2009/03/24

On 24 Mar, 04:21, Felipe Coury <felipe.co...@gmail.com> wrote:

[#331938] Re: Mimic AES_ENCRYPT and AES_DECRYPT functions in Ruby — Felipe Coury <felipe.coury@...> 2009/03/24

Giovanni / Rob,

[#331940] Re: Mimic AES_ENCRYPT and AES_DECRYPT functions in Ruby — Felipe Coury <felipe.coury@...> 2009/03/24

Some more discoveries...

[#331941] Re: Mimic AES_ENCRYPT and AES_DECRYPT functions in Ruby — Felipe Coury <felipe.coury@...> 2009/03/24

Just as a FYI, it works!!!

[#331948] Re: Mimic AES_ENCRYPT and AES_DECRYPT functions in Ruby — Rob Biedenharn <Rob@...> 2009/03/24

On Mar 24, 2009, at 2:35 AM, Felipe Coury wrote:

[#365126] Re: Mimic AES_ENCRYPT and AES_DECRYPT functions in Ruby — Joshua Mckinney <joshmckin@...> 2010/07/01

Having no luck with this. Getting the following error when generating

[#331930] tagz-5.0.0 — "ara.t.howard" <ara.t.howard@...>

44 messages 2009/03/24
[#332078] Re: [ANN] tagz-5.0.0 — "Andrew S. Townley" <ast@...> 2009/03/25

Hi Ara,

[#332095] Re: [ANN] tagz-5.0.0 — "ara.t.howard" <ara.t.howard@...> 2009/03/25

[#332141] Re: [ANN] tagz-5.0.0 — "Andrew S. Townley" <ast@...> 2009/03/25

On Wed, 2009-03-25 at 23:23 +0900, ara.t.howard wrote:

[#332160] Re: [ANN] tagz-5.0.0 — "ara.t.howard" <ara.t.howard@...> 2009/03/26

[#331971] : HOWTO start irb on a different object — Jeremy Henty <onepoint@...>

I wanted to have irb start its session on an object other than the

10 messages 2009/03/24

[#332023] ruby and 2D graphics — Philip Müller <me@...>

Hi everybody,

22 messages 2009/03/24
[#332029] Re: ruby and 2D graphics — Philip Müller <me@...> 2009/03/24

On Tue, 24 Mar 2009 21:08:34 +0100, Peter Zotov <whitequark@whitequark.ru>

[#332112] Parsing xml — Arun Kumar <arunkumar@...>

Hi,

24 messages 2009/03/25
[#332115] Re: Parsing xml — "Peter Zotov" <whitequark@...> 2009/03/25

Quoting "Arun Kumar" <arunkumar@innovaturelabs.com>:

[#332116] Re: Parsing xml — Arun Kumar <arunkumar@...> 2009/03/25

Peter Zotov wrote:

[#332118] Re: Parsing xml — "Peter Zotov" <whitequark@...> 2009/03/25

Quoting "Arun Kumar" <arunkumar@innovaturelabs.com>:

[#332206] Update latest Ruby Version 1.9 on Mac OSX — Thomas Khaipi <sayakyi@...>

Dear All,

14 messages 2009/03/26

[#332357] testy.rb - ruby testing that's mad at the world — "ara.t.howard" <ara.t.howard@...>

55 messages 2009/03/28
[#332418] Re: testy.rb - ruby testing that's mad at the world — Brian Candler <b.candler@...> 2009/03/29

Ara Howard wrote:

[#332405] Ruby 1.9, OS X, command line: negative string size (ArgumentError) — Bartlomiej Owczarek <bartlomiej@...>

Hello,

13 messages 2009/03/29

[#332474] Symbols garbage collector in Ruby1.9, fixed? — Iñaki Baz Castillo <ibc@...>

Hi, in Ruby 1.8 there is an issue when adding more and more Symbols

27 messages 2009/03/30

[#332520] When to use instance variables @ — Steve Dogers <stevedogers@...>

Hi, I have a couple questions about instance variables in Ruby.

20 messages 2009/03/30

[#332547] Localmemcache-0.2.0: The beauty of memcached. For local data. Blazingly fast. — "Sven C. Koehler" <schween@...>

Hi,

13 messages 2009/03/30

[#332624] Move over, Phusion, here comes the *real* Enterprise Edition! — Jg W Mittag <JoergWMittag+Usenet@...>

Hi!

20 messages 2009/03/31

ANN: Sequel 2.11.0 Released

From: Jeremy Evans <code@...>
Date: 2009-03-02 19:03:27 UTC
List: ruby-talk #330129
Sequel is a lightweight database access toolkit for Ruby.

* Sequel provides thread safety, connection pooling and a concise DSL
  for constructing database queries and table schemas.
* Sequel also includes a lightweight but 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, master/slave
  configurations, and database sharding.
* Sequel makes it easy to deal with multiple records without having
  to break your teeth on SQL.
* Sequel currently has adapters for ADO, DataObjects, DB2, DBI,
  Firebird, Informix, JDBC, MySQL, ODBC, OpenBase, Oracle, PostgreSQL
  and SQLite3.

Sequel 2.11.0 has been released and should be available on the gem
mirrors.  The 2.11.0 release adds numerous improvements:

Optimizations
-------------

* Model.[] was optimized to use static SQL in cases where doing so
  should result in the same output.  This should result in a 30-40%
  performance increase.  Since this can be the most significant or
  only method call in a web application action, this has potential
  to significantly enhance the performance of web application code.

  In order for this optimization to have an effect, you need to
  make sure that you are calling set_dataset with a Symbol and
  not a Dataset object:

    # Optimized:
    class Foo < Sequel::Model; end
    class Foo < Sequel::Model(:foos); end
    class Foo < Sequel::Model
      set_dataset :foos
    end

    # Not Optimized, but otherwise equivalent:
    class Foo < Sequel::Model(Model.db[:foos]); end
    class Foo < Sequel::Model
      set_dataset db[:foos]
    end

* Dataset#literal was refactored for performance reasons to make
  overriding it in subclasses unnecessary.  The changes made result
  in a 20-25% performance increase.  Sequel can spend about 10% of
  it's time in Dataset#literal, so this may be only a 2% overall
  performance improvement.

New Features
------------

* Association datasets now know about the model objects that created
  them, as well as the related association reflection.  This makes
  association extensions much more powerful.  For example, you can
  now create generic association extensions such as:

    module FindOrCreate
      def find_or_create(vals)
        first(vals) || association_reflection.associated_class. \
         create(vals.merge(association_reflection[:key]=> \
           model_object.id))
      end
    end

  The above will work for any standard one_to_many association:

    Artist.one_to_many :albums, :extend=>FindOrCreate
    # Create an album named Foo related to this artist,
    # unless such an album already exists
    Artist.first.albums_dataset.find_or_create(:name=>'Foo')

  Before, the only way to do the above was to use a closure inside
  the :dataset option proc, which couldn't be done generically
  for multiple associations.

* A :conditions association option was added, which allows simple
  filters to be set up without defining :graph_conditions and
  an association block:

    # 2.10.0
    one_to_many(:japanese_verses, :class=>:Verse, \
     :graph_conditions=>{:languageid=>3})do |ds|
       ds.filter(:languageid=>3)
    end
    # 2.11.0
    one_to_many(:japanese_verses, :class=>:Verse, \
       :conditions=>{:languageid=>3})

* A :clone association option was added, which allows you to clone
  an existing association.  This is most useful when you are dealing
  with a legacy schema and had to define the same options redundantly
  for each type of association. You can now do:

    many_to_many :deputies, :class=>:Employee, \
     :join_table=>:employeecurrentaudits, :left_key=>:currentauditid, \
     :right_key=>:employeeid, :order=>[:firstname, :lastname] do |ds|
      ds.filter(:active).filter(:capacity=>1)
    end
    many_to_many :project_managers, :clone=>:deputies do |ds|
      ds.filter(:active).filter(:capacity=>2)
    end
    many_to_many :team_leaders, :clone=>:deputies do |ds|
      ds.filter(:active).filter(:capacity=>3)
    end

  All of the above would use the same :class, :join_table, :left_key,
  :right_key, and :order options.  If you don't provide an
  association block, but you are cloning an association that has one,
  the cloned association's block is used.  You can use the
  :block=>nil option to not use a block even if the cloned
  association has a block.

* Dataset#select, #select_more, #order, #order_more, and #get all
  take a block that yields a Sequel::SQL::VirtualRow instance,
  similar to the behavior of filter. This allows for the easier
  use of SQL functions on Ruby 1.9:

    # 2.10.0
    dataset.select(:prettify.sql_function(:name))
    # 2.11.0
    dataset.select{|o| o.prettify(:name)}

* String#lit can now accept arguments and return an SQL literal
  string.  This allows you to do things that were previously hard
  or at least unnecessarily verbose.  For example, you can now
  easily use the SQL standard SUBSTRING function:

    column = :user
    pattern = params[:pattern]
    dataset.select{|o| o.substring('? from ?'.lit(column, pattern))}

* A validates_inclusion_of validation method was added to Model. You
  can provide a Range or an Array in the :in option to specify the
  allowed values:

    validates_inclusion_of :value, :in=>1..5
    validates_inclusion_of :weekday, :in=>%w'Monday Tuesday ...'

* Dataset#with_sql was added, which returns a copy of the dataset
  with static SQL.  This is useful if you want to keep the same
  row_proc/graph/transform/etc., but want to use your own custom
  SQL.

Other Improvements
------------------

* You can now use Sequel's database independent types when casting:

    dataset.select(:number.cast(String))

  Among other things, the default cast types for cast_string and
  cast_numeric now work in the MySQL adapter.

* Model#set_associated_object was added.  The many_to_one association
  setter method calls it.  This allows you to easily override the
  association setters for all many_to_one associations of a class
  by modifying a single method.

* Typecasting invalid date strings now raises a
  Sequel::Error::InvalidValue instead of an argument error, which
  means that you can use raise_on_typecast_failure = false and not
  have an error raised when an invalid date format is used.

* String#to_sequel_blob was added and should now be used instead
  of String#to_blob.  sqlite3-ruby defines String#to_blob
  differently, which could cause problems.

* Blob columns are now fully supported in the SQLite adapter, with
  the hex escape syntax being used for input, and returning columns
  of type Sequel::SQL::Blob on output.

* The SQLite adapter drop_column support is now significantly more
  robust.

* The SQLite adapter now supports rename_column.

* The MySQL adapter now supports stored procedures with multiple
  arguments.

* The MySQL adapter can now not use a compressed connection to the
  server via the :compress=>false option.

* The MySQL adapter now sets a default timeout of 30 days to the
  database connection, you can change it via the :timeout option,
  which accepts a number of seconds.

* The MySQL adapter now sets SQL_AUTO_IS_NULL to false by default,
  you can use the :auto_is_null=>true option to not do this.

* The MySQL adapter now sets the encoding option on the database
  connection itself, so it works across reconnects.

* Sequel itself no longer uses String#lit or Symbol#* internally, so
  it shouldn't break if another library defines them.

* The default index name is now generated correctly if a non-String
  or Symbol column is used.

* Some ruby -w warnings have been fixed.

* INSERTs are now sent to the master database instead of the slave
  database(s) if using a master/slave database configuration and
  PostgreSQL 8.2+ or Firebird.

* DateTime literalization has been fixed in the Firebird adapter.

* Date literalization has been fixed in the H2 JDBC subadapter.

* Release notes for versions from 1.0 to the present are now included
  in the Sequel repository and the RDoc documentation, see
  http://sequel.rubyforge.org/rdoc/files/doc/release_notes/

Backwards Compatibilty
----------------------

* The optimization of Model.[] may break if you modify the model's
  dataset behind its back.  Always use Model.set_dataset if you
  want to change a Model's dataset.

* Sequel::Dataset::UnsupportedExceptIntersect and
  Sequel::Dataset::UnsupportedExceptIntersectAll will now only be
  defined if you are using an adapter that requires them.

* The private Model#cache_delete_unless_new method has been removed.

* Sequel::SQL::IrregularFunction was removed, as it was a bad hack
  that is not used by Sequel anymore.  Unless you were instantiating
  it directly or using a plugin/extension that did, this shouldn't
  affect you.  Using a Sequel::SQL::Function with a
  Sequel::SQL::PlaceholderLiteralString is recommended instead, see
  the substring example above.

Thanks,
Jeremy

* {Website}[http://sequel.rubyforge.org]
* {Source code}[http://github.com/jeremyevans/sequel]
* {Bug tracking}[http://code.google.com/p/ruby-sequel/issues/list]
* {Google group}[http://groups.google.com/group/sequel-talk]
* {RDoc}[http://sequel.rubyforge.org/rdoc]
-- 
Posted via http://www.ruby-forum.com/.

In This Thread

Prev Next