Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help using facets?

0 views
Skip to first unread message

a non y mouse

unread,
Feb 8, 2006, 5:36:34 PM2/8/06
to
i just discovered facets and would like to begin using them, but am
having issues:

require 'facets' works, but i am unable to use anything suggested in the
rdoc or the little stuff i've found online.

based on
<http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/163215>, i
should be able to do

Time.use Facets, :stamp

or

Array.use Facets, :each_permutation

but both give errors:

tinker% !.
/facets.rb
/facets.rb:5: uninitialized constant Facets (NameError)
from ./facets.rb:3
tinker% cat facets.rb
#!/usr/local/bin/ruby

require 'facets'

Time.use Facets, :stamp
tinker%

i do have the gems installed:

tinker% gem list | grep facets
facets (1.0.2)
facets_core (1.0.2)
facets_more (1.0.2)

same thing if i try the Array line. sooo..what gives? i'd really like to
be able to use its Crypt module.

thanks

--
http://forea.ch/

David Vallner

unread,
Feb 8, 2006, 7:52:08 PM2/8/06
to
Dňa Streda 08 Február 2006 23:36 a non y mouse napísal:

> i just discovered facets and would like to begin using them, but am
> having issues:
>
> require 'facets' works, but i am unable to use anything suggested in the
> rdoc or the little stuff i've found online.
>
> based on
> <http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/163215>, i
> should be able to do
>
> Time.use Facets, :stamp
>
> or
>
> Array.use Facets, :each_permutation
>
> but both give errors:
>
> tinker% !.
> ./facets.rb
> ./facets.rb:5: uninitialized constant Facets (NameError)

> from ./facets.rb:3
> tinker% cat facets.rb
> #!/usr/local/bin/ruby
>
> require 'facets'
>
> Time.use Facets, :stamp
> tinker%
>
> i do have the gems installed:
>
> tinker% gem list | grep facets
> facets (1.0.2)
> facets_core (1.0.2)
> facets_more (1.0.2)
>
> same thing if i try the Array line. sooo..what gives? i'd really like to
> be able to use its Crypt module.
>
> thanks

Couldn't reproduce this with whatever ruby there is in the Ubuntu
repositories, latest rubygems, and whatever "gem in -y facets" gets me.

The Facets module does indeed seem to exist, however, my hopes shatter right
after that. Time doesn't have a #use class method, in fact, there is no such
method in the API documentation.

The deprecated method in the documentation doesn't help any either.

How -do- you use this library then?

The website is also in slight need of spellchecking, I wonder if this would be
proper to report via the project bug tracker.

David Vallner

<rant>
PS: Am I the only one slightly irritated by the recent surge of posts from
faked e-mail addresses, and even anonymous ones?
</rant>


a non y mouse

unread,
Feb 8, 2006, 7:59:39 PM2/8/06
to
David Vallner wrote:
> <rant>
> PS: Am I the only one slightly irritated by the recent surge of posts from
> faked e-mail addresses, and even anonymous ones?
> </rant>
>

i'm not anonymous :)

i'll send the maintainer an e-mail asking him what's up. thanks!

--
http://forea.ch/


Trans

unread,
Feb 8, 2006, 10:20:29 PM2/8/06
to
Be sure RUBYOPT="-rubygems" then

require 'facet/time/stamp'

> i'd really like to be able to use its Crypt module.

require 'facet/crypt'

T.

David Vallner

unread,
Feb 9, 2006, 8:51:48 AM2/9/06
to
Dňa Štvrtok 09 Február 2006 04:23 Trans napísal:

Gah. #stamp is an instance method? Ah well, I thought it was a class method
because it would look good in code that way. I should hint the Facets
developers towards that.

So the usage in the announcement from a few months ago didn't describe changs
that were released yet?

David Vallner


Trans

unread,
Feb 10, 2006, 12:32:48 AM2/10/06
to
Is this what you want?

def Time.stamp(*args)
now.stamp(*args)
end

I will add to next version of Facets if so.

T.

David Vallner

unread,
Feb 10, 2006, 8:14:58 AM2/10/06
to
Dňa Piatok 10 Február 2006 06:33 Trans napísal:

Yep, something like that. I have no idea how often people need textual
timestamps of the current date though, so it might not be a particularly
useful addition. It's just the first usage that came to mind when I saw
someone asking about that functionality.

David Vallner


0 new messages