Kouhei Sutou | 10 Feb 04:19
Favicon
Gravatar

[ANN] test-unit 2.4.7

Hi,

test-unit 2.4.7 has been released.

Web: http://test-unit.rubyforge.org/#test-unit
Install: gem install test-unit

Description:

test-unit is a testing framwork that improves Test::Unit
bundled in Ruby 1.8.x.

Ruby 1.9.x bundles minitest not Test::Unit. Test::Unit
bundled in Ruby 1.8.x had not been improved but unbundled
Test::Unit (test-unit) is improving actively.

Highlights:

            Recommended require style is changed

We changed recommended require style.

Old recommended style:

  gem "test-unit"
  require "test/unit"

New recommended style:  

  require "test-unit"
(Continue reading)

Steve Johnston | 10 Feb 03:51
Picon

RubyGems Sporadic Weirdness

I've been chasing my tail on this problem for a couple days now and its
further away than ever. I am running a Rails 3.1, Ruby

1.9, Gem 1.8.15, Linux RHEL 4 environment.

The simplified problem is that ruby 'require' (and rails) can't find all
the gems my app needs. And it seems that the gems require can't find
have a gem name different than the *.rb. For example, "require 'sass'"
locates sass.rb. But "require 'therubyracer'" fails to locate the v8.rb
inside the lib. There is no file called 'therubyracer.rb'. Same with
'therubyrhino' -
there is no'therubyrhino.rb' but there is a 'rhino.rb' in the lib.

Bundle install does not throw an error even when these gems are in my
Gemfile.

Here is an example:

First, to demonstrate the gem is installed:

  >locate 'rhino.rb'
  /usr/local/lib/ruby/gems/1.9.1/gems/therubyrhino-1.73.1/lib/rhino.rb
  /usr/local/lib/ruby/gems/1.9.1/gems/gems/therubyrhino-1.73.1/lib/rhino.rb

Even though 'therubyrhino' is installed, and in the path, and bundle
worked, 'gem which' cannot find it. And this gem is in the

same path as 'sass', below, which it can find. Here is the error:

gem which 'therubyrhino'
(Continue reading)

Daniel Waite | 10 Feb 02:03
Picon
Gravatar

Bizarre array literal?

ruby-1.8.7-p174 :001 > SOMETHING = 2355, SOMETHING2 = 3453
=> [2355, 3453]

Why?

--

-- 
Posted via http://www.ruby-forum.com/.

Quintus | 9 Feb 22:58
Picon
Gravatar

Ruby C-Extensions: Compile files in subdirectory?


Hi folks,

I’m writing a C extension (it’s actually C++ but that doesn’t matter
for this problem) for Ruby that consists of many files that
are intended to be compiled into a _single_ C extension, not a dozen
ones. To structure the code, I’ve got some subdirectories under the ext/
directory, i.e. my directory structure looks something like this:

/
  ext/
    - extconf.rb
    - my_ext.c
    - my_ext.h
    thing1/
      - thing1.c
      - thing1.h
      - thing1_2.c
      - thing1_2.h
    thing2/
      - thing2.c
      - thing2.h
      thing2_1/
        - something.c
        - something.h

Now, as I said before I want a single C extension "my_ext.so", but I
just can't find out how to instruct mkmf to recognise subdiretories.
It just compiles the files residing in the toplevel directory into
object files, completely ignoring all the subdirectories. So, my
(Continue reading)

Hasmukh Patel | 9 Feb 21:31
Picon
Favicon
Gravatar

While calling module, throwing error

Mymodule.rb

module Mymodule
   def Mymodule.mymessage
      puts "You have four weeks in a month"
   end
end

callingclass.rb

#!/user/bin/ruby
require "Mymodule"
include Mymodule
Mymodule.mymessage

Throwing following error

C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
cannot loa
d such file -- Mymodule (LoadError)
        from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
`require
'
        from callingclass.rb:3:in `<main>'

--

-- 
Posted via http://www.ruby-forum.com/.

Michael Granger | 9 Feb 20:07

[ANN] pg 0.13.0 Released


pg version 0.13.0 has been released!

* <https://bitbucket.org/ged/ruby-pg>

Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/].

It works with {PostgreSQL 8.3 and later}[http://bit.ly/6AfPhm].

A small example usage:

 #!/usr/bin/env ruby

 require 'pg'

 # Output a table of current connections to the DB
 conn = PG.connect( dbname: 'sales' )
 conn.exec( "SELECT * FROM pg_stat_activity" ) do |result|
   puts "     PID | User             | Query"
	result.each do |row|
     puts " %7d | %-16s | %s " %
       row.values_at('procpid', 'usename', 'current_query')
   end
 end

In the near future, I'll also be pushing out new versions of the 'ruby-pg' and 'postgres' gems which point
people to 'pg', as the alternative names are confusing and contain code that hasn't been touched in  4+
years. People with dependencies on the existing code will, of course, continue to be able to install and
use the old versions.

(Continue reading)

Christopher J. B. | 9 Feb 19:17
Picon
Gravatar

Introducing Schizo, A DCI gem

Schizo - DCI (data, context and interaction) for Ruby / Rails /
ActiveRecord.

I've been interested in DCI, but was disappointed when trying to use it
in a typical Rails app (one that uses ActiveRecord).  Often times,
extending a record with methods is not enough; you want to extend a
record with associations, validations, callbacks, etc.  Unfortunately
that information exists in the record's class... so if you modify it,
you modify it for *all* records of that type.  Schizo offers a way to
get around that problem.

Please take a look:  https://github.com/cjbottaro/schizo

The README.rdoc contains a clear an concrete example of the problem
Schizo is trying to solve.

Thanks!

--

-- 
Posted via http://www.ruby-forum.com/.

transfire | 9 Feb 18:51
Picon
Gravatar

[ANN] Bang! Bang! v0.1.0 released

Bang! Bang! 0.1.0 has been released. 

Bang! Bang! provides a dynamic assertions framework utlizing bang methods and built to BRASS standards. 

* home: http://rubyworks.github.com/bang
* code: http://github.com/rubyworks/bang
* bugs: http://github.com/rubyworks/bang/issues
* mail: http://groups.google.com/groups/rubyworks-mailinglist

This is the initial release of Bang. 

Changes: 

* Happy Birthday!

Ralph Shnelvar | 9 Feb 17:55

Difference between return and "not return"

Why is this syntactically valid

def x
  return 1, 2
end

but this isn't

def y
  1, 2
end

Ralph Shnelvar | 9 Feb 17:48

Difference between reurn and "not return"

Why is this syntactically value

def x
  return 1, 2
end

but this isn't

def y
  1, 2
end

transfire | 9 Feb 17:05
Picon
Gravatar

[ANN] BRASS v1.2.1 released

BRASS 1.2.1 has been released. 

BRASS stands for Bare-Metal Ruby Assertion System Standard. It is a very basic foundational assertions
framework for other assertion and test frameworks to make use so they can all work together harmoniously. 

* home: http://rubyworks.github.com/brass
* docs: http://rubydoc.info/gems/brass
* code: http://github.com/rubyworks/brass
* mail: http://groups.google.com/groups/rubyworks-mailinglist

This release adds framework adapters for MiniTest and TestUnit, which allows those frameworks to
recognize BRASS assertions as "failures" rather than as "errors". 

Changes: 

* Add framework adapters for MiniTest and TestUnit.


Gmane