Facets 0.6.3

B

Brian Buckley

------=_Part_3908_13066384.1113834638918
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello,

I am getting an error when I attempt to install the "facets" gem. When I=20
enter

gem install facets

I get the following error message:
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument - llib/facet/nil/empty?

Are others seeing this (or am I guilty of user error)?

Brian

------=_Part_3908_13066384.1113834638918--
 
T

Trans

Hi Brian,

I just tested myself w/o error.

Since RubyGems is throwing the error and not Facets I'm not sure what
the cause is. Have you tried 'gem update --system' to update to the
lastest RubyGems version?

T.
 
B

B. K. Oxley (binkley)

Trans said:
Since RubyGems is throwing the error and not Facets I'm not sure what
the cause is. Have you tried 'gem update --system' to update to the
lastest RubyGems version?

I have the most current RubyGems and I have the same message installing
Facets.


Cheers,
--binkley
 
C

Chad Fowler

Hello,

I am getting an error when I attempt to install the "facets" gem. When I
enter

gem install facets

I get the following error message:
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument - llib/facet/nil/empty?

Are others seeing this (or am I guilty of user error)?

Brian, am I right to guess that you are running Windows? Looks like
Facets has files called, for example, "empty?.rb", which is not valid
on Windows. I don't know of a way that you can get Facets to run on
Windows if that's the case, but perhaps its author has prior
experience making it work.

--

Chad Fowler
http://chadfowler.com
http://rubycentral.org
http://rubygarden.org
http://rubygems.rubyforge.org (over 100,000 gems served!)
 
B

Brian Buckley

------=_Part_3929_7582650.1113837940940
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Thanks T.,

At your suggestion I ran 'gem update --system' but unfortunately that didn'=
t=20
resolve my problem -- I am still seeing the same error.

FWIW I am using RubyGems for a handful of others gems without trouble. In=
=20
case it matters I am on Windows XP SP2, Ruby 1.8.2.

Brian

------=_Part_3929_7582650.1113837940940--
 
B

B. K. Oxley (binkley)

Trans said:
What platform are you running?

Yah, the empty?.rb not a valid file name under Cygwin (Windows) gives
the show away.


Cheers,
--binkley
 
T

Trans

Ah. Thanks Chad. That was what I was starting to conclude myself.

I've tried to keep the file name as close as reasonably possible to the
main method name(s) of the facet. But I know that RDoc via Rake also
chokes on a couple of the names. I think that all modern file systems
now allow fully arbitrary file names (Although there may yet be some
limitations on this I am unaware of.). So the appearent reason is that
quotes aren't being used by programs when they shell out commands. For
instance, the invalid argument above should probably be:

-l"lib/facet/nil/empty?"

Chad, would that fix the problem?

Thanks,
T.
 
B

B. K. Oxley (binkley)

Trans said:
I think that all modern file systems
now allow fully arbitrary file names (Although there may yet be some
limitations on this I am unaware of.).

If that is the case, Windows XP still lacks a modern OS. :) Several
characters are forbidden, among them the question mark, asterisk and
colon. Some of the restrictions are in NTFS and the kernel, some are
part of the Win32 API subsystem.


Cheers,
--binkley
 
A

Austin Ziegler

Ah. Thanks Chad. That was what I was starting to conclude myself.

I've tried to keep the file name as close as reasonably possible
to the main method name(s) of the facet. But I know that RDoc via
Rake also chokes on a couple of the names. I think that all modern
file systems now allow fully arbitrary file names (Although there
may yet be some limitations on this I am unaware of.). So the
appearent reason is that quotes aren't being used by programs when
they shell out commands. For instance, the invalid argument above
should probably be:

You would be wrong.

Windows filesystems do NOT allow a long series of characters
(/:?\<>).

Anyone who names a *file* with a question mark or an asterisk should
simply be shot.

As should anyone who has both a README and a Readme or a Makefile
and a makefile.

-austin
 
T

Trans

Anyone who names a *file* with a question mark or an asterisk should
simply be shot.

Sorry Austin, but that's just a completely asinine statement. First of
all, some might say such things about method names too! --which is what
these file names are based on. Secondly, let's back up a couple decades
and try statements like, "Anyone who names a *file* with more then 8
characters should simply be shot." You may think of filenames as
nothing more the special grepable_computer_ id keys, but the reality is
_people_ have to use them to give documents recognizable names. But
alas as far as I'm concerned we're still in the dark ages when it comes
to managing our data. Why it's not stored in RDBMS yet is beyond me.
Anyhow, this is taking us away from the real issue.

Thanks for the info on the limitations of Window's filenames. I did not
realize they still existed.

So now I have to change the file names. Great! Well, I'll let you all
know when the fixes are uploaded.

Any suggestions on naming these is welcome.

T.
 
B

B. K. Oxley (binkley)

Trans said:
Any suggestions on naming these is welcome.

At least for the cases of foo?-type methods I'd suggest the Schemish
convention of the -p suffix ('p' here stands for predicate), e.g., foo?
=> foo-p. It should work on all platforms and reflects the heritage of
Ruby method names such as using the bang (exclamation mark) suffix for
mutators.


Cheers,
--binkley
 
T

Trans

Thanks Binkley. I'm working on a solution now. So you're suggesting I
use '-p' for '?' and '-x' for '!', I take it? I'm debating either that
or just dropping the '?' and '!' from the file name altogether. I
figure if there are multiple methods of the sort #x and #x? they ought
to be related enough to coexit in the same "atomic" facet file.

The other one I'm not sure about is '[].rb'. Windows does accept this
as a valid file name, but I worry perhaps some other systems may choke
on it. I'm just not sure what to rename it.

Thanks,
T.
 
B

B. K. Oxley (binkley)

Trans said:
Thanks Binkley. I'm working on a solution now. So you're suggesting I
use '-p' for '?' and '-x' for '!', I take it? I'm debating either that

AFAICT the exclamation point is actually ok for filesystems. It's the
question mark which draws trouble, curled in a cipher as it is. So my
suggestion, pending validation on all Ruby platforms, is:

foo! => foo!.rb
foo? => foo-p.rb


Cheers,
--binkley
 
B

B. K. Oxley (binkley)

B. K. Oxley (binkley) said:
foo! => foo!.rb
foo? => foo-p.rb

Of course, a more general and possibly practical suggestion rather than
a table of special cases is to translate punctuation marks into their
ASCII value:

foo! => foo-21.rb
foo? => foo-3f.rb
[] => -5b-5d.rb

Or some similar scheme with a suitable escape marking character (yes,
using the minus sign is kind of lame). But I might be drifting in the
land of excess engineering.


Cheers,
--binkley
 
M

mark sparshatt

B. K. Oxley (binkley) said:
foo! => foo-21.rb
foo? => foo-3f.rb
[] => -5b-5d.rb

Or some similar scheme with a suitable escape marking character (yes,
using the minus sign is kind of lame). But I might be drifting in the
land of excess engineering.

That only works if you don't see any problems telling people that if
they want the redefined [] methods then they need to type

require "-5b-5d"

;-)
 
B

B. K. Oxley (binkley)

mark said:
That only works if you don't see any problems telling people that if
they want the redefined [] methods then they need to type

require "-5b-5d"

Can you not teach require to translate the file names? (I'm too new to
Ruby to know the answer to that. I know I can do it in Perl.)


Cheers,
--binkley
 
M

mark sparshatt

B. K. Oxley (binkley) said:
mark said:
That only works if you don't see any problems telling people that if
they want the redefined [] methods then they need to type

require "-5b-5d"


Can you not teach require to translate the file names? (I'm too new to
Ruby to know the answer to that. I know I can do it in Perl.)

This seems to work, though there's probably a better way to do it

class Object
EscapedChars = ["[", "]", "?", "!"]
alias :eek:ld_require :require

def require(name)
EscapedChars.each do |char|
name = name.gsub(char, "-#{char[0].to_s(16)}")
old_require name
end
end

require "[]" #=> translated to require "-5b-5d"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

facets gem error 3
facet gem versions 2
Gem uninstall local repository? 1
[ANN] fastthread-0.6.3 1
gem install fcgi 5
FreeRIDE problem ("Failing to load") 4
Installing Ruby and Rails on Ubuntu 5
Confirm 0

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top