Jeff Miller | 1 Mar 2008 01:01
Picon
Gravatar

Re: Outputting a txt file

Thanks, that worked!
--

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

Tim Ferrell | 1 Mar 2008 01:02
Picon
Gravatar

Re: ruby tk -- how do you get it working?

7stud -- wrote:
> 7stud -- wrote:
>> 
>> I can't find the boms directory:
>> 
>> 
>> I found this though:
>> 
>> /Library/Receipts/Ruby One-Click Installer for OSX Tiger.pkg/Contents$ 
>> ls -al
>> 
>> total 320
>> drwxrwxr-x    6 root  admin     204 Jan 26 23:48 .
>> drwxrwxr-x    3 root  admin     102 Jan 26 23:48 ..
>> -rwxrwxr-x    1 root  admin  151947 Jul  8  2007 Archive.bom
>> -rw-rw-r--    1 root  admin    2211 Jan 26 23:48 Info.plist
>> -rw-rw-r--    1 root  admin       8 Jul  8  2007 PkgInfo
>> drwxrwxr-x   15 root  admin     510 Feb 20 04:12 Resources
>> 
>> ...but Archive.bom isn't a directory.
>> 
> 
> I found the .bom file here:
> 
> /Library/Receipts/Ruby One-Click Installer for OSX 
> Tiger.pkg/Contents/Resources$ ls
> 
> Archive.sizes
> Description.plist
> IFRequirement.strings
(Continue reading)

Matthew D Moss | 1 Mar 2008 01:06
Picon

[QUIZ] Hello, world? (#158)

The three rules of Ruby Quiz 2:
1.  Please do not post any solutions or spoiler discussion for this  
quiz until 48 hours have passed from the time on this message.

2.  Support Ruby Quiz 2 by submitting ideas as often as you can! (A  
permanent, new website is in the works for Ruby Quiz 2. Until then,  
please visit the temporary website at

     <http://matthew.moss.googlepages.com/home>.

3.  Enjoy!

Suggestion:  A [QUIZ] in the subject of emails about the problem  
helps everyone on Ruby Talk follow the discussion.  Please reply to  
the original quiz message, if you can.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Hello, world?

The first program any new programmer typically sees is one that  
prints out "Hello, world!" to the console. This tends to be something  
experienced programmers also see when learning a new language. The  
first Hello World program was written in B [1] by Kernighan and  
looked like this:

         main( ) {
             extrn a, b, c;
             putchar(a); putchar(b); putchar(c); putchar('!*n');
         }
(Continue reading)

scootiePuff | 1 Mar 2008 01:10
Picon

rjb load errors, although installed

hallo!

i'm unable to use "require 'rjb'" successfully, although rjb appears
to have installed successfully.

i am using ruby 1.8.6, irb 0.9.5, java 1.5.0, rjb 1.1.2, and os x
10.5.2.

i was able to use the require line just fine via irb:

gir:dev$ which irb
/usr/bin/irb

gir:dev$ irb --version
irb 0.9.5(05/04/13)

gir:dev$ irb
>> require 'rjb'
=> true
>> require 'net/smtp'
=> true
[..]

but i was unable to run the 'require' line from within my own test
script:

gir:dev$ cat ./test.rb
#!/usr/bin/env ruby

require 'rjb'
(Continue reading)

Florian Frank | 1 Mar 2008 01:12
Picon
Picon
Favicon

Re: Monkeypatching is Destroying Ruby

Robert Dober schrieb:
>>  > I'd be at least a little interested in potentially offering developers
>>  > the chance to 'lock' their classes from monkey patches.
>>
>>  There are probably ways around this, but:
>>     
> Hmm I do not think that one can overrule freeze; I never found  a way,
> anyone else?
>   
main>> class A; end
 # => nil
main>> A.freeze
 # => A
main>> class A; def foo;end ;end
TypeError: can't modify frozen class
        from (irb):8
main>> A = A.dup
(irb):9: warning: already initialized constant A
 # => A
main>> class A; def foo;end ;end
 # => nil

This doesn't work, if $SAFE == 4, though.

Xeno Campanoli | 1 Mar 2008 01:25
Picon

Re: Looking for good Ruby and Rails configuration for vim

Martin DeMello wrote:
> On Wed, Feb 27, 2008 at 1:44 PM, Xeno Campanoli <xcampanoli <at> gmail.com> wrote:
>> I am afraid I really like vi, but I would like some syntax highlighting,
>>  indentation, and block skeleton stuff like Dave and David recommend on
>>  page 27 of their agile book.  I wonder if I make a wish here whether
>>  some wonderful guru might post the vim configuration from heaven for
>>  Rails and Ruby???

Thank you for your help.
> 
> first, get the vim-ruby gem:
> 
> gem install vim-ruby
> 
> then go through the following guide and see what else seems useful:
> 
> http://wiki.rubyonrails.org/rails/pages/HowtoUseVimWithRails
> 
> martin
> 
> 

--

-- 
The only sustainable organizing methods focus not on scale,
but on good design of the functional unit,
not on winning battles, but on preservation.

Xeno Campanoli | 1 Mar 2008 01:26
Picon

Re: Looking for good Ruby and Rails configuration for vim

Arlen Cuss wrote:
> I have these set in my local .vimrc:
> 
> set sw=2
> set smartindent
> set smarttab
> 
> It sets two space 'virtual' tabs (so when you hit tab, it inserts two
> spaces, and when you hit backspace on whitespace at the beginning of the
> line, it takes two spaces - series of 8 are converted to real tabs). In my
> global vimrc, these are set:
> 
> syntax on
> set showcmd
> set showmatch
> set smartcase
> set incsearch
> set mouse=a
> 
> This enables syntax highlighting, shows commands as you type them in the
> status bar, highlights matched text as you enter it while searching (with
> `/'), sets the case matching to `smart' (no idea about the semantics, try
> :help smartcase), sets searches to start from where your cursor is, and
> enables mouse usage in consoles that allow it.
> 
> Cheers,
> Arlen.
> 
Thank you also Arlen.

(Continue reading)

Trans | 1 Mar 2008 01:44
Picon
Gravatar

Array#find!

How to remove the first occurrence of something?

  a=[1,2,3,4]
  a.find!{ |e| a==2 }  #=> 2

But there is no #find!, how to define it? My solutions seem unduly
complex.

Thanks,
T.

Arlen Cuss | 1 Mar 2008 01:45
Gravatar

Re: rjb load errors, although installed

Does require 'rubygems' before require 'rjb' fix it?

Arlen
Clifford Heath | 1 Mar 2008 01:45

Re: Monkeypatching is Destroying Ruby

Trans wrote:
> FACETS DOES NOT OVERRIDE ANY BUILT-IN METHODS.

I enjoy using Facets, but it does cause problems in combination
with other common frameworks, particularly Rails. It'd be really
good to see some effort being put to getting common behaviors for
methods provided by commonly-used frameworks. It's not really
enough just to avoid modifying the built-ins.

Someone I helped recently had tried to use Treetop (which uses
Facets) with Rails, and I think it was that works differently.
I found that the size of the collision was very small because
Treetop doesn't use many Facets methods, but in the case of wider
collisions, it could have been very awkward.

It's nice when everything just works, so framework authors should
try for compatibility with other frameworks. Perhaps there's a
case to be made for operating a registry/catalog of core class
extensions made by frameworks that wish to remain compatible?

Clifford Heath.


Gmane