<glasswax>
hello, ruby novice here. i have a quick question about ruby version management if anyone has a moment.
diegoviola has quit [Ping timeout: 245 seconds]
daidoji has quit []
<wallerdev>
feel free to just ask your q glasswax
<glasswax>
i use osx, but i installed ruby 1.9.3 with brew. when i run bundle install on a project, it returns a syntax error related to the gemfile using a : for hashes
<glasswax>
which i know is a feature of 1.9.3
<glasswax>
when i run ruby -v
<glasswax>
it says i have ruby 1.9.3
<glasswax>
`which ruby` points to the brew version
joshw701 has joined #ruby-lang
<glasswax>
everything on google points to it being an issue with ruby 1.8 hitting the : hashes, but it would seem i have ruby 1.9
<glasswax>
wondering if anyone has an idea
<glasswax>
thanks
titaniumNoob has joined #ruby-lang
<bnagy>
use rbenv
<bnagy>
I normally replace / rename the system ruby stuff on osx, just in case
<bnagy>
although in theory you should never hit it
<glasswax>
`rbenv global` spits back 1.9.3-p125
wmoxam has quit [Ping timeout: 268 seconds]
<bnagy>
then check your shell, check your path, remove / rename the system ruby (or symlink it)
<bnagy>
and then go looking for bundler bugs if none of that works I guess
<bnagy>
I know 0 about bundler, sry
<glasswax>
alright i'll give it a shot
<glasswax>
thanks
<glasswax>
gem seems to be using /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby according to the logs
<glasswax>
haven't encountered that before
wmoxam has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
<bnagy>
are you running something as root?
<bnagy>
and do you get a correct 'which gem' as yourself?
<glasswax>
which gem tells me `/usr/local/bin/gem`
totallymike has quit [Ping timeout: 245 seconds]
<glasswax>
not running it as root
<bnagy>
ok well that's wrong
<bnagy>
you must not have rbenv set up correctly
<glasswax>
hm ok
savage- has quit [Remote host closed the connection]
<glasswax>
what should it say?
<bnagy>
ensure that your path is correct and that you did rbenv rehash etc
<bnagy>
/Users/whoever/.rbenv/shims/gem or something
<glasswax>
gotcha
<glasswax>
does rbenv conflict with brew?
<glasswax>
brew-installed ruby that is
<bnagy>
shouldn't
<glasswax>
ok thanks
<bnagy>
but your ~/.rbenv should be ahead of system dirs in your path
titaniumNoob has quit [Ping timeout: 264 seconds]
savage- has joined #ruby-lang
titaniumNoob has joined #ruby-lang
ilyam has quit [Quit: ilyam]
titaniumNoob has quit [Read error: Connection reset by peer]
Doug__ has joined #ruby-lang
Doug__ has quit [Remote host closed the connection]
t23010 has quit [Remote host closed the connection]
t20669 has joined #ruby-lang
ryanf has quit [Quit: leaving]
burgestrand has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
adambeynon has joined #ruby-lang
<lake>
bnagy: i dunno, this csv is fucking massive, 33000 lines, not well formatted. :(
<lake>
but it does consistantly have columns that are empty
<lake>
which i am hoping to get rid of
<bnagy>
how does the size of it make any difference to deleting a column?
nXqd has joined #ruby-lang
<bnagy>
csv_table.by_col!.delete 4
<bnagy>
or csv_table.delete 'unused_col'
yats has joined #ruby-lang
andoyasushi_ has joined #ruby-lang
saxy has joined #ruby-lang
andoyasushi has quit [Ping timeout: 240 seconds]
andoyasushi has joined #ruby-lang
<lake>
bnagy: hmm. how do i instanciate a CSV::Table?
saxy has quit [Ping timeout: 245 seconds]
<bnagy>
it's what you should get when you use csv
<mfn>
Darn. Why does Ruby on Windows generate file and path names with forward slashes which other Windows application may not consume O_o
<bnagy>
via parse or new or whatever
tjadc has joined #ruby-lang
andoyasushi_ has quit [Ping timeout: 265 seconds]
joshw701 has quit [Remote host closed the connection]
josh^ has quit [Remote host closed the connection]
JoshWines has quit [Remote host closed the connection]
<Mon_Ouie>
mfn: What applications can't use forward slashes in paths?
<bnagy>
mfn well most can, but yeah it's not ideal
<Mon_Ouie>
Because Windows *does* support them
<bnagy>
Mon_Ouie: not everywhere
<bnagy>
and definitely not in most of the win32api
<mfn>
Mon_Ouie: I used ruby to find me files I pass over to another shell script; which uses commands like "del" which does not accept path names with forward slashes
<mfn>
so, del "C:/foo.txt" does not work, but del "C:\foo.txt" does
rue|w has joined #ruby-lang
<bnagy>
File.split(fn).join "\\"
joshw957 has quit [Remote host closed the connection]
<bnagy>
or just rewrite the whole thing in ruby \o/
ryanf has joined #ruby-lang
<Mon_Ouie>
The problem with file split is that it always returns only two elements
<Mon_Ouie>
(the dirname and the basename)
JoshWines has joined #ruby-lang
<mfn>
The "other end" is under my jurisdiction, so to say. I find it weird to work with a language under an environment which does generate filenames which are basically not generally consumable on the OS. :/
<lake>
bnagy: meh, i just get undefined method `encode' for nil:NilClass
<bnagy>
Mon_Ouie: ugh good point
<mfn>
s/is under/is not under/
<bnagy>
mfn: they're definitely consumable to the OS
<bnagy>
just not all the apps / DLLs :)
<mfn>
bnagy: well, minor nit on the term
<bnagy>
but yeah I have often wondered why you would have things like File.join, designed for OS independence and then never redefine the separator
<mfn>
I usually don't do Ruby stuff on Windows, so I'll just walk away from this. But it feels just so weird.
<bnagy>
I am betting bits of ruby / gems would break
<bnagy>
mfn: just split and join
<bnagy>
or tr
<mfn>
bnagy: its not like I couldn't solve it ;) its that the developer has to take extra care because of this behaviour
<bnagy>
patches welcome
<mfn>
Well, on to more interesting topic :) Any idea, what the difference in Nokogiri of node methods #content #text and #inner_text is supposed to be? Documentation is sparse (== empty for some of them) and get the feeling the do the same ... but I'm unsure
<lake>
bnagy: looks like i have to pass in headers.
<mfn>
bnagy: hehe, not for all the money in the world :p
<bnagy>
lake: did you try to delete an index without setting by_col! ?
workmad3 has joined #ruby-lang
burgestrand1 has joined #ruby-lang
tenderlove has joined #ruby-lang
banisterfiend` has joined #ruby-lang
kitallis has joined #ruby-lang
burgestrand has quit [Ping timeout: 245 seconds]
burgestrand has joined #ruby-lang
cantonic has quit [Quit: cantonic]
burgestrand1 has quit [Read error: Connection reset by peer]
tenderlove has quit [Remote host closed the connection]
solars has joined #ruby-lang
vlad_starkov has joined #ruby-lang
t20669 has quit [Remote host closed the connection]
t78008 has joined #ruby-lang
Criztian has joined #ruby-lang
dc5ala has joined #ruby-lang
<mfn>
sources say, alias :text :content and alias :inner_text :content ; well, that explains it
IPGlider has joined #ruby-lang
rue|w has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 268 seconds]
dhruvasagar has joined #ruby-lang
ghanima has quit [Ping timeout: 244 seconds]
<yorickpeterse>
Morning
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
<lake>
bnagy: yeah, nothing is working for. i have reduced to problem set to an easy csv: "Header,Header2,Header3,\nFoo,Bar,Baz,". I expect my new csv to be written as "Header,Header2,Header3\nFoo,Bar,Baz"
<lake>
the last column should be deleted.
<lake>
i have yet to find a simple way to achieve this...
qwerxy has quit [Quit: offski]
mytrile has joined #ruby-lang
tenderlove has quit [Ping timeout: 265 seconds]
ddfreyne has quit [Excess Flood]
ddfreyne has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 268 seconds]
dhruvasagar has joined #ruby-lang
t92376 has quit [Remote host closed the connection]
t44656 has joined #ruby-lang
solars has quit [Ping timeout: 244 seconds]
sepp2k has joined #ruby-lang
robotmay has joined #ruby-lang
ryanf has quit [Quit: leaving]
<bnagy>
lake: well you need to operate on a table
<bnagy>
on a quick skim I can only see an easy method for reading from a file CSV.table, but it must be possible
ramonmaruko has quit [Remote host closed the connection]
cdt has joined #ruby-lang
ramonmaruko has joined #ruby-lang
<lake>
bnagy: this hackery is working. it makes me sick though
<lake>
deletes all columns that are empty and all rows that are empty
<bnagy>
that's just working on an array or arrays
<bnagy>
may as well not use CSV :(
<bnagy>
but I can definitely see your point.. I can't find an obvious way to get a CSV::Table from a string
<lake>
yeah, it's way faster than loading it up in csv objects. 65000 lines takes a long time like that. this works unforutnately
<bnagy>
although I haven't searched very hard
<lake>
i have and it has driven to the point of doing the above.
<lake>
lol
<lake>
sick i know, but faster to type that than find the correct CSV/FasterCSV incantation.
CapnKernul has quit [Quit: Leaving...]
schroedinbug has quit [Ping timeout: 244 seconds]
solars has joined #ruby-lang
rue|w has joined #ruby-lang
<lake>
bnagy: that's not to say i didn't try. i spent the last hour screwing with it and started to want to smash things so i tried something else that "just worked"
gnufied has joined #ruby-lang
zmack has quit [Remote host closed the connection]
zmack_ has joined #ruby-lang
saxy has joined #ruby-lang
rue|w has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby-lang
saxy has quit [Ping timeout: 245 seconds]
Quatrerwin has quit [Ping timeout: 260 seconds]
<mfn>
can I create a new scoped variable with pry-debugger which will be available when I 'next'?
<banisterfiend>
mfn: what do u mean
<banisterfiend>
like a global?
<mfn>
banisterfiend: I wrote "foo = node.parent" in pry; then "foo" inspects the variable; then I entered 'next' and "foo" wasn't available anymore
savage- has quit [Ping timeout: 246 seconds]
<banisterfiend>
mfn: use globals instead $foo = node.parent
SuperTaz has quit [Ping timeout: 268 seconds]
andoyasushi_ has joined #ruby-lang
<mfn>
banisterfiend: awesome!
<erikh>
w/ 4
andoyasushi has quit [Ping timeout: 256 seconds]
Musfuut has quit [Read error: Operation timed out]
goshakkk has joined #ruby-lang
cschneid has quit [Ping timeout: 246 seconds]
<matti>
;]
yats has quit [Quit: Leaving]
mytrile has quit [Remote host closed the connection]
yats has joined #ruby-lang
andoyasushi_ has quit [Ping timeout: 244 seconds]
qwerxy has joined #ruby-lang
schroedinbug has joined #ruby-lang
workmad3 has quit [Ping timeout: 265 seconds]
t44656 has quit [Remote host closed the connection]
stayarrr has joined #ruby-lang
t46947 has joined #ruby-lang
gentz_ has joined #ruby-lang
injekt_ has joined #ruby-lang
bluemonk_ has joined #ruby-lang
agib has quit [Ping timeout: 240 seconds]
imajes has quit [Ping timeout: 240 seconds]
mrodrigues has quit [Ping timeout: 240 seconds]
injekt has quit [Ping timeout: 240 seconds]
spuk has quit [Ping timeout: 240 seconds]
kuja has quit [Ping timeout: 240 seconds]
gentz has quit [Ping timeout: 240 seconds]
dvorak has quit [Ping timeout: 240 seconds]
threedaymonk has quit [Ping timeout: 240 seconds]
bfreeman has quit [Ping timeout: 240 seconds]
manuw has quit [Ping timeout: 240 seconds]
bluemonk has quit [Ping timeout: 240 seconds]
rhizmoe has quit [Ping timeout: 240 seconds]
ahf has quit [Ping timeout: 240 seconds]
manuw has joined #ruby-lang
Guest26352 has quit [Excess Flood]
DEac- has quit [Ping timeout: 240 seconds]
ironcamel has quit [Ping timeout: 240 seconds]
Guedes0 has joined #ruby-lang
ironcamel has joined #ruby-lang
agib has joined #ruby-lang
rhizmoe has joined #ruby-lang
ahf has joined #ruby-lang
ahf has quit [Changing host]
ahf has joined #ruby-lang
threedaymonk has joined #ruby-lang
dvorak has joined #ruby-lang
mrodrigues has joined #ruby-lang
DEac- has joined #ruby-lang
spuk has joined #ruby-lang
imajes has joined #ruby-lang
kuja has joined #ruby-lang
runeb has joined #ruby-lang
rohit has joined #ruby-lang
Quatrerwin has joined #ruby-lang
Quatrerwin has quit [Changing host]
Quatrerwin has joined #ruby-lang
floyd2 has joined #ruby-lang
t46947 has quit [Remote host closed the connection]
t55075 has joined #ruby-lang
dhruvasa1ar has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 244 seconds]
mytrile has joined #ruby-lang
rohit has quit [Ping timeout: 264 seconds]
andoyasushi has joined #ruby-lang
saxy has joined #ruby-lang
Leeky_afk is now known as Leeky
dhruvasa1ar has quit [Ping timeout: 244 seconds]
saxy has quit [Ping timeout: 264 seconds]
SuperTaz has joined #ruby-lang
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
dhruvasagar has joined #ruby-lang
bytephilia has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
cschneid has joined #ruby-lang
andoyasushi has quit [Ping timeout: 265 seconds]
Musfuut has joined #ruby-lang
Musfuut is now known as Guest24624
Leeky is now known as Leeky_afk
injekt_ has left #ruby-lang [#ruby-lang]
injekt has joined #ruby-lang
s1n4 has joined #ruby-lang
s1n4 has quit [Client Quit]
Guest24624 is now known as Musfuut
bytephilia has quit [Quit: Computer has gone to sleep.]
<deryl>
is the activesupport non-use because its a gem from rails, or because the desire is to implement the capabilities it provides using the core/stdlib of ruby *only* (as in yeah you can extend with this gem, but lets see if we can do it using *just* ruby core and stdlib)
<deryl>
the last i understand, the first i don't so just wondering
t15366 has quit [Remote host closed the connection]
<gnufied>
deryl: I think a lot of bad blood is because, earlier when you used to require activesupport, suddenly you had zillions of new methods on ruby core classes.
<gnufied>
now of course, they have made more granular requiring possible.
<gnufied>
so, I think it is not so bad
<deryl>
gnufied: i believe thats called monkey patching correct?
<gnufied>
I never patched a money sir. ask dhh.
<mfn>
deryl: yes, it is
<deryl>
(i didn't hear that term until i got into ruby and still not sure of its usage pattern)
<deryl>
ok, so i did surmise its usage correctly.
thisirs has joined #ruby-lang
<mfn>
jup
<banisterfiend>
it just means to add/remove/modify methods on a class defined by another library
<mfn>
In ruby 2.0.0 they introduced refinements; a way to limit the scope of monkey patching because sometimes it can be problematic
<mfn>
but currently it's unknown if they will stay
<deryl>
yeah remember reading an article on Refinement
<deryl>
think it was in Ruby Weekly iirc
CarlB_the_great has joined #ruby-lang
totallymike has quit [Quit: WeeChat 0.3.7]
bytephilia has quit [Quit: Computer has gone to sleep.]
mytrile has quit [Remote host closed the connection]
statbit has joined #ruby-lang
yats has quit [Read error: Connection reset by peer]
stayarrr has quit [Quit: Leaving...]
yats has joined #ruby-lang
ioga_wrk has quit [Ping timeout: 252 seconds]
ioga_wrk has joined #ruby-lang
tenderlove has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<mfn>
Is rubys -w meant to be used? In practive it seems useless to me
tenderlove has quit [Ping timeout: 265 seconds]
<gnufied>
it is quite useful and highly recommended at least when you are running ruby apps locally etc
KINGSABRI has joined #ruby-lang
<gnufied>
why do you think, it is useless?
<mfn>
I cannot remember writing anything without libraries; it seems I've hundreds of warning lines because of external libraries
t74575 has quit [Remote host closed the connection]
<mfn>
gnufied: because once I activate it hundreds if not thousands of warning from libraries I use scroll over my screen; can't even properly see my own output :(
t81847 has joined #ruby-lang
yats has quit [Read error: Connection reset by peer]
<mfn>
See http://pastie.org/4616293 for a sample; and this is just from the terminal, without scrolling back
Leeky_afk is now known as Leeky
bryancp has quit [Remote host closed the connection]
saxy has joined #ruby-lang
<KINGSABRI>
Hello everybody
<KINGSABRI>
I found a solution for keeping pty + channel open then change directories here :: http://pastebin.com/BR0mYijd
<KINGSABRI>
the main issue now is ,, script keep repeat sending the commands to stdin of remote host without existing
<KINGSABRI>
of course that should happen because nothing tilling channel to exist but when I use ".close" it execute nothing !!
JoshWines has quit [Ping timeout: 245 seconds]
<KINGSABRI>
also I tried with eof! ,, it shows error
ricardovaleriano has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
macmartine has joined #ruby-lang
t9829 has quit [Remote host closed the connection]
diegoviola has quit [Quit: Reconnecting]
t58753 has joined #ruby-lang
diegoviola has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
elux has joined #ruby-lang
ricardovaleriano has joined #ruby-lang
Leeky_afk is now known as Leeky
Leeky is now known as Leeky_afk
Leeky_afk is now known as Leeky
ramonmaruko has joined #ruby-lang
Guest77283 has joined #ruby-lang
ricardovaleriano has quit [Remote host closed the connection]
Guest77283 has quit [Read error: Connection reset by peer]
Guedes0 has joined #ruby-lang
Virunga has joined #ruby-lang
stayarrr has joined #ruby-lang
stayarrr has quit [Client Quit]
deryldoucette has joined #ruby-lang
gix has quit [Quit: Client exiting]
JustinCampbell has joined #ruby-lang
deryl has quit [Ping timeout: 245 seconds]
deryldoucette is now known as deryl
gix has joined #ruby-lang
tjadc has joined #ruby-lang
t58753 has quit [Remote host closed the connection]
t83945 has joined #ruby-lang
jxie has joined #ruby-lang
qpingu has joined #ruby-lang
alvaro_o_ has joined #ruby-lang
kvirani has joined #ruby-lang
ricardovaleriano has joined #ruby-lang
ricardovaleriano has quit [Remote host closed the connection]
alvaro_o has quit [Ping timeout: 260 seconds]
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
nXqd has quit [Ping timeout: 240 seconds]
vlad_sta_ has quit [Remote host closed the connection]
totallymike has quit [Quit: WeeChat 0.3.7]
alex_kira has quit [Remote host closed the connection]
alex_kira has joined #ruby-lang
workmad3 has quit [Ping timeout: 264 seconds]
JustinCampbell has quit [Remote host closed the connection]
JustinCampbell has joined #ruby-lang
JustinCampbell has quit [Remote host closed the connection]
s1n4 has joined #ruby-lang
dhruvasagar has joined #ruby-lang
abuiles has joined #ruby-lang
alex_kir_ has joined #ruby-lang
erichmenge has joined #ruby-lang
alex_kira has quit [Ping timeout: 264 seconds]
havenn has joined #ruby-lang
kith_ is now known as kith
m3nd3s_ has joined #ruby-lang
havenn has quit [Ping timeout: 246 seconds]
m3nd3s has quit [Ping timeout: 246 seconds]
t83945 has quit [Remote host closed the connection]
t87451 has joined #ruby-lang
qwerxy has quit [Ping timeout: 244 seconds]
naz has quit [Read error: Connection reset by peer]
rippa has quit [Ping timeout: 244 seconds]
rippa has joined #ruby-lang
<eam>
I have a bit of code which defines a sort function such that if the input array contains Hashes it does something, if it contains Symbols it does something else, and so on
<eam>
if it doesn't recognize the class of objects being sorted, it falls back to a <=> b
<eam>
it does NOT recognize Array, and this falls through, so you end up comparing two array objects with <=>, which should fail. However, when I execute this in a larger body of ruby code, it succeeds
<eam>
where can I start digging, to figure out what was done so that Array can be used with <=> ?
rue_XIV has left #ruby-lang [#ruby-lang]
t87451 has quit [Remote host closed the connection]
rue has joined #ruby-lang
<rue>
Why should Array#<=> fail?
t45342 has joined #ruby-lang
<eam>
hm, that's a good question. What I see is: -:17:in `<=>': undefined method `<=>' for :type:Symbol (NoMethodError)
<eam>
but, they are Array
<Defusal_>
Does anyone know of a gem that can convert unicode to the UTF-8 equivalent? such as converting “ and ” to "
<Defusal_>
does anyone know what \x93 and \x94 is?
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
zommi has joined #ruby-lang
<Defusal_>
because i assumed they were the unicode equivalent of open " and close ", which is what they are visually, but they sure don't convert from unicode
Dreamer3 has quit [Ping timeout: 245 seconds]
<eam>
rue: yes 1.8 unfortunately. The app has a particular ruby which I cannot change easily
t45342 has quit [Remote host closed the connection]
<eam>
rue: but, I'm not having the trouble with Symbol -- it's with Array
t899 has joined #ruby-lang
<rue>
eam: So, your problem is that Array#<=> ends up using the same on its elements
<eam>
ah!
<eam>
so my arrays contain symbols
<eam>
rue: so here's the real question: how the heck is this working when run inside the application?
<eam>
it must define <=> for Symbol, right?
<injekt>
what application?
<eam>
puppet
<injekt>
ah I've never used it thankfully
<eam>
lucky you!
<injekt>
anyway ruby defines <=> for symbol
<eam>
injekt: in 1.8?
Dreamer3__ has joined #ruby-lang
<injekt>
ah no, who uses 1.8 jeez
stepnem has joined #ruby-lang
<injekt>
1.8 symbols have very little functionality, 1.9 adds a load of string esque methods
<eam>
pretty much every distro, and the puppet rpms :(
<eam>
yeah I have learned how terrible 1.8 is
<injekt>
so define it yourself?
diegoviola has quit [Quit: leaving]
<eam>
injekt: so the context is that I need to understand the behavior of this function and replicate it (for integration testing)
<eam>
what I'd like to do is figure out where in the puppet codebase it is defining Symbol#<=>
<rue>
I’m not sure I really see the entire point of that sort anyway.
lcdhoffman has quit [Quit: lcdhoffman]
<eam>
rue: it's bad code
<eam>
not my code
CoverSlide has quit [Read error: Operation timed out]
naz has joined #ruby-lang
<eam>
but, I am tasked with testing it
<eam>
(as a first step towards replacing it)
<injekt>
def <=>(one, two); one.to_s <=> two.to_s; end probably
<injekt>
well
<injekt>
self
<injekt>
etc
<injekt>
you get the point
<eam>
yeah I'm grepping around or def <=>
<injekt>
doesn't puppet have docs?
<eam>
found it
<eam>
injekt: not for internals it seems
<eam>
buried in facter/util/plist/generator.rb
<injekt>
so why not just convert them to strings
<eam>
injekt: apparently that's what this does, so I can do the same
slyphon has quit [Quit: WeeChat 0.3.7]
<eam>
but I have to ensure identical behavior
<injekt>
heh
<injekt>
your job sounds fun :D
slyphon has joined #ruby-lang
Dreamer3__ has quit [Ping timeout: 268 seconds]
diegoviola has joined #ruby-lang
<eam>
it's rewarding throwing away bad implementations, the problem is I'm not super great with ruby