BoomCow has quit [Quit: This computer has gone to sleep]
<charliesome>
sheerun: unfortunately yes. if you find a torrent anywhere, let me know :p
LouisGB has joined #ruby
<charliesome>
Retistic: i'd say a nice if statement is more clean than any 'clever' tricks
<charliesome>
it's also likely to be negligibly faster
Virunga has joined #ruby
babykosh has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
leonardorb has joined #ruby
slainer68 has quit [Remote host closed the connection]
mahmoudi_ has quit [Quit: Computer has gone to sleep.]
Hanmac1 has joined #ruby
tommyvy__ has quit [Quit: Computer has gone to sleep.]
babykosh has quit [Client Quit]
wargasm has joined #ruby
ananthakumaran has joined #ruby
Hanmac has quit [Ping timeout: 265 seconds]
seich- is now known as Seich
hackerdude has quit [Remote host closed the connection]
love_color_text has joined #ruby
dukedave has quit [Quit: Leaving.]
hotovson has joined #ruby
pcarrier has quit []
himsin has quit [Remote host closed the connection]
mikepack has quit [Remote host closed the connection]
<postmodern>
heftig, isn't that what Array() is for?
Russell^^ has quit [Quit: Russell^^]
<postmodern>
heftig, oh also, in 1.9, * will omit [] and nil
<postmodern>
er map them to empty arguments
mascool has quit [Ping timeout: 251 seconds]
<postmodern>
in 1.8, *nil => nil
hotovson has quit [Read error: No route to host]
yechuah1 has quit [Quit: Leaving.]
<waxjar>
discovering Array() and friends made my code so much tidier
yechuah has joined #ruby
cardoni has joined #ruby
Takehiro has joined #ruby
fred909 has quit [Ping timeout: 260 seconds]
pcarrier has joined #ruby
greg- has joined #ruby
karakedi has joined #ruby
benlieb_ has joined #ruby
benlieb has quit [Read error: Connection reset by peer]
benlieb_ is now known as benlieb
benlieb has quit [Client Quit]
tommyvy__ has joined #ruby
ebobby has joined #ruby
ebobby is now known as Guest42158
cardoni has quit [Ping timeout: 246 seconds]
<danneu>
or stuff like Array.new(10) { rand(6) } #=> [1, 5, 3, 3, ...]
alanjc has joined #ruby
LouisGB has quit [Ping timeout: 265 seconds]
<heftig>
30.times.map { rand(6) }
babykosh has joined #ruby
<charliesome>
enumerator tricks are the best
frem has quit [Quit: Computer has gone to sleep.]
explody has quit [Ping timeout: 264 seconds]
<danneu>
damn. 1 character shorter
<sorbo_>
I just started writing ruby a couple of months ago
<sorbo_>
and I have to say
<sorbo_>
it is an effing delight.
yechuah has left #ruby [#ruby]
<danneu>
sorbo_: did you come from another language
<sorbo_>
danneau: python
Takehiro has quit [Remote host closed the connection]
<danneu>
me too
BrianJ has joined #ruby
explody has joined #ruby
<sorbo_>
I mean
<sorbo_>
python makes a lot of sense to me
<waxjar>
enumerator has so many underused methods
<sorbo_>
but I don't think to myself, "man, I really want to write xyz in python"
<sorbo_>
and I find myself thinking that about ruby
<waxjar>
i recently discovered #one? and #any?
ircmouser has joined #ruby
Guest42158 has quit [Ping timeout: 256 seconds]
cableray has quit [Quit: cableray]
pu22l3r has joined #ruby
pu22l3r has quit [Remote host closed the connection]
mfridh has quit [Ping timeout: 255 seconds]
alvaro_o has quit [Quit: Ex-Chat]
babykosh has quit [Quit: babykosh]
freeayu has joined #ruby
ner0x has quit [Ping timeout: 260 seconds]
swarley has joined #ruby
<sorbo_>
enumerator is awesome
<sorbo_>
I had my ruby epiphany while solving project euler problems
<sorbo_>
and realized how easy they are in ruby
<BrianJ>
whats the best way to pull stuff out of a database and put it in a queue. For instance I'd like to put my user.name for each user in a queue to be processed by a background job. (I realize this isnt a ruby question, but its for a ruby application
iamjarvo_ has quit [Quit: Computer has gone to sleep.]
rohit has quit [Ping timeout: 260 seconds]
arya has quit [Ping timeout: 255 seconds]
stayarrr has quit [Read error: Connection reset by peer]
cardoni has quit [Quit: cardoni]
stayarrr has joined #ruby
stayarrr has quit [Read error: Connection reset by peer]
stayarrr has joined #ruby
arya has joined #ruby
ttt has quit [Ping timeout: 245 seconds]
answer_42 has joined #ruby
stayarrr has quit [Read error: Connection reset by peer]
stayarrr has joined #ruby
olivererxleben has joined #ruby
stayarrr has quit [Read error: Connection reset by peer]
arya_ has joined #ruby
Nisstyre has joined #ruby
arya has quit [Ping timeout: 265 seconds]
danneu has quit [Ping timeout: 248 seconds]
jsilver has joined #ruby
rippa has joined #ruby
ryanlecompte has joined #ruby
arya_ has quit [Ping timeout: 260 seconds]
branon has joined #ruby
ebouchut_ has joined #ruby
ebouchut_ has quit [Client Quit]
ryanlecompte has quit [Ping timeout: 256 seconds]
Slivka has joined #ruby
EyesIsMine is now known as NotEyesIsMine
NotEyesIsMine is now known as EyesIsMine
arya has joined #ruby
medik has quit [Ping timeout: 240 seconds]
Takehiro_ has quit [Remote host closed the connection]
fyolnish has quit [Remote host closed the connection]
hamed_r has joined #ruby
hotovson has joined #ruby
Choobie has joined #ruby
chaplain has joined #ruby
shorne has joined #ruby
faoiseamh has joined #ruby
<faoiseamh>
anyone know mucha bout reading utf-8(chinese) text files, doing some regex, adn writing out an identically encoded file with replacements? - ideally would be great to parse as xml as well but having no luck using nokogiri
cj3kim has joined #ruby
<Hanmac>
depending on your ruby version
slainer68 has joined #ruby
krz has joined #ruby
chaplain has quit [Read error: Connection reset by peer]
replore has joined #ruby
chaplain has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
Slivka has joined #ruby
<faoiseamh>
Hanmac: using 1.9.3 on windows
slainer68 has quit [Ping timeout: 246 seconds]
arya has quit [Ping timeout: 260 seconds]
<apeiros_>
faoiseamh: should not be a problem
<apeiros_>
faoiseamh: can you reduce the issue you face to a small reproduceable case?
Takehiro has joined #ruby
arya has joined #ruby
arietis has joined #ruby
greasegum has quit [Ping timeout: 252 seconds]
Morkel has joined #ruby
<faoiseamh>
apeiros_ just trying to get the basics first - i'm just reading a file and writing hte lines to a new file first to make sure i can read / write and maintain the same encoding
<apeiros_>
faoiseamh: as said, that should not be a problem
<faoiseamh>
output has a bunch of random characters on every other line but otherwise is the same as input - i'll pastebin an example
chaplain has quit [Read error: Connection reset by peer]
<apeiros_>
faoiseamh: # encoding comment is only for string literals in the current file
<apeiros_>
and text in general in that current file (e.g. comments)
Slivka has quit [Read error: Connection reset by peer]
<faoiseamh>
gotchya
Slivka has joined #ruby
<apeiros_>
hm, but your in/output is weird
<apeiros_>
and certainly not due to w vs. wb mode
SiegeX has joined #ruby
<faoiseamh>
yeah very strange
<faoiseamh>
but w vs wb totally fixes it
<apeiros_>
hm
<apeiros_>
funky
<apeiros_>
so much about my "certainly"
fyolnish has quit [Ping timeout: 250 seconds]
<apeiros_>
w vs. wb is only about line endings (\r\n vs \n), and \r has no special meaning in utf-8…
chaplain has quit [Read error: Connection reset by peer]
<faoiseamh>
wonder what it was then
chaplain has joined #ruby
arya has quit []
FredLe has quit [Quit: Leaving.]
<ryanf>
I think wb also forces the output encoding to binary / ascii_8bit
<faoiseamh>
apeiros_: so I'm trying to do some regex matching and running into "invalid byte sequence in UTF-8 (ArgumentError)". I can get it to not throw that by first converting the line I'm reading using line = lineforce_encoding("ISO-8859-1").encode("UTF-8"), but there's still the \0's between each character
<faoiseamh>
line.force*
ircmouser has joined #ruby
ToTo has joined #ruby
<faoiseamh>
so I'm wondering if I have to somehow convert my regex pattern into this UTF-8'sh format or there is some alternative to manually adding a \0 between each standard character
<faoiseamh>
i can pastebin if that isn't clear
krz has quit [Quit: krz]
jarred has quit [Quit: jarred]
lolcathost has quit [Quit: Lost terminal]
lolcathost has joined #ruby
chaplain has quit [Read error: Connection reset by peer]
cj3kim has quit [Quit: This computer has gone to sleep]
Morkel has quit [Quit: Morkel]
<apeiros_>
ryanf: not in 1.9
<apeiros_>
ryanf: doesn't make sense anyway since binary in that case just means "leave as is"
Michael__ has quit [Ping timeout: 248 seconds]
<apeiros_>
faoiseamh: # encoding: utf-8 sets the encoding of the regex literals to utf-8 too
<apeiros_>
alternatively //u
<apeiros_>
but then you can't use literal utf-8 in your code, so the encoding comment is probably rather the tool of choice
chaplain has joined #ruby
FredLe has joined #ruby
<apeiros_>
faoiseamh: you have \0's between *each* character? you sure you have utf-8 and not utf-16?
AxonetBE has joined #ruby
<apeiros_>
that'd explain why a random \r has so much impact…
AxonetBE has quit [Client Quit]
<faoiseamh>
apeiros_ not sure, seems that way though, dont' really know much about encodings
<faoiseamh>
line[/S/u] still throws the same error
<faoiseamh>
to be clear i'm trying to match standard characters in this string that also contains utf-8 chars
<apeiros_>
faoiseamh: what does this print: ruby -e 'p File.read(yourfile, encoding: "binary").unpack("C*").first(40)'
<faoiseamh>
i actually can't even paste the output of one line, stops after first char, but there's a "space" between each
<apeiros_>
that sounds a lot like you're wrong about what encoding you have at hand…
<apeiros_>
"hello" in utf-16 looks like this: "h\0e\0l\0l\0o\0"
<faoiseamh>
just guessing it was utf-8 b/c i thought that was generally what chinese character text would be
<faoiseamh>
that seems to match what i'm seeing
<faoiseamh>
sec and i'll give you the output
<apeiros_>
for chinese, utf-16 makes more sense
<apeiros_>
since almost no char will fit into a 1 byte sequence
icole has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<apeiros_>
ryanf: interesting, the encoding options should override that, though
<apeiros_>
faoiseamh: yeah, see that? first 2 chars are BOM
<apeiros_>
after that you have a null-byte on every second byte
<apeiros_>
definitively utf-8 with a leading BOM
<apeiros_>
gah
<apeiros_>
*definitively utf-16 with a leading BOM
<faoiseamh>
utf-8..
<faoiseamh>
ok :)
chaplain has quit [Read error: Connection reset by peer]
<faoiseamh>
cool so let me try parsing it as that
<apeiros_>
BOM = byte order mark
chaplain has joined #ruby
<apeiros_>
tells you whether it's big-endian or little-endian utf-16 (that's the LE/BE you see in the encoding names)
chaplain has quit [Client Quit]
ananthakumaran1 has joined #ruby
<faoiseamh>
`write': incomplete "\n" on UTF-16 (Encoding::InvalidByteSequenceError)
<faoiseamh>
that's just rewriting same file again
Choobie has quit [Quit: End]
lesnik_ has joined #ruby
<apeiros_>
with utf-16, I'm not sure whether you should still use rb/wb
<apeiros_>
(I hate windows for that stupid distinction…)
Nisstyre has quit [Quit: Leaving]
ananthakumaran has quit [Ping timeout: 246 seconds]
<apeiros_>
faoiseamh: code?
<faoiseamh>
pretty sure still needs to be bin, without I get a ASCII incompatible encoding needs binmode
<apeiros_>
k
<faoiseamh>
hmm that was probably my fault, rewriting minimal simple example seems to work, looking for my bug in my more complex script
<faoiseamh>
i'll try regex'n again and see
<faoiseamh>
thanks so much for the help so far
<faoiseamh>
been banging my head on this for a little while now
Nisstyre has joined #ruby
<apeiros_>
with encodings, the 101 is to know what encoding your input is and what encoding you have to output
<apeiros_>
the rest should actually not be *that* hard.
<faoiseamh>
that was my first mistake
<apeiros_>
problem with knowing the input encoding: you can't programmatically detect it. you must know it.
<faoiseamh>
i tried utf-16 while playing around with it last night based ont he extra space and 8 vs 16
Zai00 has joined #ruby
<apeiros_>
as a human, you can guess, but only because you know what the input should roughly look like, or whether a given representation makes sense. can't tell a computer to do that…
<faoiseamh>
but b/c i wasn't reading as binary or something i think i moved on
<faoiseamh>
cool, i'm learning a lot
ircmouser has quit [Quit: phork]
Retistic has quit [Quit: Retistic]
<faoiseamh>
ahh so readlines doesn't work properly w/ utf-16 it seems
<apeiros_>
you have to provide it the encoding too
<ryanf>
probably r will work if you specify the encoding
<faoiseamh>
so for that I had to specify encoding: 'UTF-16LE', UTF-16 alone didn't work
earthquake has quit [Quit: earthquake]
<ryanf>
ah, makes sense
<apeiros_>
shame
<apeiros_>
so ruby doesn't evaluate the BOM
<faoiseamh>
File.open and then File.read works fine with UTF-16 but File.readlines needs more explicit
<faoiseamh>
interesting
* apeiros_
considers that a bug
<faoiseamh>
seems like it
danneu has joined #ruby
earthquake has joined #ruby
jenrzzz has joined #ruby
shorne has quit [Ping timeout: 260 seconds]
cableray has quit [Quit: cableray]
_nitti has joined #ruby
mengu has joined #ruby
<faoiseamh>
ok so how should I be regexp'n this UTF-16LE data?
adambeynon has joined #ruby
icole has joined #ruby
_nitti has quit [Ping timeout: 246 seconds]
<ryanf>
you can make a regexp whose encoding is utf-16le
jlogsdon has joined #ruby
<faoiseamh>
getting a "incompatible encoding regexp match (US-ASCII regexp with UTF-16LE string) (Encoding::CompatibilityError)" trying to do line[/S/]
Lemtzas is now known as MOBULUS
<faoiseamh>
guess i have to convert input to regex to utf-16le
<apeiros_>
faoiseamh: that means you haven't added the encoding comment :-p
rezzack has quit [Quit: Leaving.]
<faoiseamh>
i did but then it complains at that comment
<apeiros_>
anyway, I think you can have a regex only in binary, utf-8 and some japanese encodings
chaplain has joined #ruby
<apeiros_>
so you'd re-encode the utf-16 you've got to utf-8
<apeiros_>
then work with the utf-8 string and re-encode to utf-16 once you're done (can be handled by the IO)
<apeiros_>
so:
<faoiseamh>
no data will be lost?
<apeiros_>
no, all unicode encodings are capable of the full charset
lesnik_ has quit [Ping timeout: 265 seconds]
<apeiros_>
they just use different escape sequences
<faoiseamh>
why would you use utf-16 at all then?
chaplain has quit [Client Quit]
<faoiseamh>
^curiousity
<apeiros_>
because it's more efficient for certain things
<apeiros_>
see, utf-8 uses 1 byte for all ascii, so it's got only 128 values left for non-ascii
<apeiros_>
take chinese with its thousands of characters…
olivererxleben has quit [Quit: Leaving...]
<apeiros_>
you need like 5 bytes for most of those characters in utf-8
<apeiros_>
while you only need 2 bytes in utf-16
chaplain has joined #ruby
lesnik_ has joined #ruby
<faoiseamh>
so i'm using this to copy some english fields from similar files to their chinese counterparts. I want to do regex on english and chinese files to find field to match by, then get the value from english using regex, then replace the chinese field value w/ english field value
<faoiseamh>
i guess i can find the utf8 value, then encode it to utf-16le and gsub that?
<apeiros_>
o0
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
<faoiseamh>
or i guess i can do it all in utf-8 and then convert the result to utf-16le at the end
<apeiros_>
you can also work entirely in binary. I wouldn't do that, though. but that wouldn't need you to re-encode anything.
ttt has joined #ruby
browndawg has joined #ruby
<faoiseamh>
why wouldn't you do that?
<apeiros_>
yes, that'd be my suggestion
browndawg has quit [Max SendQ exceeded]
<apeiros_>
because it's brittle
Jackneill has joined #ruby
browndawg has joined #ruby
<nyuszika7h>
hi, what is the easiest way for me to get ruby 1.9.3 locally installed (or even globally, but without using testing/sid) on debian squeeze?
browndawg has quit [Max SendQ exceeded]
<faoiseamh>
ok well i'm going forward w/ utf-16 -> 8 -> reshape -> 16 approach
Jackneill is now known as Guest30882
<nyuszika7h>
the latest version (1.9.3-p327) if possible
Slivka has quit [Read error: Connection reset by peer]
<eddie_>
Oh
Slivka has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
ttt has quit [Ping timeout: 276 seconds]
<eddie_>
Are you suggesting me to do it with actual db data
<eddie_>
?
Slivka has joined #ruby
<CamonZ>
eddie_: I thought you were by using create(:transaction)
<CamonZ>
eddie_: are you stubbing the result of Transaction.pending to your factory created instance?
<eddie_>
no
<eddie_>
create is a factory_girl method
<CamonZ>
I mean, it depends on what your test/code is meant to do
<eddie_>
that loads the factory girl definiyion for transaction for the test
<CamonZ>
yes, but create does create on the db the data
<eddie_>
no
<CamonZ>
while build just creates an instance in memory
<eddie_>
its just fakes a db data
<eddie_>
oh
<eddie_>
how can i do that?
<CamonZ>
the difference is that build doesn't call save on the object created
bairui has quit [Quit: WeeChat 0.4.0-dev]
<eddie_>
Transaction.new(..............)
<eddie_>
thats all
<eddie_>
?
<CamonZ>
eddie_: no, the code you're trying to test; from your test I expect that whatever `subject' is it implements a private #find_pending_transaction which should return an_instance_of(Transaction)
<CamonZ>
and said instance should have a status of pending
<CamonZ>
but those are 2 assertions which you should have as separate tests
<CamonZ>
so, your code touches the db
<CamonZ>
you want to test that whatever arel query you're using actually works and returns your expected object
m_3 has quit [Remote host closed the connection]
cableray has quit [Quit: cableray]
<CamonZ>
so, from my set of assumptions of what your code does you want the create
<CamonZ>
instead of build
rjmt___ has joined #ruby
<CamonZ>
an alternative is to assume that your query is good, and just stub the result
<CamonZ>
in that case you can get away with using build
a_a_g has joined #ruby
<CamonZ>
which roughly translates as Transaction.new(attrs) where attrs are built based on your Factory specified with factory girl
rakunHo_ has quit [Remote host closed the connection]
<CamonZ>
eddie_: it comes to mind that you could try to configure your db connection on spec_helper.rb
<CamonZ>
gtg, bbl
akemrir has joined #ruby
atno has quit [Quit: Leaving]
hamed_r has quit [Quit: Leaving]
joppe has quit [Read error: Connection reset by peer]
BoomCow has joined #ruby
Takehiro has quit [Remote host closed the connection]
<Hanmac>
amaya_ do you use the right maker? (the script is made for vxace)
<amaya_>
Yes , I am using Ace .
_nitti has joined #ruby
<Hanmac>
hm what happends if you comment this line out? Object.send(:remove_const, :Scene_Menu)
Banistergalaxy has joined #ruby
<amaya_>
'TypeError occurred. superclass mismatch for class Scene_Menu'
Weazy has quit [Ping timeout: 248 seconds]
<Hanmac>
the problem are maybe addional other scripts change: "Scene_Menu < Scene_Base" to "Scene_Menu < Scene_MenuBase"
<amaya_>
well I will try it out.
_nitti has quit [Ping timeout: 246 seconds]
<amaya_>
It works good. Thank You !
Weazy has joined #ruby
<amaya_>
Object.send(:remove_const, :Scene_Menu) # I don't feel good about this line, does he must write code in this way?
ttt_ has joined #ruby
hamed_r has quit [Ping timeout: 260 seconds]
Virunga has quit [Remote host closed the connection]
<pen>
anyone using mongoid?
<pen>
in mongoid.yml, I noticed that <%= ENV['VARIABLE_NAME'] %> doesn't work as it returns something nil that result in the library spitting errors
<pen>
anyone know why? and how to solve that?
Virunga has joined #ruby
kevinykchan has quit [Ping timeout: 264 seconds]
ttt_ has quit [Ping timeout: 245 seconds]
m_3 has joined #ruby
<Hanmac>
amaya_ i dont think so the remove_const may not needed
icole has quit [Remote host closed the connection]
Guedes has quit [Ping timeout: 245 seconds]
ssspiff has quit [Remote host closed the connection]
lolcathost has quit [Quit: Lost terminal]
blacktulip has joined #ruby
vasile has joined #ruby
ikaros has joined #ruby
<amaya_>
I see.
kevinykchan has joined #ruby
Axsuul has quit [Ping timeout: 264 seconds]
Guest86332 has quit [Quit: leaving]
sspiff has joined #ruby
blaxter has joined #ruby
berserkr has joined #ruby
amaya_ has quit [Read error: Connection reset by peer]
niklasb has joined #ruby
Takehiro has joined #ruby
ssspiff has joined #ruby
ssspiff has quit [Changing host]
ssspiff has joined #ruby
jackbrownhf has joined #ruby
sspiff has quit [Ping timeout: 260 seconds]
Xeago has joined #ruby
replore has joined #ruby
elaptics`away is now known as elaptics
lampe2 has joined #ruby
elkclone has quit [Quit: It's never too late to unplug and run.]
lkba has quit [Ping timeout: 248 seconds]
lolcathost has joined #ruby
Kruptein has joined #ruby
Guedes has joined #ruby
sspiff has joined #ruby
nobuoka has quit [Ping timeout: 260 seconds]
ssspiff has quit [Ping timeout: 248 seconds]
<Kruptein>
Hey I'm new to the language but so far so good but I don't know how to word my current problem for google so I'm asking you guys :) so I have an array [[1,1], [0], [1], [0,1], [0]] and I want it to become a simple array [1,1,0,1,0,1,0] how would I achieve this the best?
generalissimo has quit [Ping timeout: 246 seconds]
bier_ has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
cascalheira has joined #ruby
_nitti has quit [Ping timeout: 260 seconds]
leonardorb has joined #ruby
browndawg has left #ruby [#ruby]
nemesit has quit [Ping timeout: 255 seconds]
<Kruptein>
llllllllllllllllllllllll l l l ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<Kruptein>
woops :/
<Kruptein>
that's what you get when you try to move a laptop with a bunch of things on your keyboard to (another room)
nemesit has joined #ruby
leonardorb has quit [Remote host closed the connection]
ttt_ has joined #ruby
libryder has joined #ruby
ssspiff has joined #ruby
sspiff has quit [Ping timeout: 256 seconds]
<shevy>
Kruptein lol
<shevy>
Kruptein looks like cat sleeping on keyboard
berserkr has quit [Quit: Leaving.]
<shevy>
Xeago are you still trying to perfect your written english style?
cooler has joined #ruby
replore has quit [Remote host closed the connection]
maz-dev__ has quit [Read error: Connection reset by peer]
Zta has joined #ruby
h8R has quit [Ping timeout: 250 seconds]
<Zta>
=)
samphippen has quit [Quit: Computer has gone to sleep.]
arturaz_ has quit [Remote host closed the connection]
xsbeats has quit [Quit: leaving]
xsbeats has joined #ruby
whitedawg has joined #ruby
jds_ has quit [Remote host closed the connection]
dzhulk has quit [Quit: Leaving.]
advorak has quit [Quit: Leaving]
xsbeats has quit [Client Quit]
<Zta>
Sorry for being such a noob, but I'm in need of some very basic help. I'd like to try this https://github.com/leander256/ruby-libappindicator/ so I did "gems install ruby-libappindicator" and Gems started downloading andbuilding glib, pango, and various other packages. It also fetches ruby-libappindicator-0.1.4.gem but fails building (or installing) it: http://pastebin.ubuntu.com/1401997/ Am I doing something wrong?
xsbeats has joined #ruby
dzhulk has joined #ruby
lenovodroid has joined #ruby
hamed_r has quit [Quit: Leaving]
arya has quit [Ping timeout: 260 seconds]
chaosis has joined #ruby
arya has joined #ruby
Gm4n has quit [Ping timeout: 264 seconds]
h8R has joined #ruby
Russell^^ has joined #ruby
LouisGB has quit [Ping timeout: 248 seconds]
Gm4n has joined #ruby
Rydefalk has quit [Read error: Operation timed out]
Rydefalk has joined #ruby
Playground has quit [Quit: Lost terminal]
lolcathost has joined #ruby
acoyfellow has joined #ruby
axl_ has joined #ruby
FredLe has quit [Quit: Leaving.]
axl_ has quit [Client Quit]
ttt_ has joined #ruby
mfridh has quit [Ping timeout: 255 seconds]
jackbrownhf has joined #ruby
yshh has joined #ruby
ttt_ has quit [Ping timeout: 245 seconds]
bluOxigen has joined #ruby
browndawg has joined #ruby
mfridh has joined #ruby
sepp2k has joined #ruby
yshh has quit [Ping timeout: 246 seconds]
lenovodroid has quit [Ping timeout: 260 seconds]
verce has joined #ruby
robustus has quit [Ping timeout: 255 seconds]
yshh has joined #ruby
verce has quit []
nari has quit [Ping timeout: 264 seconds]
robustus has joined #ruby
banisterfiend has joined #ruby
slainer68 has quit [Remote host closed the connection]
<shevy>
Zta apparently it must compile something in that gem
<shevy>
"ERROR: Failed to build gem native extension."
<shevy>
there is not much information what exactly went wrong
<shevy>
Zta what I would do in your case is: change directory to where that .gem file is
<shevy>
then extract it via: 'gem unpack ruby-libappindicator-0.1.4.gem'
<shevy>
then enter that directory and run extconf.rb via "ruby extconf.rb"
<shevy>
that way you will get the precise error
<Elico>
have anyone used EPOLL in ruby somehow?
eldariof has quit [Read error: Connection reset by peer]
Eldariof-ru has joined #ruby
Rym has joined #ruby
Goles has joined #ruby
vlad_starkov has joined #ruby
Tombar has quit [Remote host closed the connection]
Goles_ has joined #ruby
Goles has quit [Read error: Connection reset by peer]
bluOxigen has quit [Ping timeout: 255 seconds]
Neomex has joined #ruby
xelat33 has joined #ruby
Neomex has quit [Client Quit]
xelat33 has left #ruby [#ruby]
gyre007 has joined #ruby
akemrir has quit [Ping timeout: 260 seconds]
jrunning has joined #ruby
techhelp has joined #ruby
tenmilestereo has joined #ruby
kyktommy has joined #ruby
browndawg has left #ruby [#ruby]
jackbrownhf has quit [Quit: Sto andando via]
browndawg has joined #ruby
Morkel has joined #ruby
gyre007 has quit [Ping timeout: 256 seconds]
Morkel has quit [Client Quit]
Goles has joined #ruby
timonv has joined #ruby
Morkel has joined #ruby
Morkel has quit [Client Quit]
kyktommy has quit [Quit: kyktommy]
generali_ has quit [Remote host closed the connection]
bairui has joined #ruby
Morkel has joined #ruby
Goles_ has quit [Ping timeout: 260 seconds]
acoyfellow has quit [Ping timeout: 264 seconds]
whitedawg has quit [Quit: Leaving.]
<bairui>
meh... brain tired. Is there a simple way to achieve: text[vector[0]][vector[1]] ? text is an array of strings and vector is an array of [line, column] offsets in text.
Goles has quit [Ping timeout: 264 seconds]
<apeiros_>
bairui: I don't think there's a simpler way
Goles has joined #ruby
<bairui>
bah. thanks, apeiros_ :) I was hoping that text[vector] or text.vector or something like that might exist.
tk__ has joined #ruby
<apeiros_>
why would it?
<apeiros_>
text is an Array, it isn't aware of your content
<bairui>
of course it wouldn't - i was more hoping for the 'something like' end of the stick
Slivka has joined #ruby
<apeiros_>
you can build a class Text or something, which is aware of the content, and can provide appropriate methods…
<bairui>
some languages allow something similar to what i'm after; just thought ruby might have something like that. a quick browse through the String docs proved unfruitful, so my last hope was to ask here.
<bairui>
yeah, i'll build a class. thanks again, apeiros_
Goles_ has quit [Read error: Connection reset by peer]
jaygen has joined #ruby
Goles_ has joined #ruby
Goles has quit [Ping timeout: 260 seconds]
jlwestsr has joined #ruby
slainer68 has joined #ruby
arya has quit [Ping timeout: 260 seconds]
Goles has joined #ruby
otters has joined #ruby
matrixise has joined #ruby
Goles__ has quit [Ping timeout: 246 seconds]
Electrical has joined #ruby
jaygen has quit [Quit: Leaving...]
Goles_ has quit [Ping timeout: 260 seconds]
Goles has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
Goles has joined #ruby
iamjarvo_ has joined #ruby
<Elico>
I was wondering if someone coded WITH epoll on ruby?
<Electrical>
hi all. is it possible to group an array based on a value from a sub key? if so, how ? :-)
iamjarvo_ has quit [Client Quit]
<shevy>
Electrical you should be able to do any sort of grouping on an array, if you make a proper match
<seydar>
Electrical: Array#sort_by
<seydar>
also, Array#sort can take a block
acoyfellow has joined #ruby
<seydar>
example 1: ["hello", "world"].sort {|a, b| a[0] <=> b[0] } # compares first character's ascii value. use <=> because you need to return either -1, 0, or 1
<seydar>
example 2: ["hello", "world"].sort_by {|a| a[0] }
byennen has quit [Remote host closed the connection]
joofsh has joined #ruby
<Electrical>
ahh okay. will give that a shot
<Electrical>
thnx :-)
<shevy>
I am stymied
freeayu_ has joined #ruby
<shevy>
no that was the wrong word...
<shevy>
I am very much confused ...
<shevy>
syck.rb:135:in `read': Is a directory - phonon (Errno::EISDIR)
<shevy>
the code I am looking at, goes like this:
fyolnish has quit [Remote host closed the connection]
<shevy>
foo = YAML.load_file(some_variable_here) if File.exist? some_variable_here
freeayu has quit [Read error: Connection reset by peer]
fyolnish has joined #ruby
otters has quit [Ping timeout: 264 seconds]
<shevy>
ohhhh
techhelp has quit [Quit: This computer has gone to sleep]
tbrock has joined #ruby
<Electrical>
seydar: its not working. think my hash is a bit stranger.. let me try to put my hash in a gist.
<shevy>
now I see
<seydar>
yup. you see it too. file.exist? should be followed by file.directory?
arya_ is now known as arya
<apeiros_>
um, no?
Goles has quit [Read error: Connection reset by peer]
tenmilestereo has quit [Ping timeout: 246 seconds]
<seydar>
apeiros_: can you explain why not?
<apeiros_>
obviously you do NOT want a directory in YAML.load_file
<seydar>
herp derp.
<seydar>
!file.directory?
fyolnish has quit [Read error: Connection reset by peer]
<apeiros_>
that makes more sense
fyolnish has joined #ruby
<apeiros_>
and then comes the next error (file not readable)
<apeiros_>
and then the next (it existed during testing, but went away in between)
Goles has quit [Read error: Connection reset by peer]
tvw has joined #ruby
kevinykchan has joined #ruby
<seydar>
yeah, foucist is right. add Hash[...] around sorted_settings.sort_by {...}
<foucist>
Electrical: did you try Hash[sorted_settings.sort_by{|a| a[:config][:validate] }] or with |a,_| or with |_,a| (it's basically |k,v| key, and value.. depends if you want to sort by the key or hte value
<foucist>
but actually the gist doesn't look like a hash?
<foucist>
it starts as [ ]
tbrock has joined #ruby
<burgestrand>
Electrical: sort_by is a method on Enumerable, which relies on #each. Hash#each yields both the key and the value, which is what you get as arguments to your block; in effect: hash.sort_by { |key, value| … logic … } # => Array of [[key, value], [key, value]…]
hotovson has joined #ruby
<foucist>
and i don't see the :config
<Electrical>
Hash[sorted_settings.sort_by { |a| a[:validate] }] so like this?
<seydar>
Electrical: yes
<Electrical>
Gives me an error : Can't convert Symbol into Integer
<burgestrand>
Electrical: no
<bigmac>
im trying to dinf a way to limit threads based on how much ram is in use
<burgestrand>
Electrical: a will be an array, [key, value].
<burgestrand>
Electrical: which becomes [key, value][:validate], which is not a valid way to reference an item in an array.
<burgestrand>
Electrical: do you want to sort it by key, or value?
havenn has joined #ruby
<Electrical>
burgestrand: i want to sort it by the value from 'validate' key
<burgestrand>
Electrical: I take it the validate key is part of the key? e.g. { key: hash_containing_validate, key2: hash_containing_validate }?
<burgestrand>
part of the value, sorry.
dnyy has quit [Remote host closed the connection]
<burgestrand>
Electrical: ignore me and just try hash.sort_by { |key, value| value[:validate] }
<apeiros_>
Electrical: this tells you that you try to do `TrueClass <=> false`
danneu has joined #ruby
tbrock has quit [Quit: Computer has gone to sleep.]
sj26 has quit [Ping timeout: 246 seconds]
<apeiros_>
Electrical: and now you have to figure out where and why that happens (sort_by uses <=> to compare the values)
anekos has quit [Ping timeout: 256 seconds]
rcs has quit [Ping timeout: 246 seconds]
SPYGAME has quit [Quit: Leaving]
epochwolf has quit [Ping timeout: 246 seconds]
strtok_ has quit [Ping timeout: 246 seconds]
<Electrical>
[:add_field, {:validate=>:hash, :default=>{}, :description=>"<p>Add a field to an event</p>"}] so the :hash in :validate=>:hash is a symbol if i understand correctly?
<Mon_Ouie>
Actually the error message means you're trying to do true <=> false
faulkner has quit [Ping timeout: 276 seconds]
undyingrage has quit [Ping timeout: 250 seconds]
ahuman has quit [Read error: Connection reset by peer]
AxonetBE has quit [Quit: Leaving.]
ahuman has joined #ruby
<Mon_Ouie>
([true, false].sort generates the message; [TrueClass, false].sort generates one that mentions Class)
strtok has joined #ruby
Tarential has quit [Ping timeout: 246 seconds]
libryder has quit [Ping timeout: 246 seconds]
arusso has quit [Ping timeout: 246 seconds]
anekos has joined #ruby
faulkner has joined #ruby
Guest20802 has quit [Ping timeout: 250 seconds]
Tarential has joined #ruby
undyingrage has joined #ruby
array has joined #ruby
epochwolf has joined #ruby
<apeiros_>
Mon_Ouie: indeed. I dislike the message tbh.
rcs has joined #ruby
array is now known as Guest79672
sj26 has joined #ruby
<apeiros_>
should give an inspect of the two values or use .class on both values
jgarvey has quit [Ping timeout: 252 seconds]
<Electrical>
annotation = "#{config[:validate]}" this is later in the script.. if i understand correctly it converts that hash to a string?
libryder has joined #ruby
danneu has quit [Ping timeout: 256 seconds]
replore has quit [Remote host closed the connection]
arusso has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
<Electrical>
and indeed, sort on the value of the :validation key
<Electrical>
*validate
<apeiros_>
Electrical: so how should ["beginning", "end"] be sorted then?
<apeiros_>
because that's one of the values you have for :validate
<apeiros_>
(you have others, like ["plain", "json", "json_event"] and ["ASCII-8BIT", …tons of encodings…])
peregrine81 has joined #ruby
<Electrical>
that's a good one.. in the if/else statments i got the options: string, array, number, hash, boolean, other these with multiple options fall under other.
<apeiros_>
Electrical: your sorted_2 should be sorted
cakehero has joined #ruby
seanstickle has joined #ruby
<apeiros_>
you want to replace `b[:validate].class.to_s.downcase.to_sym` with `:other`, though. but seydar couldn't have known that since you didn't explain what you want properly.
<thefonso>
/list
JohnBat26 has joined #ruby
GoGoGarrett has joined #ruby
<Electrical>
apeiros_: so like this?: sorted_2 = sorted_settings.sort_by { |a,b| b[:validate].class == Symbol ? b[:validate] : :other }
thefonso has quit [Client Quit]
<apeiros_>
yes
<Electrical>
trying..
nkts has joined #ruby
<Electrical>
cool it works :D
lenovodroid has quit [Ping timeout: 260 seconds]
<shevy>
\o/
<shevy>
now you can abandon php!
<Electrical>
haha ;-) i wish :-)
<shevy>
:(
chaosis has joined #ruby
<shevy>
Electrical, apeiros_ did so too!
<shevy>
he even wrote a 100k lines php app once
<apeiros_>
shevy: does your number change or does my memory?
<Electrical>
lol :p
<apeiros_>
next year I'll have written a 1M lines php app…
<Electrical>
largest i wrote was 20k lines
ewag has quit [Ping timeout: 260 seconds]
<Electrical>
but doing a complete re-write of that app
<apeiros_>
I hope you rewrite it in ruby
<apeiros_>
you'll be disappointed about how few lines it takes, though.
aetcore has quit [Remote host closed the connection]
<Electrical>
wish i was as good in ruby as im in php :-)
statarb3 has quit [Ping timeout: 252 seconds]
<shevy>
apeiros_ ah plus / minus a few k lines of code perhaps :-)
<shevy>
20k is a lot Electrical
<Electrical>
i know shevy :-) its something i've worked on for a year or so
thefonso has joined #ruby
<shevy>
Electrical my largest one in ruby has about 7k lines now... though it may reach 10k in a few months, I am rewriting it right now... from older code... that just sucked
<shevy>
that includes documentation in code though
<shevy>
which makes around... 30 or 40 %
<Electrical>
shevy: nope
thefonso has quit [Client Quit]
<Electrical>
for me it was without doc
replore has joined #ruby
<shevy>
whoa
<seanstickle>
shevy: you ought to rewrite that in Haskell
<shevy>
seanstickle I tried to learn haskell, it's too difficult
<seanstickle>
shevy: you can probably get it down to 20 lines and a monad
<shevy>
oh man, I hate monads
<seydar>
no man monads are amazing
<seydar>
once you see the light
joeycarmello has joined #ruby
<seanstickle>
Just need to learn a little abstract algebra, and boom!, enlightenment
babykosh has joined #ruby
<shevy>
I am gonna ask the #haskell folks whether I can master haskell without using monads
<seydar>
shevy: i mean, i've heard WORSE ideas...
freeayu_ has quit [Read error: Connection reset by peer]
<seanstickle>
In the same way you can master #ruby without knowing anything about method missing
SCommette has joined #ruby
<shevy>
I do that
jlwestsr has quit [Ping timeout: 246 seconds]
ebouchut_ has quit [Quit: This computer has gone to sleep]
<shevy>
every time I was using method_missing, I realized I didnt need to
cakehero has quit [Quit: Computer has gone to sleep.]
<seydar>
+1 to that
<shevy>
only class variables were worse
<shevy>
but I suppose, the more features a language has the better
<apeiros_>
method_missing is rather difficult to properly document…
<shevy>
it's odd when method_missing is used to pass control from one class to another
joeycarmello has quit [Ping timeout: 256 seconds]
<shevy>
I once had a time where I did things like this:
<shevy>
_ = Bla.new
<shevy>
_._._
<apeiros_>
looks funny
<Spaceghostc2c>
You can do some funny things with unicode.
cousine has joined #ruby
<apeiros_>
let me guess…
<Spaceghostc2c>
Like (╯°□°)╯︵ ┻━┻
<apeiros_>
you read that "when split is not enough" article
<Spaceghostc2c>
Could do anything!
<apeiros_>
oh, just the ordinary then :-p
<Spaceghostc2c>
Eh, I only do silly things.
<shevy>
ok
<Spaceghostc2c>
But I am working on a nifty somehting that uses #|
<shevy>
I have not found anyone using unicode variable names in production code, in ruby, yet
<seydar>
for starters, apeiros_ uses the proper ellipses
macabre has joined #ruby
mark_locklear has joined #ruby
<apeiros_>
only because it's less to type :D
<Spaceghostc2c>
:D
<apeiros_>
(opt-. here)
cpruitt has joined #ruby
cpruitt has quit [Client Quit]
lampe21 has joined #ruby
jankly has quit [Quit: Leaving]
<Electrical>
anywayz. Thank you very much guys for the help :-) this is gonna save me loads of time
lampe2 has quit [Ping timeout: 265 seconds]
Goles__ has quit [Remote host closed the connection]
hola123 has joined #ruby
jenrzzz has joined #ruby
_nitti has joined #ruby
nateberkopec has joined #ruby
lenovodroid has joined #ruby
jlwestsr has joined #ruby
tomsthumb has joined #ruby
replore has quit [Remote host closed the connection]
cj3kim has quit [Quit: This computer has gone to sleep]
dnyy has quit [Read error: Connection reset by peer]
axl_ has quit [Quit: axl_]
dnyy has joined #ruby
centipedefarmer has joined #ruby
<seanstickle>
2.3 -- isn't that version planned to have direct compile-to-javascript support?
ttt_ has joined #ruby
tenmilestereo has joined #ruby
peregrine81 has quit [Quit: Computer sleeping.]
lenovodroid has quit [Read error: Connection reset by peer]
jslowe has quit [Ping timeout: 255 seconds]
lenovodroid has joined #ruby
digitalice has joined #ruby
digitalice has left #ruby [#ruby]
chimkan has joined #ruby
jrunning_ has quit [Ping timeout: 264 seconds]
sorbo_ has left #ruby [#ruby]
Virunga has quit [Remote host closed the connection]
ttt_ has quit [Ping timeout: 276 seconds]
Guest49389 is now known as medik
iamjarvo_ has joined #ruby
Kruptein has left #ruby [#ruby]
Elhu has joined #ruby
replore_ has joined #ruby
perun_ has quit [Ping timeout: 264 seconds]
Aiur has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
undyingrage has quit [Ping timeout: 260 seconds]
Virunga has joined #ruby
rcs has quit [Ping timeout: 252 seconds]
Aiur has quit [Client Quit]
undyingrage has joined #ruby
axl_ has joined #ruby
xandy is now known as xAndy
rcs has joined #ruby
awarner has joined #ruby
Neomex has joined #ruby
katherinem13 is now known as katherinem13_out
daniel_hinojosa has joined #ruby
chimkan has quit [Quit: chimkan]
machty has quit [Quit: machty]
ananthakumaran1 has quit [Quit: Leaving.]
peregrine81 has joined #ruby
JoeJulian has quit [Excess Flood]
Neomex has quit [Quit: Neomex]
koshii_ has quit [Ping timeout: 264 seconds]
perun_ has joined #ruby
koshii has joined #ruby
Bartzy has joined #ruby
<Bartzy>
Hey, a bit OT question - Anyone has any recommendation for a good mechanical keyboard (for typing/programming, no gaming) ? :)
<seanstickle>
das keyboard
krawchyk has joined #ruby
seydar has joined #ruby
JoeJulian has joined #ruby
<seydar>
shevy: try getting the latest gem of chitin. fixed a few things to make it work better
<seydar>
also, there's a new version of coolline that got pushed
<seydar>
and Mon_Ouie made that a gem (thanks!)
axl_ has quit [Read error: Connection reset by peer]
axl__ has joined #ruby
mercwithamouth has joined #ruby
danneu has joined #ruby
tk__ has quit [Quit: ばいばい]
<Elico>
I want to override the return Socket from "Socket.listen(5)" to specific socket class can it be done?
pkondzior_ has quit [Remote host closed the connection]
jaygen has joined #ruby
hackerdude has quit [Remote host closed the connection]
pkondzior_ has joined #ruby
havenn has quit [Remote host closed the connection]
mark_locklear has quit [Remote host closed the connection]
Nisstyre-laptop has joined #ruby
<shevy>
seydar ok
atmosx has quit [Quit: WeeChat 0.4.0-dev]
TechZombie has joined #ruby
jaygen has quit [Ping timeout: 252 seconds]
atmosx has joined #ruby
jaygen has joined #ruby
jaygen has quit [Client Quit]
pu22l3r has joined #ruby
rellin has joined #ruby
arya has quit [Ping timeout: 252 seconds]
chimkan has joined #ruby
snorkdude has joined #ruby
arya has joined #ruby
silver-love has joined #ruby
silver-love has left #ruby [#ruby]
malkomalko has joined #ruby
replore_ has quit [Remote host closed the connection]
Russell^^ has quit [Quit: Russell^^]
Grieg has quit [Quit: laterz! :D]
jonahR has joined #ruby
sorbo_ has joined #ruby
mengu has quit [Read error: No route to host]
mengu_ has joined #ruby
S1kx has joined #ruby
S1kx has quit [Changing host]
S1kx has joined #ruby
gbchaosmaster has joined #ruby
jekotia has joined #ruby
_nitti has joined #ruby
<gener1c>
is there a way to prevent nokogiri from using html5 when doing .to_html
<gener1c>
?
s1n4 has quit [Quit: leaving]
<shevy>
dunno, hopefully, otherwise there would be one less reason to use it... let's look at the source
love_color_text has joined #ruby
cj3kim has joined #ruby
chimkan has quit [Quit: chimkan]
seydar has quit [Quit: leaving]
love_color_text has quit [Remote host closed the connection]
nemesit has joined #ruby
_nitti has quit [Ping timeout: 260 seconds]
sorbo_ has quit [Quit: sorbo_]
havenn has joined #ruby
k610 has joined #ruby
love_color_text has joined #ruby
Goles has joined #ruby
replore_ has joined #ruby
ttt_ has joined #ruby
Goles has quit [Ping timeout: 256 seconds]
dukedave has joined #ruby
cakehero has joined #ruby
generalissimo has joined #ruby
arya has quit [Ping timeout: 265 seconds]
statarb3 has joined #ruby
monkegjinni has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 250 seconds]
thomas3487 has joined #ruby
<thomas3487>
hi
<thomas3487>
`method_missing': undefined method `setValue' for #<Qt::SpinBox:0xb7620acc> (NoMethodError)
<thomas3487>
sorry
<thomas3487>
i try to set the minimum of a Qt::SpinBox, but i get this error: `method_missing': undefined method `setMinimum' for #<Qt::SpinBox:0xb7682a9c>
arya has joined #ruby
elaptics is now known as elaptics`away
<lesnik_>
I have the last question about sorting hashes :)
Grieg has quit [Read error: Connection reset by peer]
Dreamer3 has joined #ruby
chimkan_ has joined #ruby
cakehero has joined #ruby
perun_ has joined #ruby
Grieg has joined #ruby
Grieg has quit [Changing host]
Grieg has joined #ruby
love_color_text has joined #ruby
pen has quit [Remote host closed the connection]
brianpWins has joined #ruby
dmiller has quit [Read error: Operation timed out]
cj3kim has quit [Quit: This computer has gone to sleep]
lesnik_ has quit [Quit: Lost terminal]
k610 has quit [Ping timeout: 260 seconds]
dagnachew has quit [Quit: Leaving]
Dreamer3 has quit [Ping timeout: 255 seconds]
dzhulk has quit [Quit: Leaving.]
cousine has joined #ruby
love_color_text has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
dmiller has joined #ruby
love_color_text has joined #ruby
Grieg has quit [Read error: Connection reset by peer]
chimkan___ has joined #ruby
hasse_ has joined #ruby
acoyfellow has quit [Ping timeout: 246 seconds]
<hasse_>
How do I update a record using DataMapper without finding it first?
jackbrownhf has quit [Quit: Sto andando via]
robotmay has quit [Remote host closed the connection]
dzhulk has joined #ruby
Banistergalaxy has quit [Ping timeout: 246 seconds]
cakehero has quit [Ping timeout: 265 seconds]
tomsthumb has quit [Quit: Leaving.]
chimkan_ has quit [Ping timeout: 260 seconds]
cousine has quit [Remote host closed the connection]
bluOxigen has joined #ruby
Banistergalaxy has joined #ruby
v0n has quit [Ping timeout: 260 seconds]
haxrbyte has joined #ruby
joeycarmello has quit [Remote host closed the connection]
sorbo_ has joined #ruby
cakehero has joined #ruby
joeycarmello has joined #ruby
dnyy has quit [Remote host closed the connection]
<MarcWeber>
hasse_: Use SQL. Datamapper let's you access the SQL layer.,
nonotza has joined #ruby
<hasse_>
MarcWeber: So there is no built-in API for it, like Rails and Mongoid?
<MarcWeber>
hasse_: I don't know exactly.
BoomCow has joined #ruby
byennen has joined #ruby
<MarcWeber>
I havn't seen a way reading online docs, but I don't know datamapper that well yet.
baphled has quit [Ping timeout: 265 seconds]
GoGoGarrett has quit [Remote host closed the connection]
cj3kim has joined #ruby
thoolihan has joined #ruby
snorkdude has quit [Quit: snorkdude]
Bartzy has quit [Remote host closed the connection]
macmartine has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
jrunning_ has joined #ruby
keyvan has joined #ruby
babykosh has quit [Quit: babykosh]
Dreamer3 has joined #ruby
replore_ has quit [Remote host closed the connection]
tvw has quit [Remote host closed the connection]
love_color_text has quit [Ping timeout: 248 seconds]
_nitti has joined #ruby
jaygen has joined #ruby
slainer68 has quit [Remote host closed the connection]
headius has quit [Quit: headius]
aharris6 has joined #ruby
hotovson has quit [Remote host closed the connection]
jackdanger has joined #ruby
_nitti has quit [Ping timeout: 260 seconds]
Orcris has joined #ruby
jimeh has joined #ruby
acoyfellow has joined #ruby
dmiller has quit [Ping timeout: 255 seconds]
Electrical has joined #ruby
jaygen has quit [Quit: Leaving...]
<Electrical>
Hi all, got an other ruby question :-)
<shevy>
YES
<shevy>
YOU MUST ASK THE QUESTION
<seanstickle>
Bring it on
<Beoran__>
please :)
<seanstickle>
Feed us with supplication!
havenn has quit [Remote host closed the connection]
<Electrical>
input is a string. output should be an array of that string with each entry not longer then x characters.. and if its in the middle of a word it should end that line at the beginning of that word :-)
<seanstickle>
shevy: he wants a word wrapping function
<seanstickle>
Which I have conveniently provided
<Electrical>
seanstickle: i think that's it yeah.
<Electrical>
thank you very much :-)
<seanstickle>
Sure thing
wallerdev has joined #ruby
TheFuzzball has quit [Ping timeout: 255 seconds]
thomas3487 has quit [Remote host closed the connection]
aharris6 has quit [Remote host closed the connection]
mneorr has joined #ruby
kidoz has joined #ruby
haxrbyte has quit [Ping timeout: 255 seconds]
hotovson has quit [Read error: No route to host]
<Electrical>
hmm forgot about this issue with it.. every line needs to be prefixed with '# ' ( 3 spaces ) is it possible to prepend that to each entry of that array?
dobbymoodge has quit [Read error: Connection reset by peer]
ttt_ has joined #ruby
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
joeycarmello has quit [Remote host closed the connection]
browndawg has left #ruby [#ruby]
seanstickle has quit [Quit: seanstickle]
syamajala has joined #ruby
dobbymoodge has joined #ruby
tommyvyo_ has joined #ruby
<Electrical>
thanks again guys :-)
adeponte has joined #ruby
ttt_ has quit [Ping timeout: 245 seconds]
snorkdude has quit [Quit: snorkdude]
snorkdude has joined #ruby
emsilva has joined #ruby
adeponte has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
Grieg has joined #ruby
Grieg has quit [Changing host]
Grieg has joined #ruby
adambeynon has joined #ruby
Electrical has left #ruby [#ruby]
acrocity has quit [Ping timeout: 245 seconds]
<emsilva>
What would be the best way to iterate through a hash, adding new values to existing key pars? For example: cars[:vw] = { name: 'beetle' } then car[:vw] = { name: 'golf' } and I need the result to be :vw => { :name => ['beetle', 'golf'] } . Thanks.
generalissimo has quit [Remote host closed the connection]
swarley has joined #ruby
gokul has joined #ruby
machty has joined #ruby
jonahR has quit [Quit: jonahR]
<apeiros_>
emsilva: you should in that case start out with the values being arrays
<apeiros_>
normalize your datastructures. otherwise you'll be unhappy.
<apeiros_>
if you do that, all you have to do is `<< newvalue`
jimeh has quit [Quit: Computer has gone to sleep.]
acrocity has joined #ruby
<shevy>
emsilva I usually build a new hash, then reassign the old hash to that new hash
lushious has quit [Remote host closed the connection]
jrunning_ has quit [Ping timeout: 260 seconds]
lushious has joined #ruby
keyvan has quit [Remote host closed the connection]
nonotza has quit [Quit: nonotza]
zigomir has joined #ruby
<emsilva>
shevy: but how would you iterate on that?
whitedawg has quit [Quit: Leaving.]
blaxter has quit [Quit: foo]
acoyfellow has quit [Ping timeout: 250 seconds]
<shevy>
emsilva over a hash? hash.each_pair {|key,value|
<shevy>
usually
lenovodroid has quit [Ping timeout: 264 seconds]
<shevy>
you seem to have separate entries
key has left #ruby ["..."]
<shevy>
it may be easier to collect them into an array first
<emsilva>
shevy: apeiros: I think I'm having trouble putting in words what I need :/ Let me try a gist.
gokul has quit [Quit: Leaving]
chimkan___ has quit [Quit: chimkan___]
<emsilva>
its hard to explain what you want, when you don't know how its called! :)
havenn has joined #ruby
seanstickle has joined #ruby
vikingly has joined #ruby
bier_ has joined #ruby
Elico has quit [Ping timeout: 264 seconds]
Retistic has joined #ruby
shevy has quit [Ping timeout: 252 seconds]
danktamagachi has joined #ruby
snorkdude has quit [Quit: snorkdude]
jackdanger has quit [Quit: Leaving.]
Cadwallion has quit [Ping timeout: 276 seconds]
jsilver has quit [Remote host closed the connection]
bier_ has quit [Quit: Ex-Chat]
jsilver has joined #ruby
jimeh has joined #ruby
tbrock has quit [Quit: Computer has gone to sleep.]
bier_ has joined #ruby
syamajala has quit [Remote host closed the connection]
aharris6 has joined #ruby
jsilver has quit [Ping timeout: 246 seconds]
BoomCow has quit [Quit: This computer has gone to sleep]
wallerdev has joined #ruby
shevy has joined #ruby
danktamagachi has quit [Ping timeout: 252 seconds]
brianpWins has quit [Ping timeout: 252 seconds]
s1n4 has joined #ruby
shiroginne has joined #ruby
danktamagachi has joined #ruby
shorne has joined #ruby
nemesit has quit [Quit: Leaving...]
macmartine has quit [Quit: Computer has gone to sleep.]
syamajala has joined #ruby
love_color_text has joined #ruby
imami|afk is now known as banseljaj
chimkan_ has joined #ruby
generalissimo has joined #ruby
axl__ has quit [Quit: axl__]
jrunning_ has joined #ruby
<shevy>
hey guys
<shevy>
word.rb:74:in `capitalize': invalid byte sequence in UTF-8 (ArgumentError)
mengu_ has quit [Ping timeout: 246 seconds]
<shevy>
how to solve this?
brianpWins has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
tommyvyo_ is now known as tommyvyo
burgestrand1 has joined #ruby
tbrock has joined #ruby
shorne has quit [Ping timeout: 255 seconds]
axl_ has joined #ruby
chimkan_ has quit [Client Quit]
havenn has quit [Remote host closed the connection]
peregrine81 has quit [Quit: Goodbye.]
snorkdude has joined #ruby
<foucist>
shevy: check the encoding of the string?
<foucist>
or force it to unicode/utf8
burgestrand has quit [Ping timeout: 255 seconds]
lenovodroid has joined #ruby
<shevy>
hmm yeah, going to force it
BoomCow has joined #ruby
<cardoni>
shevy, you fix the problem?
<cardoni>
What text editor are you using?
TheFuzzball has joined #ruby
<shevy>
cardoni geany right now. But I always use ISO encoding, not UTF.
seanstickle has quit [Quit: seanstickle]
<atmosx>
shevy: capitalize doesn't work with greek chars, I had to write my methods
<cardoni>
Within your app? Like, in your datastore you mean? Or in terms of how you're encoding your .rb files?
<atmosx>
so if youre chars are not ASCII-US won't work
<cardoni>
good point atmosx
<shevy>
cardoni in how I save .rb files and yaml files (I know the letter requires UTF, but I dont)
Eldariof-ru has quit [Read error: Connection reset by peer]
piotr has joined #ruby
Eldariof93-ru has joined #ruby
<atmosx>
shevy: out of curiosity what language?
<cardoni>
Most text editors can usually add the necessary encoding type to the top of the file if you happen to use a non-UTF char
<shevy>
you use UTF-8 atmosx
<atmosx>
I'd like to see that properly implemented in ruby
<atmosx>
cardoni: which is?
piotr_ has quit [Ping timeout: 246 seconds]
<atmosx>
ah you don't?
<shevy>
cardoni, yeah but I have had problems when I tried to go UTF-8
<cardoni>
Ahh, I see
<atmosx>
I can't *not* use utf-8 with greek utf8 chars
chimkan has quit [Client Quit]
<cardoni>
atmosx: I always just stick with UTF-8. Haven't worked on anything yet that required otherwise.
<shevy>
for me it was only the german umlauts
<atmosx>
hmm k
<atmosx>
I'm off, cya
love_color_text has quit [Remote host closed the connection]
<cardoni>
atmosx If you throw, say, greek and german in whatever .rb file you're hacking on, simply adding "#!/usr/bin/env ruby -w # encoding: UTF-8" to the top of the file takes care if that, doesn't it? I'm not sure.
<shevy>
well plan B is to read up lots about encoding and do the switch to UTF-8
Grieg has quit [Quit: laterz! :D]
chimkan has joined #ruby
BoomCow has quit [Quit: This computer has gone to sleep]
replore has joined #ruby
cakehero has quit [Ping timeout: 255 seconds]
dzhulk has quit [Quit: Leaving.]
BoomCow has joined #ruby
rippa has quit [Ping timeout: 256 seconds]
dzhulk has joined #ruby
awarner has quit [Remote host closed the connection]
love_color_text has joined #ruby
replore has quit [Ping timeout: 265 seconds]
cakehero has joined #ruby
burgestrand1 is now known as burgestrand
snorkdude has quit [Quit: snorkdude]
ttt_ has joined #ruby
awarner has joined #ruby
capaterra has quit [Ping timeout: 252 seconds]
keyvan has joined #ruby
keyvan has joined #ruby
keyvan has quit [Changing host]
danktamagachi has quit [Remote host closed the connection]
Michae___ has quit [Remote host closed the connection]
<seanstickle>
No, not good
<seanstickle>
Can I read the code online?
<seanstickle>
It keeps trying to download files...
<maetthew>
seanstickle, You can't see that?
<maetthew>
hmm
<maetthew>
hold on
Michae___ has joined #ruby
<seanstickle>
Ah, just trying to download the database.db
<seanstickle>
Forget my comment
byennen has quit [Read error: Connection reset by peer]
byennen has joined #ruby
Tearan has joined #ruby
Tearan has quit [Client Quit]
<maetthew>
seanstickle, So you can see the code?
<seanstickle>
Yah
Xeago has quit [Read error: Connection reset by peer]
Tearan has joined #ruby
Xeago has joined #ruby
<maetthew>
cool
<seanstickle>
auto_migrate! clears all the data from the database
<seanstickle>
So… there's that
Goles has joined #ruby
<maetthew>
oh ofc
c0rn has joined #ruby
keyvan has quit [Remote host closed the connection]
Elhu has joined #ruby
c0rn has quit [Client Quit]
joeycarmello has quit [Remote host closed the connection]
Goles has quit [Ping timeout: 264 seconds]
love_color_text has joined #ruby
ctwiz has joined #ruby
Goles has joined #ruby
nga4 has joined #ruby
c0rn has joined #ruby
c0rn has quit [Client Quit]
<maetthew>
seanstickle, Another thing. I am trying to check if a record exists. I was under the assumption that first_or_create would do that but I seem to be wrong?
generalissimo has joined #ruby
SCommette has quit [Quit: SCommette]
jimeh has joined #ruby
pac1 has joined #ruby
danneu has quit [Ping timeout: 244 seconds]
bluesnow has joined #ruby
wjw has quit [Ping timeout: 245 seconds]
<bluesnow>
Hey, I'm trying to do rvm install mysql2, but it's missing a dependency on libmysqlclient-dev I think
<bluesnow>
However, when I try to install libmysqlclient-dev, I get Could not find a valid gem 'libmysqlclient-dev' (>= 0) in any repository
malkomalko has quit [Remote host closed the connection]
cardoni has quit [Quit: cardoni]
banisterfiend has quit [Ping timeout: 265 seconds]
seanstickle has quit [Quit: seanstickle]
alanp_ has joined #ruby
Michae___ has quit [Remote host closed the connection]
<rking>
I wonder if gems that have OS deps should try harder to suggest the course of action
<rking>
E.g. look for /etc/debian_version and say: Press y to 'apt-get install libmysqlclient-dev'
baphled has quit [Ping timeout: 264 seconds]
Michae___ has joined #ruby
<bluesnow>
Hanmac: Ah okay, thanks.
rjmt___ has quit [Ping timeout: 255 seconds]
alanp has quit [Ping timeout: 260 seconds]
<maetthew>
I am trying to check if a record exists in SQLite3 with DataMapper. I was under the assumption that i could use first_or_create for this but I seem to be wrong about this?
nobuoka has quit [Ping timeout: 248 seconds]
ctwiz is now known as dpg
x82_nicole has quit [Quit: Computer has gone to sleep.]
rjmt___ has joined #ruby
lolcathost has quit [Ping timeout: 246 seconds]
jrunning_ has quit [Ping timeout: 252 seconds]
<shevy>
I HAVE THE SOLUTION TO CODING
<shevy>
We need good looking girls in bikini doing the actual coding work
lolcathost has joined #ruby
<RubyPanther>
We already have that.
cj3kim has quit [Quit: This computer has gone to sleep]
rjj has quit [Ping timeout: 260 seconds]
prox|a has joined #ruby
Michae___ has quit [Ping timeout: 244 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
rjmt___ has quit [Ping timeout: 255 seconds]
daniel_hinojosa has quit [Quit: Leaving.]
virtualentity has quit [Ping timeout: 256 seconds]
CRubyJDoc is now known as Lemtzas
lenovodroid has joined #ruby
kirun has quit [Quit: Client exiting]
ikaros has quit [Quit: Ex-Chat]
lolcathost has quit [Ping timeout: 255 seconds]
<jrajav>
shevy: If you haven't seen those, you're coding in the wrong place.
<jrajav>
Well okay they may not be in bikinis ALL THE TIME
<shevy>
man I swear I never saw it before
<jrajav>
Had a friend in California who was on a project where they normally weren't colocated
acoyfellow has joined #ruby
<jrajav>
But they had crunch time
<jrajav>
So their solution was to rent out a shack on the beach
Michae___ has joined #ruby
<jrajav>
They'd run little hacking marathons and then go surf
habib has quit [Quit: Leaving]
<jrajav>
I am sure there was a girl in bikini coding at some point on that project (there were one or two girls on the team)
tvw has quit [Remote host closed the connection]
slash_nick has joined #ruby
baphled has joined #ruby
whowantstolivef0 has joined #ruby
joeycarmello has joined #ruby
cardoni has joined #ruby
ttt_ has joined #ruby
danneu has joined #ruby
banseljaj is now known as imami|afk
mneorr has joined #ruby
snorkdude has quit [Quit: snorkdude]
arturaz_ has quit [Remote host closed the connection]
pcarrier has quit []
ikaros has joined #ruby
generalissimo has quit [Remote host closed the connection]
wargasm has quit [Ping timeout: 255 seconds]
ttt_ has quit [Ping timeout: 245 seconds]
cableray has joined #ruby
love_color_text has quit [Remote host closed the connection]
babykosh has quit [Quit: babykosh]
generalissimo has joined #ruby
rakl has joined #ruby
joeycarmello has quit [Ping timeout: 265 seconds]
aharris6 has joined #ruby
bigthyme has joined #ruby
Xeago has quit [Ping timeout: 255 seconds]
bigthyme has quit [Remote host closed the connection]
blazes816 has quit [Quit: blazes816]
Proshot is now known as statarb3
statarb3 has quit [Changing host]
statarb3 has joined #ruby
dangerousdave has quit [Quit: Leaving...]
Michae___ has quit [Remote host closed the connection]
slash_nick has quit [Ping timeout: 245 seconds]
Goles has quit [Remote host closed the connection]
jrunning_ has joined #ruby
_alejandro has quit [Remote host closed the connection]
aharris6 has quit [Remote host closed the connection]
twopoint718 has joined #ruby
twopoint718 has joined #ruby
twopoint718 has quit [Changing host]
Xeago has joined #ruby
dmiller_ has quit [Remote host closed the connection]
aeontech has quit [Quit: aeontech]
jrunning_ has quit [Ping timeout: 245 seconds]
Michae___ has joined #ruby
babykosh has joined #ruby
Michae___ has quit [Remote host closed the connection]
Muz_ is now known as Muz
jimeh has quit [Quit: Computer has gone to sleep.]
aeontech has joined #ruby
jellosea has joined #ruby
<jellosea>
hey is there a way to run a ruby program in one line like perl -we " " ?
byennen_ has joined #ruby
byennen has quit [Read error: Connection reset by peer]