<jrajav>
JohnTeddy: IMO ternaries should only be used for very short assignment statements where you want to provide a default value
<jrajav>
In most cases they serve only to obscure your code
<jrajav>
That last 'else' clause is still a beast
chococrois has joined #ruby
<JohnTeddy>
hehe
<JohnTeddy>
I basically need to find the point where the first vowel is
chococrois has quit [Max SendQ exceeded]
<JohnTeddy>
Then move things around depending on where that first vowel is.
chococrois has joined #ruby
<JohnTeddy>
It's probably simpler if I can just do: (x.chars.find_index { |x| vowels.include?(x) }) for each word, and set that as 'firstvowel' variable. I'm not sure how to do that though.
jackiechan0 has quit [Quit: Sto andando via]
chococrois has quit [Max SendQ exceeded]
<jrajav>
You're not sure how to set variables in Ruby?
F1skr has quit [Quit: WeeChat 0.3.9.2]
maletor has quit [Quit: Computer has gone to sleep.]
<JohnTeddy>
Well it seems easier to set it when there are if/else statements like your last paste. When I use ternaries it's a bit confusing for me what goes where.
Bootstrapper has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
Markvilla has quit [Ping timeout: 252 seconds]
Markvilla has joined #ruby
jlast has quit [Ping timeout: 264 seconds]
burgestrand1 has joined #ruby
ephemerian has quit [Quit: Leaving.]
burgestrand has quit [Ping timeout: 245 seconds]
undersc0re97 has quit [Ping timeout: 245 seconds]
Markvilla has quit [Ping timeout: 256 seconds]
burgestrand1 has quit [Client Quit]
ryanlecompte has quit [Remote host closed the connection]
tuannat has joined #ruby
nwertman has joined #ruby
Markvilla has joined #ruby
mikepack has joined #ruby
ij has quit [Read error: Connection reset by peer]
joeycarmello has quit [Remote host closed the connection]
joeycarmello has joined #ruby
freeayu has joined #ruby
Markvilla has quit [Ping timeout: 252 seconds]
axl_ has quit [Quit: axl_]
nwertman has quit [Ping timeout: 260 seconds]
Markvilla has joined #ruby
gyre007 has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
vlad_starkov has joined #ruby
Rym has joined #ruby
Markvilla has quit [Ping timeout: 255 seconds]
Markvilla has joined #ruby
slainer68 has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 264 seconds]
daniel_- has quit [Quit: WeeChat 0.3.9.1]
nwertman has joined #ruby
<MarcWeber>
bundle: How do I tell it to install :development or similar selections of the specificed gem files?
tjbiddle has quit [Ping timeout: 240 seconds]
emanu has quit [Quit: emanu]
etcetera has joined #ruby
Markvilla has quit [Ping timeout: 264 seconds]
Markvilla has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
kbeddingfield has joined #ruby
jlast has joined #ruby
Markvilla has quit [Ping timeout: 252 seconds]
joeycarmello has quit [Remote host closed the connection]
<shevy>
hmm not sure how many here know bundler, there should be more on #bundler though
jimeh has quit [Quit: Computer has gone to sleep.]
davidcelis has joined #ruby
Markvilla has joined #ruby
kbeddingfield has quit [Ping timeout: 248 seconds]
alexim has quit [Quit: sleep]
samphippen has quit [Quit: Computer has gone to sleep.]
Markvilla has quit [Ping timeout: 255 seconds]
phantasm66 has joined #ruby
ddd has quit [Ping timeout: 245 seconds]
noyb has quit [Ping timeout: 276 seconds]
Markvilla has joined #ruby
lethjak__ has quit [Remote host closed the connection]
Rym has quit [Quit: Rym]
<dyreshark>
hello! i have a quick question. \
Markvilla has quit [Client Quit]
nwertman has quit [Ping timeout: 244 seconds]
LouisGB has quit [Ping timeout: 264 seconds]
brianpWins has joined #ruby
seeingidog__ has joined #ruby
nignaztic has joined #ruby
mikepack has quit [Remote host closed the connection]
d34th4ck3r has quit [Quit: Konversation terminated!]
jeffreybaird has joined #ruby
<shevy>
OK!
<shevy>
will you ever ask it!
<dyreshark>
sorry, didn't mean to hit enter, and i had to walk upstairs :p
v0n has joined #ruby
<dyreshark>
sec
jlast has quit [Ping timeout: 248 seconds]
g-ram has quit [Quit: Computer has gone to sleep.]
<shevy>
lol
ttt has joined #ruby
<dyreshark>
so, i'm new to ruby, and i'm trying to take args from ARGV and quote them all correctly, so I can pass them into system(), but %Q doesn't seem to be quoting anything?
BoomCow has quit [Quit: This computer has gone to sleep]
<dyreshark>
at the moment, i have ARGV.each do |x|; z = %Q{ #{x} }; print z; end
BoomCow has joined #ruby
<dyreshark>
just to verify that things are being quoted, and it doesn't look like they are :(
<dyreshark>
do you see what i'm doing wrong?
g-ram has joined #ruby
g-ram has quit [Client Quit]
kirun has quit [Quit: Client exiting]
banisterfiend has joined #ruby
atno is now known as atno|AFK
<tsou>
dyreshark: %Q{...} is like "...", it will not add the quote symbols to your string, if this is what you want to achieve. Is that what you want?
Cicloid has quit [Remote host closed the connection]
<dyreshark>
so, what i want is given the command ./my-program.rb "foo \" bar" baz, i want to transform ARGV from ['foo " bar', 'baz'] to ['"foo \" bar"', '"baz"']
jojosiao has joined #ruby
tomzx_ has joined #ruby
<tsou>
dyreshark: looks like you want to map the inspect method on ARGV?
<tsou>
not sure though
<dyreshark>
aha! that's what i wanted.
<dyreshark>
thank you :)
<tsou>
no prob
Hanmac1 has joined #ruby
wpaulson has joined #ruby
seanstickle has quit [Quit: seanstickle]
afgeneralist has quit [Ping timeout: 255 seconds]
tvw has quit [Ping timeout: 244 seconds]
tommyvyo has joined #ruby
brianpWins has quit [Quit: brianpWins]
blazes816 has quit [Quit: blazes816]
Hanmac has quit [Ping timeout: 265 seconds]
<jojosiao>
why is Fixnum === Fixnum #returns false ?
<Xeago>
rohit-sharma: probably timeouts, or maximum data reached
<rohit-sharma>
Xeago, I tried using rack-timeout library..but no change
apeiros_ has quit [Read error: Connection timed out]
hoelzro|away is now known as hoelzro
apeiros_ has joined #ruby
larissa has quit [Read error: Connection reset by peer]
larissa has joined #ruby
Rydefalk has joined #ruby
clj_newb has quit [Ping timeout: 240 seconds]
AndChat- has joined #ruby
<withnale>
if I want to create a capistrano role inside a module method, how would I do it...? outside of the module I can just call 'role' directly in my method and it's retained when I come back. I guess it would be the same problem if I were using rake.
bier_ has quit [Ping timeout: 252 seconds]
_guy has joined #ruby
bier has quit [Ping timeout: 260 seconds]
Banistergalaxy has quit [Ping timeout: 244 seconds]
jds has joined #ruby
lotus2015 has joined #ruby
blacktulip has quit [Remote host closed the connection]
banister_ has quit [Remote host closed the connection]
blacktulip has joined #ruby
jackiechan0 has quit [Ping timeout: 246 seconds]
jds has quit [Ping timeout: 245 seconds]
nemonic has quit [Ping timeout: 264 seconds]
nignaztic has quit [Ping timeout: 260 seconds]
nemonic has joined #ruby
monkegji_ has joined #ruby
_guy has quit [Ping timeout: 256 seconds]
nignaztic has joined #ruby
staafl has joined #ruby
bier has joined #ruby
bier_ has joined #ruby
Asher2 has quit [Quit: Leaving.]
Asher has joined #ruby
mikecmpbll has joined #ruby
swex has quit [Remote host closed the connection]
swex has joined #ruby
Virunga has quit [Remote host closed the connection]
nemonic has quit [Ping timeout: 248 seconds]
_guy has joined #ruby
nignaztic has quit [Ping timeout: 264 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
cascalheir has joined #ruby
yshh has quit [Remote host closed the connection]
cascalheira has quit [Read error: Connection reset by peer]
pavilionXP has joined #ruby
beiter has joined #ruby
Guest39162 has joined #ruby
schaerli has joined #ruby
schaerli has quit [Remote host closed the connection]
G has quit [Ping timeout: 246 seconds]
schaerli has joined #ruby
sk87 has quit [Quit: sk87]
atno|AFK is now known as atno
lele has quit [Ping timeout: 246 seconds]
Guest39162 is now known as rutkovsky
lele has joined #ruby
G has joined #ruby
kil0byte_ has joined #ruby
elsifaka has joined #ruby
Sahilc has joined #ruby
Sahilc has left #ruby [#ruby]
kil0byte has quit [Ping timeout: 276 seconds]
shtirlic has quit [Remote host closed the connection]
replore_ has joined #ruby
chussenot has quit [Quit: chussenot]
ij has quit [Read error: Connection reset by peer]
ij has joined #ruby
vlad_starkov has joined #ruby
Asher has quit [Quit: Leaving.]
Asher has joined #ruby
nemonic has joined #ruby
nignaztic has joined #ruby
vlad_starkov has quit [Ping timeout: 276 seconds]
yshh has joined #ruby
rohit_ has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 260 seconds]
punkrawkR has joined #ruby
schaerli has quit [Remote host closed the connection]
schaerli has joined #ruby
Goles has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
krz has quit [Quit: krz]
perun_ has quit [Ping timeout: 240 seconds]
Axsuul has quit [Ping timeout: 252 seconds]
nemonic has quit [Quit: WeeChat 0.3.7]
nignaztic has quit [Quit: Lost terminal]
cody-- has joined #ruby
dakine has quit [Quit: Leaving]
chussenot has joined #ruby
ninegrid has quit [Ping timeout: 252 seconds]
kil0byte has joined #ruby
u89 has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 260 seconds]
Sahilc has joined #ruby
cantonic has joined #ruby
kil0byte_ has quit [Ping timeout: 245 seconds]
atno is now known as atno|C
_guy has quit [Remote host closed the connection]
rohit-sharma has quit [Quit: Leaving]
_guy has joined #ruby
samphippen has joined #ruby
Virunga has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
gyre007 has joined #ruby
perun_ has joined #ruby
Sahilc has left #ruby [#ruby]
grzywacz has quit [Ping timeout: 252 seconds]
u89 has joined #ruby
nemonic has joined #ruby
nemesit has joined #ruby
nemonic is now known as nignaztic
Uranio has joined #ruby
mklappstuhl has joined #ruby
chussenot has quit [Quit: chussenot]
ryanlecompte has quit [Read error: Connection reset by peer]
ryanlecompte has joined #ruby
cantonic has quit [Quit: cantonic]
lkba has joined #ruby
chussenot has joined #ruby
thestereobus has quit [Quit: thestereobus]
Elhu has joined #ruby
schaerli has quit [Remote host closed the connection]
banisterfiend has joined #ruby
sk87 has joined #ruby
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
dertyp has quit [Quit: Leaving...]
gyre007 has quit [Remote host closed the connection]
beiter has quit [Ping timeout: 256 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
phantasm66 has joined #ruby
nignaztic has quit [Ping timeout: 252 seconds]
nignaztic has joined #ruby
filipe has quit [Remote host closed the connection]
yakko has joined #ruby
yakko has quit [Remote host closed the connection]
jackiechan0 has joined #ruby
ZubKonst has quit [Read error: Connection reset by peer]
ephemerian has quit [Ping timeout: 255 seconds]
gyre007 has joined #ruby
thestereobus has joined #ruby
mikecmpbll has quit [Quit: Computer has gone to sleep.]
nomenkun_ has quit [Read error: Connection reset by peer]
nomenkun has joined #ruby
nari has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
thestereobus has quit [Ping timeout: 255 seconds]
thestereobus has joined #ruby
jackiechan0 has quit [Quit: Sto andando via]
mklappstuhl has quit [Ping timeout: 244 seconds]
kil0byte_ has joined #ruby
ij has quit [Read error: Connection reset by peer]
kil0byte has quit [Ping timeout: 252 seconds]
cody-- has quit [Quit: goodbye]
ij has joined #ruby
fbernier has joined #ruby
rvchangue has joined #ruby
jackiechan0 has joined #ruby
nignaztic has quit [Ping timeout: 252 seconds]
ffranz has joined #ruby
jackiechan0 has quit [Read error: Connection reset by peer]
Elico has joined #ruby
nignaztic has joined #ruby
u89 has quit [Remote host closed the connection]
u89 has joined #ruby
verto|off is now known as verto
evelyette has joined #ruby
<evelyette>
hi
[0x1a] has joined #ruby
[0x1a] has quit [Changing host]
[0x1a] has joined #ruby
[0x1a] has joined #ruby
_guy has quit [Remote host closed the connection]
_guy has joined #ruby
mklappstuhl has joined #ruby
Gurpartap has quit [Ping timeout: 245 seconds]
schaerli has joined #ruby
banisterfiend has quit [Ping timeout: 265 seconds]
AndChat- has quit [Ping timeout: 244 seconds]
Banistergalaxy has joined #ruby
kirun has joined #ruby
johnmilton has joined #ruby
rohit has joined #ruby
nomenkun has quit [Read error: Connection reset by peer]
_guy has quit [Remote host closed the connection]
_guy has joined #ruby
nomenkun has joined #ruby
Rydefalk has quit [Remote host closed the connection]
<shevy>
dumdedum
tbrock has joined #ruby
SeySayux has quit [Read error: Operation timed out]
digitalcakestudi has joined #ruby
nemonic has joined #ruby
<shevy>
apeiros_, are you on rubygems.org ?
lukeholder has joined #ruby
<apeiros_>
yes
Villadelfia has quit [Ping timeout: 248 seconds]
u89 has quit [Remote host closed the connection]
<shevy>
ah found you
iamjarvo has joined #ruby
<shevy>
searching for "butler", it'll always be tagged to you :D
samphippen has quit [Quit: Computer has gone to sleep.]
Villadelfia has joined #ruby
nignaztic has quit [Ping timeout: 255 seconds]
robbyoconnor has quit [Ping timeout: 240 seconds]
SeySayux has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
ananthakumaran has quit [Quit: Leaving.]
tbrock has quit [Quit: Computer has gone to sleep.]
nomenkun_ has joined #ruby
ebouchut has joined #ruby
Elhu has joined #ruby
heftig has quit [Ping timeout: 240 seconds]
nomenkun has quit [Ping timeout: 244 seconds]
beiter has left #ruby [#ruby]
<apeiros_>
:)
mikecmpbll has joined #ruby
robbyoconnor has joined #ruby
schaerli has quit [Remote host closed the connection]
heftig has joined #ruby
nomenkun_ has quit [Read error: Connection reset by peer]
[Neurotic] has quit [Ping timeout: 276 seconds]
nomenkun has joined #ruby
lolmaus has quit []
u89 has joined #ruby
u89 has quit [Remote host closed the connection]
tbrock has joined #ruby
nomenkun has quit [Remote host closed the connection]
iamjarvo has quit [Quit: Computer has gone to sleep.]
nomenkun has joined #ruby
Rydefalk has joined #ruby
runixo has joined #ruby
<runixo>
heyas. is it possible to make minitest continue after the first failure?
samphippen has joined #ruby
zommi has joined #ruby
joofsh has joined #ruby
heftig has quit [Remote host closed the connection]
schaerli has joined #ruby
<evelyette>
I have quite large text file, which contains the following: !link!,which means the character '!" followed by the URL like https://page.com/test.png, followed by another '!'
<evelyette>
what I would like to do is to search for all occurences of those structures in string
nemonic has quit [Ping timeout: 264 seconds]
<evelyette>
recognize the URL (which always points to a PNG (possibly behing authentication), download the picture and insert the base64 of the picture on that place
<evelyette>
I'm fairly new to ruby, so any guidelines are welcome
<durre>
coretracker: hmm, how does that help me write selenium tests? :) looks like a webframework?
<mohanmcgeek>
durre: That's what they told you.. :S
<mohanmcgeek>
durre: It's a tool.. that simplifies your life.
mercwithamouth has quit [Ping timeout: 260 seconds]
shtirlic has joined #ruby
<durre>
sorry, dont understand what you mean. "Sinatra is a DSL for quickly creating web applications in Ruby with minimal effort"… I already have a webapplication. I want to write some tests for it
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
morf has quit [Quit: eof]
<shevy>
durre I think they all suck... whatever I tried, rspec... minitest... unittest... they all stink
<mohanmcgeek>
durre: When I came here, the conversation was already midway.. So I have no clue what's the original topic. What I know is, Sinatra is not a framework.
fantazo has joined #ruby
<mklappstuhl>
I'm writing a parser... I'm not sure if I should write it in a way that instantiates a parser object for each file or if one parser object should be able to handle multiple files
<mklappstuhl>
would love to hear your input on that
<shevy>
beer
<Coretracker>
@durre sorry my fault. i've read the question to fast
<shevy>
mklappstuhl, I think your parser object should be able to handle both one file and several files
u89 has joined #ruby
<shevy>
array_with_all_your_files.each do |file| process(file) end
<mklappstuhl>
shevy, for general usage this is true of course.
jackiechan0 has joined #ruby
<mklappstuhl>
shevy, however it feels like it would be much cleaner if I could use ivars for certain data instead of building everything by connecting functions
__zfn__ has joined #ruby
chrisja has joined #ruby
<shevy>
yeah, I always wonder about that myself
tbrock has quit [Quit: Computer has gone to sleep.]
<shevy>
when to use complexity and when to avoid it
_guy has joined #ruby
<mklappstuhl>
shevy, and the processing of multiple files would not be hard to implement as file.each do {|file| Parser.new(file) ... }
njkt has left #ruby [#ruby]
<mklappstuhl>
shevy, exactly.
<shevy>
I think it all depends on the fate of that data you gather that way
<shevy>
but right now it seems as if you only need one parser object anyway or?
<shevy>
which could handle 100 files
<shevy>
or 10000000 files
<shevy>
or 1 file :P
<mklappstuhl>
shevy, in this concrete case I only want to print certain stuff
larissa has quit [Quit: Leaving]
<mklappstuhl>
shevy, at the moment one parser object can handle multiple files
mohanmcgeek has left #ruby [#ruby]
<shevy>
\o/
replore_ has quit [Remote host closed the connection]
<mklappstuhl>
shevy, I think however that the code would be much nicer when restricting one parser object to one file
<mklappstuhl>
The advantage i'm seeing is mostly the use of ivars which allow me to save certain stuff in the object itself.
shtirli__ has joined #ruby
<mklappstuhl>
working with zipped files this seems very useful to store some basic information for reuse
joofsh has quit [Remote host closed the connection]
tbrock has joined #ruby
thinkdevcode has quit [Remote host closed the connection]
<mklappstuhl>
as working with zip files is mostly restricted within a block like {|zip_file| do_whatever(zip_file) }
<evelyette>
hi
<evelyette>
I'm trying to use this code: http://dpaste.com/834819/ but the 'body' variable is not working ... I get the actual address of the object in memory, but not the actual string
<evelyette>
any ideas ?
shtirlic has quit [Ping timeout: 255 seconds]
<evelyette>
The output is: #<Net::HTTPOK:0xa0e2cd4>
<evelyette>
which is not OK, should be base64 encoded picture
dertyp has joined #ruby
<mklappstuhl>
shevy, any more opinions? :)
replore_ has joined #ruby
|RicharD| has joined #ruby
<|RicharD|>
hi
runixo has quit [Ping timeout: 246 seconds]
<|RicharD|>
how i can take the first number of a int ? (example 1000, i want 1)
<|RicharD|>
i must convert into string ?
<hoelzro>
|RicharD|: that's the easiest way
leifmadsen has quit [Quit: REBOOTZ!]
Nykolla has joined #ruby
Nykolla has quit [Remote host closed the connection]
<shevy>
mklappstuhl hmm not really, things often seem to become more and more complex
jphpsf has quit [Ping timeout: 244 seconds]
runixo has joined #ruby
<shevy>
I wrote so many .rb files to handle compiling things from source... some days ago I just wrote one class 50 lines configure/make/make install wrapper and it's so much easier... only missing a few things... now I wonder if I should make it more complex too when adding more features!
cakehero has joined #ruby
shtirli__ has quit [Remote host closed the connection]
shtirlic has joined #ruby
otters has joined #ruby
shtirlic has quit [Remote host closed the connection]
shtirli__ has joined #ruby
robbyoconnor has quit [Ping timeout: 252 seconds]
Goles has quit [Remote host closed the connection]
xpen has joined #ruby
medik has quit [Quit: medik has no reason]
nari has quit [Ping timeout: 260 seconds]
elsifaka has quit [Quit: Veloma e!]
tagrudev has quit [Quit: Me = Awesome]
v0n has joined #ruby
u89 has quit [Remote host closed the connection]
banisterfiend has joined #ruby
_guy has quit [Remote host closed the connection]
darksk1ez has quit [Remote host closed the connection]
_guy has joined #ruby
Banistergalaxy has quit [Read error: Connection reset by peer]
babinho has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 244 seconds]
ExxKA has joined #ruby
Vainoharhainen has joined #ruby
heftig has quit [Quit: leaving]
<ExxKA>
Hey Guys. When i run an example script from Activemerchant, i get an error: "undefined method `first' for "24324245":String (NoMethodError)" i believe it's because active support is not loaded, but in the active merchant.rb module file I see that it does get loaded. How can I investigate this further?
babinho has joined #ruby
mercwithamouth has joined #ruby
elux has joined #ruby
<ExxKA>
I am not using Rails.. I am running it straight from the ruby interpreter
jds has joined #ruby
_JamieD_ has joined #ruby
<BrianJ>
can you put a case statement inside a case statement?
<apeiros_>
BrianJ: of course
<apeiros_>
BrianJ: also - irb/pry for "can I" questions. just try yourself ;-)
Banistergalaxy has joined #ruby
Guest92676 has joined #ruby
jds has quit [Ping timeout: 248 seconds]
linoj has quit [Quit: linoj]
aaronmcadam has quit [Quit: aaronmcadam]
aaronmcadam has joined #ruby
daniel_- has joined #ruby
v0n has joined #ruby
arya has quit [Ping timeout: 244 seconds]
dekroning has quit [Read error: Connection reset by peer]
chussenot has joined #ruby
arya has joined #ruby
apeiros_ has quit [Remote host closed the connection]
Coretracker has quit [Remote host closed the connection]
aganov has quit [Remote host closed the connection]
<jrabbit>
apeiros_: I shouldn't be tryign to use a list comprehension right?
<apeiros_>
I don't know what you should and shouldn't. but ruby doesn't have list comprehension syntax like python.
statarb3 has quit [Quit: Leaving]
<jrabbit>
ah well that settles it :P
<lupine>
fortunately, it doesn't need it ^^
<lupine>
the python syntax is nasty
<jrabbit>
maybe I'll write the section and ask if it could be better
kidoz has quit [Quit: Ухожу я от вас]
<jrabbit>
lupine: going through an .. iterable (?) via an each and appending to a list feels like its kludgey
<apeiros_>
jrabbit: Array#map
<lupine>
there's always collect
<banisterfiend>
jrajav: give an example of what u want to do, and we'll tell u how to do it in ruby
<lupine>
and you can always write collect_and_compact
nomenkun has quit [Remote host closed the connection]
<jrajav>
banisterfiend: .. huh?
<banisterfiend>
jrabbit: sorry*
<banisterfiend>
jrajav: completion fail :)
<lupine>
(you could call it comprehend - a la my_results = [1,2,'a'].comprehend {|i| i if (0..9).include?(i) }
<jrabbit>
map works
arya has quit []
<apeiros_>
jrabbit: in pry, to get the docs, you can type: ? Array#map
* lupine
finds .map {}.compact to be a bit clunky, but it's a minor niggle
<jrabbit>
The command '?' is unavailable because it requires the following gems to be installed: ruby18_source_location
<apeiros_>
(# to designate an instance method)
<jrabbit>
:(
<lupine>
there's select, of course
<apeiros_>
jrabbit: eeeew, you use ruby 1.8?
<apeiros_>
get a decent ruby version
<apeiros_>
you wouldn't use python 1 either, would you?
<jrabbit>
ok ok :P
<apeiros_>
1.9.3 is the current version. minors also matter in ruby.
* lupine
notes he has several production environments using ruby 1.8 right now, with no obvious plans to upgrade
<banisterfiend>
jrabbit: and u have to install the pry-doc gem once u upgrade the ruby version
<jrabbit>
I'm just using the apple default
<clocKwize>
1.9.4 is current
<lupine>
it's not a big deal
clj_newb has quit [Ping timeout: 252 seconds]
<lupine>
(although it will be when security support vanishes)
mpereira has quit [Ping timeout: 240 seconds]
jslowe has joined #ruby
<jrabbit>
what exactly is array compact?
<jrabbit>
I get what map is from functional work I've done
<lupine>
it pulls all the nil objects out of the array
<lupine>
so [1,nil,2] => [1,2]
<jrabbit>
ah
cantonic has joined #ruby
<lupine>
the comprehension I gave above would be better done as select, but for a comprehension like [1,2,'a'].map {|i| i*2 if (0..9).include?(i) }.compact it's needed
<lupine>
(since the output from the map otherwise woudl be [2,4,nil])
<jrabbit>
went with doc.html.css('h6.byline').css('a').map{|n| n.content}.compact
mpereira has joined #ruby
<jrabbit>
which nicely gives me a list of authors on a given NYT article
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
atmosx has joined #ruby
<lupine>
ah well, home time
<jrabbit>
i'll be back in a bit thanks folks
judd7 has joined #ruby
tomsthumb has quit [Quit: Leaving.]
applesarefruits has joined #ruby
daniel_-_ has joined #ruby
becom33 has quit [Ping timeout: 255 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
daniel_- has quit [Read error: Operation timed out]
Elhu has joined #ruby
barkha has joined #ruby
Elhu has quit [Client Quit]
mklappstuhl has joined #ruby
monkegji_ has left #ruby ["Leaving..."]
<apeiros_>
clocKwize: 1.9.4? and you get that from where?
* atmosx
is listening to Sting - Englishman In New York, from the album The Best Of 25 Years CD1 [4:26 mins] [320 kbps MPEG audio file] [10,84 MB] [played 45 times]
<atmosx>
lol
<atmosx>
45 times!
workmad3 has quit [Ping timeout: 255 seconds]
J-_-L1 has quit [Client Quit]
mercwithamouth has quit [Quit: Lost terminal]
mercwithamouth has joined #ruby
sepp2k1 has joined #ruby
pavilionXP has quit [Ping timeout: 240 seconds]
becom33 has joined #ruby
tommyvyo has joined #ruby
sepp2k has quit [Ping timeout: 244 seconds]
timmow has quit [Quit: has left the building]
carloslopes has joined #ruby
rdark has quit [Quit: leaving]
thinkdevcode has quit [Remote host closed the connection]
eldariof has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
_dnyy has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
dnyy has quit [Read error: Connection reset by peer]
slainer68 has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
tjbiddle has joined #ruby
answer_42 has quit [Ping timeout: 276 seconds]
tjbiddle has quit [Client Quit]
RantriX has joined #ruby
answer_42 has joined #ruby
tommyvyo has joined #ruby
bradhe has joined #ruby
reinaldob has quit [Remote host closed the connection]
arya has joined #ruby
arturaz has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 244 seconds]
CamonZ has quit [Quit: Leaving...]
tk__ has quit [Quit: ばいばい]
micsha has joined #ruby
pavilionXP has joined #ruby
jgrevich has joined #ruby
<micsha>
what do you guys like for ruby documentation? I'm on ruby-doc.org but it's kind of hard to understand as a beginner. Any recommendatoins?
_guy has joined #ruby
zigomir has quit [Ping timeout: 264 seconds]
<micsha>
*recomendations
dinkytoy has joined #ruby
<RantriX>
+r
bradhe has quit [Ping timeout: 250 seconds]
<atmosx>
micsha: I almost never use it. Only If I'm looking for something very specific that can't be found elseplace.
<RantriX>
i think it's pretty helpful once you understand how to read it haha
<atmosx>
it's a language that you have to be used to, and also be prominent with programming (C and Ruby) in order to keep up.
<micsha>
atmosx where do you go when you do need it?
<atmosx>
google
<atmosx>
mailing lists
<atmosx>
here
<micsha>
Thanks. there was another place, I'll have to hunt it down again.
replore_ has quit [Remote host closed the connection]
<micsha>
RantiX: yeah, that's kind of my problem, I don't understand how to read it quite yet.
daniel_-_ has quit [Ping timeout: 244 seconds]
Mon_Ouie has joined #ruby
F1skr has joined #ruby
jackiechan0 is now known as jackiechan
nemesit has joined #ruby
cdt_ has quit [Ping timeout: 245 seconds]
jackiechan is now known as jackbrown
chimkan has quit [Quit: chimkan]
<RantriX>
@micsha: i didn't either at the beginning but you'll get used to it haha. i often use it to see what sort of methods a class has
mityaz has quit [Read error: Connection reset by peer]
Goles has joined #ruby
<micsha>
yeah, I'm trying to find a reference that explains it a little more noob friendly way. Not sure I'll ever find that, but hey, I can dream.
ExxKA has quit [Quit: This computer has gone to sleep]
<apeiros_>
I mean precisely. since "no visible effect" says nothing at all.
phelps has joined #ruby
joeycarmello has quit [Remote host closed the connection]
<Banistergalaxy>
Apeiros hey how do I get the list of indices that a string would split on (using split()) given a regex?
KevinSjoberg has joined #ruby
BrianJ has joined #ruby
<apeiros_>
good question… probably with scan & one of the $ vars…
aaronmcadam has joined #ruby
mklappstuhl has joined #ruby
<apeiros_>
oh wow, post_match/pre_match fail with scan…
ryanlecompte has joined #ruby
<apeiros_>
hm, no good idea
<apeiros_>
stringscanner in that case :-/ (ugly, I know)
<JPeterson>
apeiros_: idling, no output to stdout, same output as the command "ruby"
<JPeterson>
or same effect i should say
mikepack has joined #ruby
<apeiros_>
JPeterson: you did pass it something on stdin, right?
<JPeterson>
no
hackerdude has quit [Remote host closed the connection]
<JPeterson>
maybe it reads from stdin
<JPeterson>
"cat Dice-2.svg|svgtidy.rb" might be the usage
noyb has joined #ruby
morfin has joined #ruby
<morfin>
hello
morfin has left #ruby [#ruby]
jackiechan0 has joined #ruby
banisterfiend has joined #ruby
xandy is now known as xAndy
<banisterfiend>
hey apeiros_ can you paste the Q. that Banistergalaxy asked?
<apeiros_>
20:47 Banistergalaxy: Apeiros hey how do I get the list of indices that a string would split on (using split()) given a regex?
jackiechan0 is now known as jackbrownhf
jackbrownhf has quit [Changing host]
jackbrownhf has joined #ruby
ryanlecompte has quit [Ping timeout: 244 seconds]
diegoviola has quit [Read error: Operation timed out]
<banisterfiend>
apeiros_: thanks
cantonic has joined #ruby
<banisterfiend>
apeiros_: can u figure it out pls
<banisterfiend>
apeiros_: i trust u
<banisterfiend>
:D
<apeiros_>
banisterfiend: I thought enum_for + scan + pre_match would do
<apeiros_>
but pre_match with scan is dysfunctional :-(
noyb has quit [Ping timeout: 252 seconds]
hackerdude has joined #ruby
mahmoudimus has joined #ruby
pcarrier has joined #ruby
burgestrand has joined #ruby
clj_newb has quit [Ping timeout: 244 seconds]
FailDrain has quit [Ping timeout: 244 seconds]
hackerdude has quit [Remote host closed the connection]
adeponte has joined #ruby
etcetera has joined #ruby
jphpsf has quit [Ping timeout: 244 seconds]
pcarrier has quit [Ping timeout: 240 seconds]
cantonic has quit [Read error: Connection timed out]
fantazo has quit [Remote host closed the connection]
heftig has joined #ruby
noyb has joined #ruby
pcarrier has joined #ruby
pcarrier has quit [Max SendQ exceeded]
pcarrier has joined #ruby
ryannielson has joined #ruby
a215 has quit [Ping timeout: 250 seconds]
shtirlic has joined #ruby
rweng has joined #ruby
eldariof has quit []
otters has quit [Ping timeout: 252 seconds]
pcarrier has quit []
greenarrow has quit [Quit: IRC is just multiplayer notepad]
joeycarmello has joined #ruby
pyr0commie has joined #ruby
<rweng>
hey. How do you folks move classes around? I found it incredibly hard to move move a class to a different module due to the lack of IDE/TextEditor suport
greenarrow has joined #ruby
havenn has joined #ruby
banisterfiend has quit [Remote host closed the connection]
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
<shevy>
rweng copy paste via your editor!
otters has joined #ruby
MasterIdler has joined #ruby
<apeiros_>
rweng: if you need an editor, rubymine - it has refactoring support
<apeiros_>
but how I do it? global search & replace.
monkegjinni has joined #ruby
phelps has quit [Read error: Connection reset by peer]
danneu has quit [Ping timeout: 252 seconds]
niklasb has joined #ruby
bradhe has quit [Remote host closed the connection]
arya has quit [Ping timeout: 244 seconds]
ananthakumaran has quit [Quit: Leaving.]
rippa has quit [Ping timeout: 248 seconds]
_dnyy has quit [Remote host closed the connection]
noyb has quit [Ping timeout: 265 seconds]
jrajav has joined #ruby
ffranz has quit [Quit: Leaving]
arya has joined #ruby
staafl has joined #ruby
<rweng>
apeiros_: Even RubyMine doesn't support moving classes and replacing the namespaces accordingly. I am shocked that I notice just now how painful renaming namespaces and everything that comes with it is with Ruby. I am not saying that is a Ruby problem. Though, uninitialised constant errors in cases of Namespace::MyClass don't make it easy and editors are really not that good for Ruby
BoomCow has joined #ruby
Elhu has joined #ruby
<ddd>
err? wait, how does RubyMine not allow you to refactor classes? All you have to do is select refactor and it will rename classes throughout as well. *I* use it along with ™, and vim. I found ™ and Vim have issues where RM does not
<ddd>
wow, MBP really? you're going to change T M to ™ on me? sheesh
<apeiros_>
(and that's all a namespace move really is…)
Grieg has quit [Quit: laterz! :D]
aaronmcadam has quit [Quit: aaronmcadam]
<rweng>
apeiros_: true, partially. In N1::N2::N3, it works to rename any namespace, but it does not work to rename N3 to N3::Forms
<ddd>
my only real issue with RM is the need to constantly update templates for stuff. but thats by sheer fact that things change so fast. Like they don't support the rspec-rails+capybara2 feature-spec stuff yet. so i had to write my onw.
<rweng>
e.g
mengu_ has joined #ruby
<ddd>
but thats fine. if i have to i have to
freakazoid0223 has joined #ruby
<ddd>
s/onw/owns/g
sepp2k1 has quit [Ping timeout: 264 seconds]
danneu has joined #ruby
<apeiros_>
rweng: I'm pretty sure that's possible too
<ddd>
oh that and the fact that if you click off far to the right for whatever reason it leaves the cursor there rather than moving it to the end of whatever line you clicked on. hehe thats more than a bit annoying but. hey we can't hav eit all
<apeiros_>
rweng: anyway, if you can't refactor by hand, you lose anyway… but that's just my opinion.
<apeiros_>
"Oh my god, no refactor, so bad for ruby, *cry cry cry*", sorry, but wtf?!
techhelp has joined #ruby
<ddd>
apeiros_: my only poin of agreement with the refactor argument is just that its easy to miss something by hand, and it IS an issue an editor should handle no problem that supports projects
<ddd>
however, i also see and can concede your pont
<apeiros_>
dunno, I've had my share of renamings, and it never bothered me to do it by hand.
<apeiros_>
but… if you're referencing one thing in a thousand places, you maybe have a coupling issue…
<apeiros_>
i.e., use of utilities to combat the consequences of bad design?
arya has quit [Ping timeout: 244 seconds]
clj_newb has joined #ruby
<ddd>
hehe'
otters has quit [Ping timeout: 252 seconds]
adambeynon has quit [Quit: Computer has gone to sleep.]
daniel_-_ has joined #ruby
sepp2k has joined #ruby
arya has joined #ruby
otters has joined #ruby
mikepack has quit [Remote host closed the connection]
clocKwize_ has joined #ruby
mercwithamouth has quit [Ping timeout: 252 seconds]
hugo has joined #ruby
kil0byte_ has joined #ruby
ryannielson has quit [Quit: ryannielson]
runixo has left #ruby [#ruby]
kil0byte has quit [Ping timeout: 244 seconds]
tommyvyo has quit [Quit: Computer has gone to sleep.]
shtirlic has quit [Remote host closed the connection]
Synthead has joined #ruby
shtirlic has joined #ruby
chimkan__ has joined #ruby
Mchl has quit [Ping timeout: 252 seconds]
Mchl has joined #ruby
tjbiddle has joined #ruby
Morkel has quit [Quit: Morkel]
BrianJ has quit [Quit: BrianJ]
arya has joined #ruby
bradhe has quit [Ping timeout: 260 seconds]
tjbiddle has quit [Client Quit]
joeycarmello has quit [Remote host closed the connection]
Proshot has joined #ruby
<Blaster>
Hey all, I am trying to follow an example from a book I am reading but I am getting an error. My code is here https://gist.github.com/4133042
joeycarmello has joined #ruby
chimkan has quit [Ping timeout: 252 seconds]
chimkan__ is now known as chimkan
<Blaster>
Error is: bicycle.rb:7:in `initialize': undefined local variable or method `rim' for #<Gear:0x000000154bef28 @chainring=52, @cog=11> (NameError)
jimeh has quit [Quit: Computer has gone to sleep.]
shtirlic has quit [Ping timeout: 244 seconds]
statarb3 has quit [Ping timeout: 246 seconds]
arturaz has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
joeycarmello has quit [Ping timeout: 248 seconds]
monkegjinni has joined #ruby
seanwash has joined #ruby
banisterfiend has quit [Remote host closed the connection]
<seanwash>
Happy Thanksgiving everyone
Mchl has quit [Ping timeout: 244 seconds]
<pskosinski>
Unhappy Thanksgiving.
Mchl has joined #ruby
Elhu has joined #ruby
<shevy>
Blaster "rim" is not known
<shevy>
you must find out why
<shevy>
@wheel = Wheel.new(rim, tire) <-- you use it here, but it is not known there
workmad3 has joined #ruby
Iszak has joined #ruby
<apeiros_>
Blaster: I think you're supposed to pass the wheel in, via the wheel-argument
<apeiros_>
and not create it there
jimeh has joined #ruby
<shevy>
I'd change this to "Wheel.new" without arguments and set default arguments in class Wheel
monkegjinni has quit [Ping timeout: 240 seconds]
<shevy>
yeah that makes sense
<apeiros_>
I think line 7 is supposed to read: @wheel = wheel
etcetera has quit [Quit: Computer has gone to sleep.]
icole has quit [Remote host closed the connection]
hackerdude has joined #ruby
emmanuelux has joined #ruby
jarred_ has joined #ruby
Elico has quit [Read error: Connection reset by peer]
icole has joined #ruby
jslowe has quit [Ping timeout: 246 seconds]
techhelp has quit [Quit: This computer has gone to sleep]
generalissimo has quit [Remote host closed the connection]
Elico has joined #ruby
Elico has quit [Read error: Connection reset by peer]
clj_newb has joined #ruby
beiter has quit [Quit: beiter]
v0n has quit [Ping timeout: 244 seconds]
Elico has joined #ruby
Elico has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 246 seconds]
jrajav has quit [Quit: I tend to be neutral about apples]
jarred_ has quit [Ping timeout: 244 seconds]
icole has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 244 seconds]
KevinSjoberg has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Elico has joined #ruby
Elico has quit [Read error: Connection reset by peer]
sporkball has quit [Quit: Computer has gone to sleep.]
robbyoconnor has joined #ruby
tenmilestereo has quit [Quit: Leaving]
Elico has joined #ruby
Russell^^ has quit [Quit: Russell^^]
freeayu has joined #ruby
Elico has quit [Read error: Connection reset by peer]
ChampS666 has quit []
<micsha>
if I used the Array method pack and I have 10 numbers in the array, do I have to have a 10 of the options in the pack method for each byte in the string?
arya_ has joined #ruby
arya has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
<cirwin>
micsha: just suffix the option by 10: (0..10).to_a.pack("n10")
Elico has joined #ruby
adeponte has quit [Remote host closed the connection]
d34th4ck3r has quit [Quit: Konversation terminated!]
Elico has quit [Read error: Connection reset by peer]
hackerdude has quit [Remote host closed the connection]
hotovson has quit [Remote host closed the connection]
hackerdude has joined #ruby
kil0byte has quit [Ping timeout: 250 seconds]
Elico has joined #ruby
hotovson has joined #ruby
miphe has quit [Quit: Leaving]
moted has quit [Remote host closed the connection]
icole has joined #ruby
punkrawkR has quit [Read error: Connection reset by peer]
wargasm has quit [Read error: Connection reset by peer]
Elico has quit [Remote host closed the connection]
sepp2k has quit [Read error: Connection reset by peer]
icole has quit [Remote host closed the connection]
elaptics is now known as elaptics`away
hotovson has quit [Ping timeout: 244 seconds]
prakriti has quit [Quit: Leaving]
fantazo has quit [Read error: Operation timed out]