tkuchiki has quit [Remote host closed the connection]
Azulinho has quit [Ping timeout: 256 seconds]
christia_ has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
<[k->
I should grep the logs for <Ox0dea> >>
christiandsg has joined #ruby
eggoez has quit [Ping timeout: 252 seconds]
t_ has quit [Remote host closed the connection]
christiandsg has quit [Read error: Connection reset by peer]
jbw_ has quit [Ping timeout: 244 seconds]
t_ has joined #ruby
hotpancakes has joined #ruby
<Ox0dea>
[k-: Having them all in close proximity like that makes me look like a total nutter. :P
<[k->
hue hue hue
<[k->
I should write a script for this
* Ox0dea
is currently trying to figure out a symbols-only encoding of the Latin alphabet that doesn't break during regex interpolation.
<Ox0dea>
14 of the 29 ASCII symbols have meaning in regular expressions. :/
fallen_ has joined #ruby
junies has joined #ruby
hotpancakes has quit [Ping timeout: 240 seconds]
<junies>
is it possible to make a pokemon game in ruby?
<Ox0dea>
junies: Of course.
jbw_ has joined #ruby
<junies>
what would it require Ox0dea
Azulinho has joined #ruby
<Ox0dea>
Many things.
<[k->
wise words, wise words
<Ox0dea>
junies: A comprehensive data source, a thoroughly contemplated object hierarchy, all the various formulae, and lots of special-casing for special moves and such.
icebourg has joined #ruby
howdoicomputer has joined #ruby
dudo has quit [Ping timeout: 265 seconds]
pengin has joined #ruby
darkf has joined #ruby
<[k->
wait a minute... you are trying to encode alphabets in symbols?!
hakunin has quit [Remote host closed the connection]
<Ox0dea>
Just the Latin one.
v4n has quit []
tkuchiki has joined #ruby
<Ox0dea>
And just lowercased letters, which I realize are technically "symbols", but I trust you catch my meaning.
tkuchiki has quit [Remote host closed the connection]
atomical_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k->
common letters should be given one letter symbols like utf-8 does!
<[k->
or is that utf-7
gix has quit [Ping timeout: 264 seconds]
<Ox0dea>
Well, I'd of course like to be able to just use one symbol for each letter, but then I won't be able to use the String =~ Regex trick to obtain the index into the alphabet.
RegulationD has joined #ruby
<Ox0dea>
I'll have to loop for every character of every string. :/
<i8igmac>
without nokogiri, looks like eval.in dont have nokogiri
<chipotle>
i just got out of a 300mg k hole
<chipotle>
oops, wrong channel
<Ox0dea>
Ha.
RegulationD has quit [Ping timeout: 246 seconds]
<i8igmac>
so, ever once in a while i run into some errors that crash the script
<i8igmac>
due to the connection
<i8igmac>
in `read_nonblock': end of file reached (EOFError)
fallen_ is now known as atesec
Musashi007 has joined #ruby
<i8igmac>
i hope to cover all errors that you could experience from a http connection
pengin has quit [Remote host closed the connection]
jbw_ has quit [Ping timeout: 244 seconds]
xcesariox has joined #ruby
<i8igmac>
well, eval.in dont allow sockets
jbw_ has joined #ruby
reset has quit [Quit: Leaving...]
<Ox0dea>
i8igmac: It's clear enough what you're trying to do, though.
<Ox0dea>
But why do you want to do it manually rather than let the abstraction do what it's meant to?
<i8igmac>
what do you mean
<Ox0dea>
Well, HTTPError is there to catch the various non-200 response codes, and you're handling timeout and connection reset. Besides losing the connection (the cause of your EOFError, likely as not), what all do you feel you're missing?
<[k->
[02:02:38] <ruboto> Ox0dea # => /tmp/execpad-8e19d5c57214/source-8e19d5c57214:2: warning: string literal in condition ...check link for more (https://eval.in/396413)
Rollabun_ has quit [Remote host closed the connection]
<JMoir>
I don't get any errors, it just does nothing.
Rollabunna has joined #ruby
<sevenseacat>
you wouldnt get any, because youre not checking for them
leonardoajim has quit [Quit: Be back later ...]
<JMoir>
Haha, right. But the database is empty and I'm specifically putting in data that is valid, so there shouldn't be a problem right?
konsolebox has joined #ruby
<sevenseacat>
check and see? :)
fabrice31 has quit [Ping timeout: 252 seconds]
<sevenseacat>
what does User.create return?
ruby-lang922 has left #ruby [#ruby]
simplyianm has joined #ruby
ruby-lang722 has joined #ruby
FernandoBasso has joined #ruby
allcentury has joined #ruby
dfockler has joined #ruby
eGGsha has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
<JMoir>
Ah, it's setting the id to nil
zacstewart has joined #ruby
simplyianm has quit [Ping timeout: 248 seconds]
ruby-lang722 has quit [Ping timeout: 246 seconds]
melter has quit [Ping timeout: 246 seconds]
<JMoir>
I thought property :id, Serial is supposed to create an autoincrementing integer, why is it set to nil?
dfockler has quit [Ping timeout: 248 seconds]
<sevenseacat>
do you have any validation errors on the user record?
<JMoir>
Ah... The password hash is too long
<sevenseacat>
:)
<JMoir>
Haha, thanks xD
<sevenseacat>
np
Ropeney has joined #ruby
lkba has joined #ruby
joelataylor has quit [Quit: Be back later ...]
<JMoir>
Yup, that was it. All working now :)
<sevenseacat>
good stuff
[k- has quit [Ping timeout: 244 seconds]
<ledestin>
I've seen people embed Github code into web pages, but all I can find is gist-it. Those embeds that I've seen were like "hosted with love by Github"
lkba_ has quit [Ping timeout: 246 seconds]
<ledestin>
any ideas?
<sevenseacat>
ledestin: use the embed URL on a gist?
<ledestin>
sevenseacat ah, right, they only do gists :(
<sevenseacat>
got an example of what you mean, then?
MarkTurner has quit [Read error: Connection reset by peer]
MarkTurner has quit [Read error: Connection reset by peer]
<ledestin>
sevenseacat there's example embedded
<ledestin>
those that I mentioned earlier are apparently gists by Github
<sevenseacat>
indeed.
<sevenseacat>
thats why i asked :P
<ledestin>
but gists won't do
melter has joined #ruby
zacstewart has quit [Ping timeout: 256 seconds]
bubbys has quit [Ping timeout: 264 seconds]
juanpablo_ has joined #ruby
ada2358 has quit [Ping timeout: 256 seconds]
ada2358 has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
Musashi007 has joined #ruby
juanpablo_ has quit [Ping timeout: 256 seconds]
surs2 has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
omegahm has quit [Remote host closed the connection]
surs1 has quit [Ping timeout: 264 seconds]
peter_paule has joined #ruby
randiman has joined #ruby
DLSteve has joined #ruby
Musashi007 has quit [Read error: Connection reset by peer]
fantazo has joined #ruby
braincrash has quit [Ping timeout: 252 seconds]
braincra- has joined #ruby
braincra- is now known as braincrash
sharpmachine has joined #ruby
bubbys has joined #ruby
yfeldblu_ has quit [Ping timeout: 248 seconds]
randiman has quit [Quit: (null)]
omegahm has joined #ruby
ht__ has joined #ruby
quimrstorres has joined #ruby
sharpmachine has quit [Ping timeout: 246 seconds]
denym_` has joined #ruby
Musashi007 has joined #ruby
<denym_`>
Hey guys! Is there an escape sequence that also does the auto indentation? Like I have 2 Spaces in front of a text and do a \n at the end that the newline is also already 2 spaces?
Renich has quit [Quit: leaving]
neanderslob_ has quit [Read error: Connection reset by peer]
nfk has joined #ruby
MarkTurner has joined #ruby
jroith has joined #ruby
<hanmac>
denym_`: it depends what you want to indent ... if its html or xml code you can use nokogiri for indenting
hotpancakes has joined #ruby
<jhass>
I'd say the answer is no
peter_paule has quit [Ping timeout: 264 seconds]
surs3 has joined #ruby
mike___1234 has quit [Ping timeout: 256 seconds]
timonv has quit [Ping timeout: 250 seconds]
rbowlby has joined #ruby
edwinvdgraaf has joined #ruby
hotpancakes has quit [Ping timeout: 255 seconds]
peter_paule has joined #ruby
bodgix_wrk has quit [Quit: Leaving.]
surs2 has quit [Ping timeout: 264 seconds]
bruno- has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
eGGsha is now known as eGGshke
AlphaAtom has joined #ruby
eGGshke is now known as eGGsha
Squarepy has joined #ruby
surs4 has joined #ruby
surs3 has quit [Ping timeout: 256 seconds]
quimrstorres has quit [Remote host closed the connection]
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
allcentury has quit [Ping timeout: 248 seconds]
d3v has quit []
peter_paule has joined #ruby
Rollabun_ has joined #ruby
chinmay_dd has quit [Ping timeout: 265 seconds]
quimrstorres has quit [Remote host closed the connection]
Rollabunna has quit [Ping timeout: 248 seconds]
tomphp has joined #ruby
peter_paule has quit [Ping timeout: 252 seconds]
surs has joined #ruby
hotpancakes has joined #ruby
lxsameer has quit [Quit: Leaving]
MagePsycho has quit [Ping timeout: 244 seconds]
surs4 has quit [Ping timeout: 256 seconds]
ips|malc has joined #ruby
jimmythehat has joined #ruby
juanpablo_ has joined #ruby
fantazo has quit [Quit: Verlassend]
hotpancakes has quit [Ping timeout: 246 seconds]
chinmay_dd has joined #ruby
hosttor has joined #ruby
juanpablo_ has quit [Ping timeout: 255 seconds]
Timba-as has joined #ruby
jimmythehat has quit [Quit: Lost terminal]
xlogic has joined #ruby
scripore has joined #ruby
Timba-as has quit [Ping timeout: 246 seconds]
prestorium has joined #ruby
phutchins2 has joined #ruby
xlogic has quit [Client Quit]
anisha has quit [Ping timeout: 264 seconds]
MagePsycho has joined #ruby
dellavg has quit [Ping timeout: 264 seconds]
chinmay_dd has quit [Read error: Connection reset by peer]
serivich has joined #ruby
mahmoudmahfouz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chinmay_dd has joined #ruby
_blizzy_ has joined #ruby
bricker has joined #ruby
xkef has quit [Ping timeout: 252 seconds]
ndrei has quit [Ping timeout: 256 seconds]
ndrei has joined #ruby
Timba-as has joined #ruby
ips|malc has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mercwithamouth has joined #ruby
simplyianm has joined #ruby
sharpmachine has joined #ruby
lordkryss has joined #ruby
bricker has quit [Ping timeout: 256 seconds]
sevenseacat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bricker has joined #ruby
Musashi007 has quit [Quit: Musashi007]
mercwithamouth has quit [Ping timeout: 240 seconds]
simplyianm has quit [Ping timeout: 248 seconds]
sharpmachine has quit [Ping timeout: 264 seconds]
xkef has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
revath has quit [Ping timeout: 265 seconds]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rollabun_ has quit [Remote host closed the connection]
bricker has quit [Ping timeout: 256 seconds]
Rollabunna has joined #ruby
ndrei has joined #ruby
freerobby has joined #ruby
segfalt has joined #ruby
lkba_ has joined #ruby
prestorium has quit [Ping timeout: 246 seconds]
n008f4g_ has joined #ruby
olistik has quit [Remote host closed the connection]
quimrstorres has joined #ruby
eGGsha has joined #ruby
freerobby has quit [Client Quit]
lkba has quit [Ping timeout: 248 seconds]
victortyau has joined #ruby
peter_paule has joined #ruby
nfk has quit [Quit: yawn]
tomphp has joined #ruby
lkba has joined #ruby
[k- has joined #ruby
surs1 has joined #ruby
surs has quit [Ping timeout: 246 seconds]
lkba_ has quit [Ping timeout: 256 seconds]
tomphp has quit [Client Quit]
quimrstorres has quit [Remote host closed the connection]
quimrsto_ has joined #ruby
monod has quit [Quit: Sto andando via]
chouhoulis has joined #ruby
scripore has quit [Ping timeout: 248 seconds]
hotpancakes has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
quimrsto_ has quit [Remote host closed the connection]
mahmoudmahfouz has joined #ruby
chouhoulis has quit [Ping timeout: 252 seconds]
kirun has joined #ruby
hotpancakes has quit [Ping timeout: 255 seconds]
evanjs has joined #ruby
arashb has joined #ruby
joelataylor has joined #ruby
GPrime has joined #ruby
teoric has quit [Ping timeout: 252 seconds]
devdazed has joined #ruby
davedev2_ has quit [Ping timeout: 248 seconds]
davedev24_ has joined #ruby
arashb has quit [Ping timeout: 264 seconds]
devdazed has quit [Read error: Connection reset by peer]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
devdazed has joined #ruby
davedev2_ has joined #ruby
zacstewart has joined #ruby
ych_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
surs2 has joined #ruby
dagda1 has joined #ruby
surs1 has quit [Ping timeout: 256 seconds]
davedev24_ has quit [Ping timeout: 248 seconds]
bsdbofh has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zacstewart has quit [Ping timeout: 248 seconds]
yardenbar has quit [Ping timeout: 265 seconds]
evanjs has quit [Remote host closed the connection]
wlknsn has joined #ruby
<wlknsn>
Afternoon guys
<wlknsn>
Excited to join my new job on monday doing ruby, I'm being put through a 'Ruby Bootcamp'
lessless has joined #ruby
quimrstorres has joined #ruby
<jhass>
?guys
<ruboto>
we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
<jhass>
;)
<wlknsn>
apologies
quimrstorres has quit [Remote host closed the connection]
<wlknsn>
I meant guys and gals alike, here in England guys when spoken to kinda means both so please excuse my ignorance
<jhass>
yeah, it's regionally different
<shevy>
yeah
<shevy>
you guys rock!
<shevy>
it means both things at the same time!!!
<jhass>
shevy: if you're bored write some Ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
I am not bored at all, I am excited and happy
Rutix has joined #ruby
Rutix has joined #ruby
tmtwd has joined #ruby
sharpmachine has joined #ruby
AlphaAtom has joined #ruby
<shevy>
I wonder if Aderium solved his solaris problem
xkef has quit [Ping timeout: 252 seconds]
revath has joined #ruby
SCHAAP137 has joined #ruby
juanpablo_ has joined #ruby
nofxx has quit [Ping timeout: 246 seconds]
sharpmachine has quit [Ping timeout: 256 seconds]
<[k->
Poor shevy
<[k->
Shevy: did you see Ox0dea's oracle talk? :>
yardenbar has joined #ruby
bsdbofh has quit [Quit: bsdbofh]
<shevy>
[k- yeah
<shevy>
<Ox0dea> It's quite common in some circles to let children die with reckless abandon, only to immediately reincarnate them.
<shevy>
however soon after that you invoked his cthulhu code [k-
<shevy>
the oracle was not approving of those many lines from you [k- -> <Ox0dea> Honestly. <-- The Oracle was not happy.
<[k->
Telling you that triggered his unhappiness :(
<[k->
It was an accident!
<shevy>
hmm I just stumbled over this code written by someone else: Math::log10
<shevy>
that is more commonly written as Math.log10 these days right?
juanpablo_ has quit [Ping timeout: 255 seconds]
<[k->
Yes
beef-wellington has joined #ruby
Rollabun_ has joined #ruby
kobain has joined #ruby
hotpancakes has joined #ruby
but3k4 has joined #ruby
fenjamin has joined #ruby
<shevy>
I got all sorts of old weirdness Math::sin 45.degrees
Rollabunna has quit [Ping timeout: 256 seconds]
olistik has joined #ruby
surs3 has joined #ruby
dgutierrez1287 has joined #ruby
<shevy>
the ruby cgi stdlib also has those old ways all over everywhere
<shevy>
util.rb: # print CGI::unescapeElement(
<shevy>
html.rb: s << CGI::escapeHTML(value.to_s)
<shevy>
even camelcased methods!
<jhass>
old crufty stuff is old and crufty
fabrice31 has joined #ruby
hotpancakes has quit [Ping timeout: 250 seconds]
surs2 has quit [Ping timeout: 264 seconds]
radialneon_ has quit [Remote host closed the connection]
radialneon has joined #ruby
olistik has quit [Ping timeout: 246 seconds]
Rollabun_ has quit [Remote host closed the connection]
MarkTurner has quit [Ping timeout: 256 seconds]
Rollabunna has joined #ruby
<fenjamin>
is there a place to go for a more introductory conversation on Ruby?
<shevy>
well this here is #ruby
<[k->
Should we have a #ruby-beginner
<shevy>
so your topic is about ruby so it's a good topic to be had for #ruby
fabrice31 has quit [Ping timeout: 256 seconds]
<[k->
there is one for haskell
<shevy>
that's ok, haskell needs that
MarkTurner has joined #ruby
<fenjamin>
im trying to write a method that takes an integer as its input and returns a comma separated integer as a string
unshadow has joined #ruby
<[k->
You mean method(1000) == "1,000"?
<jhass>
fenjamin: call to_s and then forget that it's a number, view it as a series of characters in which you want to inject commas
peter_paule has quit [Ping timeout: 256 seconds]
aryaching has joined #ruby
halfdan has joined #ruby
<jhass>
also there's ##new2ruby but you're just as welcome here ;)
DLSteve has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xkef has joined #ruby
<halfdan>
is there a way to use Dir.glob and find directories that do NOT contain a file?
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
giuseppesolinas has joined #ruby
mahmoudmahfouz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mahmoudmahfouz has joined #ruby
<shevy>
halfdan just obtain all entries, and apply a .select or .reject
AlphaAtom has joined #ruby
<shevy>
on the directories there (File.directory? query)
hosttor has quit [Ping timeout: 265 seconds]
mahmoudmahfouz has quit [Client Quit]
AlphaAtom has quit [Max SendQ exceeded]
<[k->
He wants empty directories
AlphaAtom has joined #ruby
<[k->
Probably a delete script
<[k->
Gotta rid those damned empties
AlphaAtom has quit [Max SendQ exceeded]
Sehryn has joined #ruby
AlphaAtom has joined #ruby
FernandoBasso has quit [Quit: May the force be with you.]
FernandoBasso has joined #ruby
tmtwd has quit [Remote host closed the connection]
fenjamin has quit [Quit: 离开]
jwaldrip has joined #ruby
tmtwd has joined #ruby
revath has left #ruby [#ruby]
gizmore has joined #ruby
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
perhaps he wants to fill them with files!
eggoez has quit [Ping timeout: 256 seconds]
surs4 has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
surs3 has quit [Ping timeout: 256 seconds]
Thomas-0725 has joined #ruby
Rollabun_ has joined #ruby
<[k->
So if there are no empty directories, what's he gonna do
GitGud has quit [Read error: Connection reset by peer]
<shevy>
oh but we already helped, the problem is solved!
GitGud has joined #ruby
<shevy>
brb need to start mate-desktop
shevy has quit [Quit: ""]
beef-wellington has quit [Ping timeout: 256 seconds]
Timba-as has quit [Quit: Be back later ...]
shevy has joined #ruby
eggoez has quit [Ping timeout: 256 seconds]
chipotle has joined #ruby
hotpancakes has joined #ruby
bricker has joined #ruby
xkef has quit [Read error: Connection reset by peer]
s2013 has joined #ruby
MagePsycho has quit [Quit: MagePsycho]
mmasaki has quit [Quit: bye]
mmasaki has joined #ruby
eggoez has joined #ruby
shevy has quit [Quit: ""]
ndrei has quit [Ping timeout: 252 seconds]
shevy has joined #ruby
hotpancakes has quit [Ping timeout: 256 seconds]
sharpmachine has joined #ruby
mmasaki has quit [Client Quit]
mmasaki has joined #ruby
timonv has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
sharpmachine has quit [Ping timeout: 248 seconds]
bricker has quit [Ping timeout: 256 seconds]
bricker has joined #ruby
dgutierrez1287 has joined #ruby
eGGsha is now known as eGGshke
ferr has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
Thomas-0725 has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
Thomas-0725 has joined #ruby
hotpancakes has joined #ruby
tfitts has quit [Remote host closed the connection]
tfitts has joined #ruby
GPrime has quit [Max SendQ exceeded]
dgutierrez1287 has quit [Remote host closed the connection]
lalalaaa has joined #ruby
acke has joined #ruby
dgutierrez1287 has joined #ruby
acke has quit [Remote host closed the connection]
<lalalaaa>
Anybody know how to `gem install eventmachine` on FreeBSD? error: cannot initialize a parameter of type 'rb_fdset_t *' with an rvalue of type 'fd_set *' -- https://gist.github.com/anonymous/eab1a155289c25b23494
charliesome has joined #ruby
schov has joined #ruby
GPrime has joined #ruby
nathanstitt has joined #ruby
edwardly has quit [Ping timeout: 256 seconds]
acke has joined #ruby
Sehryn has quit [Ping timeout: 248 seconds]
bricker has quit [Ping timeout: 265 seconds]
hashrocket has joined #ruby
<schov>
hello, noob q - I'm wondering how to run a program within atom.io without resorting to command line
bricker has joined #ruby
Sehryn has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
<joneshf-laptop>
does `require` only look in `lib`?
acke_ has joined #ruby
<jhass>
joneshf-laptop: through all of $LOAD_PATH
hotpancakes has quit [Ping timeout: 256 seconds]
<jhass>
in the case of a gem rubygems adds all require_paths to the $LOAD_PATH
nathanstitt has quit [Client Quit]
<jhass>
(as specified in the gemspec)
MarkTurner has quit [Ping timeout: 256 seconds]
SilentEcho has joined #ruby
nathanstitt has joined #ruby
<joneshf-laptop>
How does `lib` get into `$LOAD_PATH`?
whomp has joined #ruby
<joneshf-laptop>
pry seems to only mention global path stuff
<joneshf-laptop>
nothing local
SilentEcho has quit [Client Quit]
<joneshf-laptop>
or maybe not, "How does `lib` get into `$LOAD_PATH`?", but when does require look outside of that for a `lib` directory?
<jhass>
you (or something, e.g. rubygems or bundler) adds it
nathanstitt has quit [Client Quit]
<joneshf-laptop>
so it might be something rspec is doing?
acke has quit [Ping timeout: 248 seconds]
<jhass>
mmh, I don't think rspec adds lib, but your spec_helper.rb might
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bigsky has left #ruby [#ruby]
bigsky has joined #ruby
bigsky has quit [Remote host closed the connection]
bigsky has joined #ruby
<bigsky>
hi all
bigsky_ has joined #ruby
<jhass>
hi
bricker has quit [Ping timeout: 240 seconds]
<havenwood>
hi
bronson has quit [Ping timeout: 264 seconds]
christiandsg has joined #ruby
<[k->
jhass just wasted some bytes
<[k->
Be thankful!
zacstewart has quit [Ping timeout: 265 seconds]
<jhass>
*invested
christiandsg has quit [Remote host closed the connection]
eGGsha has joined #ruby
<Ox0dea>
Is it possible to recover from $LOAD_PATH.clear?
zata has joined #ruby
surs has joined #ruby
<Ox0dea>
That is, if that were the first line of the program, does Ruby provide sufficient information that you could theoretically reconstruct the default load path?
dgutierrez1287 has quit [Remote host closed the connection]
<woodennails>
Can you folks recommend a small project to do tonight / tomorrow, i'm a beginner and start a new job on monday so kinda want to get ahead of the curve
<ljarvis>
woodennails: what type of project?
<ljarvis>
heftig: how big could it get?
<woodennails>
something very basic
<ljarvis>
woodennails: could you be more specific? you start a new job so presumably you're passed the basics :)
<heftig>
ljarvis: a handful of priorities, a hundred thousand jobs
startupality has quit [Quit: startupality]
charliesome has quit [Quit: zzz]
<existensil>
woodennails: you looking for a full stack project or pure ruby or rails but backend focused?
eGGsha has joined #ruby
Scroff has quit [Remote host closed the connection]
<ljarvis>
heftig: have you benched it? insertion could still be pretty slow I guess. It depends on your goal
baweaver has joined #ruby
<woodennails>
Well, thats the thing, Im a javascript developer and at my new job I'm going to be using Ruby as well and theyre fully aware I dont know Ruby and are going to train me on it.. just wanted to get a head start really :)
Scroff has joined #ruby
eGGsha is now known as eGGshke
eggoez has quit [Ping timeout: 252 seconds]
<existensil>
woodennails: i'd start with a simple TODO list application. That's a good one and will require you to get familiar with rails' resource routing and active record
eGGshke has quit [Client Quit]
<ljarvis>
woodennails: what type of Ruby will you be doing?
<woodennails>
Im not using Rails i dont believe... im using just pure Ruby :)
<existensil>
(assuming rails)
<ljarvis>
I've heard nothing about rails yet so wouldn't recommend that
<ljarvis>
are you doing web related stuff?
<woodennails>
yes :D i believe so
<ljarvis>
you start on Monday and don't know what your job entails? :D
Mia has quit [Read error: Connection reset by peer]
<existensil>
you should have asked more questions :-P
zacstewart has quit [Ping timeout: 240 seconds]
<woodennails>
I know its going to be mainly Javascript based I just know there may be some Ruby
<woodennails>
its for a junior developer role :)
<existensil>
that sure sounds like its probably rails. could be sinatra or something else.
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
Azulinho has quit [Ping timeout: 250 seconds]
<woodennails>
I asked and they said there isnt much Rails, its mainly Ruby and Sinatra :)
<existensil>
ah, ok
<woodennails>
maybe i'll look into Sinatra
peter_paule has joined #ruby
<existensil>
so do a todo list app in sinatra
NateDeHiggers has joined #ruby
<NateDeHiggers>
hi
Scroff has quit [Ping timeout: 255 seconds]
<woodennails>
:)
zacstewart has joined #ruby
<existensil>
woodennails: do you know what kind of data storage tools they are using? might be good to use something similar on your project
<existensil>
so mysql, mongo, postgresql, redis... whatever they are using
<woodennails>
I think i may just wait until Monday haha
<woodennails>
:D
<woodennails>
thanks folks
<heftig>
ljarvis: hm, getting around 12.787k (±12.0%) insertions/s starting with 100000 entries
<woodennails>
oh ps, any of you guys use Vim?
<woodennails>
just wanted to know how you had it set up with ruby
casadei_ has joined #ruby
<pontiki>
woodennails: over the weekend, maybe what you want to do is run through a bunch of ruby examples, koans, that sort of thing to get comfy with ruby by itself
<pontiki>
read the docs, etc.
<woodennails>
:)
<heftig>
ljarvis: compared to a normal Queue at 8.410M (± 6.5%) insertions/s
<jhass>
!ban NateDeHiggers 1d troll
NateDeHiggers is now known as ChipmunkHarris
<jhass>
!ban ChipmunkHarris 1d troll
<heftig>
well, it sucks, but i guess it's good enough
lalalaaa has joined #ruby
<jhass>
!ban ChipmunkHarris !T 1d troll
ChipmunkHarris was banned on #ruby by ChanServ [ChipmunkHarris!*@*]
ChipmunkHarris was kicked from #ruby by ChanServ [Banned: troll]
<shevy>
jhass lol are you scanning for naughty nicks?
<jhass>
meh, I need an alias
<existensil>
why is freenode having a recent rash of racist trolls? that never seemed to be a problem before
<havenwood>
shevy: Same boring troll, don't feed em.
nfk has joined #ruby
<havenwood>
existensil: One person can use a lot of nicks. :P
<existensil>
true. probably just one obnoxious racist that doesn't like going outside and being racist
<Gulaangga>
any ideas how to open URL that contains a dot like "http://www.alexa.com/siteinfo/google.com" with open-uri? I'm getting "rfc3986_parser.rb:66:in `split': bad URI(is not URI?)" because of "google.com" part
<gizmore>
#<Errno::ENOENT: No such file or directory - ping -W 1.0 -c 1>
SylarRuby has joined #ruby
Vile` has quit [Read error: Connection reset by peer]
<Gulaangga>
jhass: yes, thanks, I'm looking into it
ruurd has joined #ruby
<Gulaangga>
it's actually because I'm reading URLs from file
<jhass>
gizmore: 1) exec replaces the current process, 2) the multi arg form doesn't invoke a shell (no piping) 3) the multi arg form expects just the binary as first argument, no parameters
<Gulaangga>
with File.readlines('sites.txt').each
<toretore>
pipework: *a will capture **kwargs too
<gizmore>
jhass: thanks... should i use backticks and escape the host param?
<jhass>
Gulaangga: .chomp of the trailing \n
prestorium has joined #ruby
i8igmac has joined #ruby
<Gulaangga>
jhass: ok, thanks again
<jhass>
gizmore: no, do the | grep with ruby methods, it's good at such
<ruboto>
jhass, I don't know anything about cookie
<gizmore>
jhass: that looks complicated! :P
<apeiros>
?cookie jhass
<ruboto>
jhass, here's your cookie
zanloy has joined #ruby
<toretore>
wat
<jhass>
toretore: pretty much, I'm not sure on Ruby's "random interrupt" semantics, so putting the wait in a while that checks the condition is still good practice
<toretore>
oh you just added it
<apeiros>
hehe
<apeiros>
you were too quick
<apeiros>
CV should work correctly without additional safeguarding
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hotpancakes has quit [Ping timeout: 248 seconds]
RobertBirnie has joined #ruby
<toretore>
ok then tell me this if ure so smatr, why am i getting "fatal: No live threads left. Deadlock?"
lkba has quit [Ping timeout: 265 seconds]
<jhass>
because you called .wait in all your active threads
<jhass>
so none is left to .signal
Mweshi_ has joined #ruby
havenwood has joined #ruby
<jhass>
(active threads means that it might also that you let others die)
<apeiros>
?code toretore
<ruboto>
toretore, We can't help you without your code, please post it to https://gist.github.com
olistik has joined #ruby
<apeiros>
:-p
<toretore>
just a minute, got some real pipes to look after
<jhass>
toretore: e.g. remove the final sleep 1 in my example and you'll have a race between the .wait returning and the main thread dying and taking everything down with it
bricker has joined #ruby
mary5030 has quit [Remote host closed the connection]
<apeiros>
pipedreams…
allcentury has quit [Ping timeout: 246 seconds]
* apeiros
has to look after his pillow. lemme check real quick. don't expect me to come back, though :-D
i8igmac has quit [Ping timeout: 244 seconds]
dagda1 has joined #ruby
<jhass>
Thread.abort_on_exception = true might help to find accidentially dying threads
chipotle has joined #ruby
Papierkorb has joined #ruby
Jackneill has quit [Remote host closed the connection]
RobertBirnie has quit [Read error: Connection reset by peer]
djbkd has quit [Remote host closed the connection]
<toretore>
isn't kill and raise for threads discouraged?
hotpancakes has joined #ruby
<jhass>
apeiros: it's the right primitive to build the right tool
<jhass>
Mutex, Thread and ConditionVariable are the essential primitives you can't reimplement because you need support from the scheduler
<apeiros>
toretore: totally. but handle_interrupt might change the game. but I haven't read the docs yet.
arooni-mobile has quit [Ping timeout: 248 seconds]
<apeiros>
jhass: I do think something is off if you have to check with an additional aid whether the signal has been sent before waiting for it.
jottr has joined #ruby
<jhass>
nope, it's a really really common thing to do
Blaguvest has joined #ruby
<apeiros>
but my thread experience is too limited to know this like "oh, generic case X, you're doing Y wrong, use Z instead".
<apeiros>
jhass: a lot of bad code is common.
<toretore>
java wait/notify behaves the same way afaik
<jhass>
don't be confused by the name similarity, the conditionvariable signal and the @signalled are two different things
<apeiros>
I'm not.
hotpancakes has quit [Ping timeout: 246 seconds]
<jhass>
think of the classic Queue, you'll put the wait in pop in a loop to check for empty, same thing
einarj has joined #ruby
balazs has joined #ruby
<jhass>
it guards against contention and random interrupts
gnudon has joined #ruby
pabs has quit [Ping timeout: 264 seconds]
fabrice31 has joined #ruby
bronson has joined #ruby
pabs has joined #ruby
olistik has joined #ruby
lkba has joined #ruby
Azulinho has joined #ruby
<toretore>
i guess what's missing are more higher-level concurrency primitives
AndChat-43764 has joined #ruby
<jhass>
concurrent-ruby has some I've heard
beef-wellington has joined #ruby
<toretore>
yeah
<toretore>
and "concurrent" too
<jhass>
you waiter is actually a high level primitive, but I can't remember the proper name :/
<jhass>
Barrier?
<toretore>
yeah
<apeiros>
not really
<apeiros>
it'd be a "singlebarrier" :D
decoponio has quit [Read error: Connection reset by peer]
<apeiros>
barriers wait for N entities to complete
<jhass>
N = 2
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
where N is variable.
<apeiros>
not fixed.
<jhass>
the main thread and the one
lkba_ has quit [Ping timeout: 255 seconds]
decoponio has joined #ruby
Thomas-0725 has joined #ruby
<toretore>
just replace with wait_until{ @counter == @n }
<jhass>
running the schedule thing
jhack has quit [Ping timeout: 250 seconds]
<jhass>
I guess you could use an Exchanger too and trade nil :P
fabrice31 has quit [Ping timeout: 252 seconds]
lkba_ has joined #ruby
simplyianm has joined #ruby
scripore has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
lkba has quit [Ping timeout: 248 seconds]
AndChat-43764 has quit [Ping timeout: 246 seconds]
lkba has joined #ruby
mweshi has joined #ruby
micalexander has joined #ruby
mandarinkin has quit [Ping timeout: 256 seconds]
lkba has quit [Read error: Connection reset by peer]
[k-_ has quit [Ping timeout: 264 seconds]
lkba has joined #ruby
Thomas-0725 has quit [Ping timeout: 248 seconds]
schov has joined #ruby
<schov>
I have a basic query. If user enters a number using gets.chomp how can i check if it's an integer?
<micalexander>
I want to include mina-deploy https://github.com/mina-deploy into my gem and work directly with it allowing me to have access to the variables set in the config/deploy.rb. What is the best way to do this? Am I stuck with only being about to call its commands using exec? Or can I interface with it directly?
hotpancakes has joined #ruby
lkba_ has quit [Ping timeout: 256 seconds]
<apeiros>
schov: Integer(input, 10) raises if input is not a valid base10 int
swgillespie has joined #ruby
<jhass>
schov: if input[/\A\d+\z/]
<apeiros>
schov: alternatively use highline. I think it's got stuff for that
allomov has joined #ruby
<apeiros>
jhass: missing neg. int already ;-p
Sembei has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
<jhass>
pff
<jhass>
fine add a -?
<apeiros>
is +10 valid?
<jhass>
no
toretore has quit [Ping timeout: 246 seconds]
<apeiros>
how do you know?!? that's a question for schov!
swgillespie has quit [Max SendQ exceeded]
<jhass>
magic
<havenwood>
=>> Integer("+10")
<havenwood>
#=> 10
weemsledeux has joined #ruby
<apeiros>
o0
swgillespie has joined #ruby
<apeiros>
ok, I'm honestly not sure anymore how I implemented Thread.stopped
swgillespie has quit [Client Quit]
<apeiros>
when I think about it now, it seems to me it'd have to signal *after* calling sleep. but that's impossibru :<
<apeiros>
and spinning is fugly
<havenwood>
oops, there's a new test for elixir.rb - i did it wrong >.>
weemsledeux has quit [Max SendQ exceeded]
<havenwood>
well, accidentally correct \o/
sigurding has quit [Quit: sigurding]
<havenwood>
testing anyways so i don't break my accidental correctness in refactor :)
<apeiros>
ooooh, silly me!
toretore has joined #ruby
<apeiros>
hm
<apeiros>
no. while I had an idea which makes implementing Thread.stopped stupidly simple, it's probably also a way any truly parallel ruby would dislike…
aj_ has quit [Ping timeout: 246 seconds]
zacstewart has joined #ruby
<apeiros>
"rb_thread_sleep_deadly" uh?
<apeiros>
what are you doing, ruby?!
Thomas-0725 has joined #ruby
beef-wellington has quit [Ping timeout: 256 seconds]
allcentury has joined #ruby
vdamewood has quit [Quit: Life beckons.]
<apeiros>
hm, that stupidly easy way doesn't even work :-/
bricker_ has joined #ruby
hotpancakes has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
<apeiros>
and then somebody calls LazyThread.start and you're f'ed :-p
bricker has quit [Ping timeout: 240 seconds]
<apeiros>
but ok, that's a line I didn't consider.
<apeiros>
use SimpleDelegator
<jhass>
yeah
lkba has quit [Remote host closed the connection]
<apeiros>
as Thread.stopped, the only way I can currently think of is by spinning
<apeiros>
def Thread.stopped(*args); th = Thread.new do; sleep; yield(*args); end; Thread.pass until th.sleep?; th; end
<toretore>
class LazyThread < Thread; def initialize(&b); m, cv = Mutex.new, ConditionVariable.new; super{ m.sync{ cv.wait(m); } }; end; def start; cv.signal; end; end ?
chipotle_ has quit [Quit: cheerio]
<toretore>
and a b.call after the wait there
<apeiros>
I wouldn't want a special .start
<apeiros>
I'd want .wakeup to work
<micalexander>
I want to include mina-deploy https://github.com/mina-deploy into my gem and work directly with it allowing me to have access to the variables set in the config/deploy.rb. What is the best way to do this? Am I stuck with only being about to call its commands using exec? Or can I interface with it directly?
<apeiros>
but yeah, can check whether it's not yet started in wakeup and branch to start/wakeup
<toretore>
that should work
<apeiros>
I wonder how many things one can do wrong adding the whole thread api, tho
MarkTurner has quit [Quit: This is probably a wireless dropout]
crdpink2 has joined #ruby
Zai00 has joined #ruby
crdpink has quit [Ping timeout: 248 seconds]
<toretore>
so immediately after a `Thread.new{};here`, can i safely assume that this thread is running?
existensil has quit [Quit: WeeChat 0.4.2]
xkef has joined #ruby
prestorium has joined #ruby
spider-mario has quit [Remote host closed the connection]
juanpablo_ has joined #ruby
<jhass>
no
<Antiarc>
toretore: you can assume that it will run at some time now or in the future
poguez_ has quit [Quit: Connection closed for inactivity]
<Antiarc>
Though it may also be that that thread has run and terminated by the time that next instruction is reached
<toretore>
by that i mean assume that the scheduler knows about the thread and that i can use a Mutex without risking a deadlock
ryanprior has joined #ruby
<jhass>
oh, yeah
girakrok has joined #ruby
<jhass>
mh, well except for the case Antiarc just mentioned
<jhass>
but if you can assure that your thread won't exit till whatever you do in the mutex is done, it's okay
vickleton has quit [Ping timeout: 246 seconds]
<ryanprior>
I want to split a string like "cow cat=yellow dog=black" into an array ["cow", "cat=", "yellow", "dog=", "black"]
bricker_ has quit [Ping timeout: 256 seconds]
leonardoajim has quit [Quit: Be back later ...]
<Antiarc>
How would you achieve a deadlock with a single mutex, anyhow?
hotpancakes has joined #ruby
<toretore>
ok, that's what i meant
<Antiarc>
I'm trying to figure that one out and can't come up with a case for it, though it may be that I am just not thinking about it sufficently thoroughly
juanpablo_ has quit [Ping timeout: 255 seconds]
<toretore>
Antiarc: well, not an actual deadlock, but ruby telling me about a "possible deadlock"
<Antiarc>
Taking a reentrant mutex will throw an exception anyhow
<Antiarc>
Ah
<toretore>
as it does in that case
blackmesa has joined #ruby
bungoman has joined #ruby
bluOxigen has joined #ruby
existensil has joined #ruby
bluOxigen has quit [Changing host]
bluOxigen has joined #ruby
bricker has joined #ruby
<jhass>
ryanprior: .split(/(?: |(?<==))/)
bluOxigen has left #ruby [#ruby]
zacstewart has quit [Ping timeout: 244 seconds]
<toretore>
i'd do split(' ').map{|s| s.split('=') }
mjuszczak has quit []
<jhass>
read again
<ljarvis>
that doesn't do the same thing
Ilyas has quit [Read error: Connection reset by peer]
<ryanprior>
apeiros: I'm doing bash completions and want to be able to check for '=' as I go.
allcentury has joined #ruby
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ryanprior>
apeiros: if I get more sophisticated in the future, I'll use an actual parser for command line strings and build a data structure. But for the time being I'm just tokenizing it, checking the end of strings for '=', etc.
Azulinho has quit [Ping timeout: 240 seconds]
phutchins2 has joined #ruby
Thomas-0725 has joined #ruby
<ryanprior>
incidentally: nobody knows of a ruby parser for system shell strings that builds a data structure, do they?
fgo has joined #ruby
<apeiros>
see whether Shellwords covers what you need
bubbys has quit [Ping timeout: 264 seconds]
cashnguns has quit [Remote host closed the connection]
workmad3 has joined #ruby
existensil has quit [Quit: WeeChat 0.4.2]
<apeiros>
if you're processing shell argv data, split is the wrong choice anyway. you'll handle none of the edge cases (quoted values etc.)
<apeiros>
you should use Shellwords.split for that and postprocess for =
<ryanprior>
apeiros: Shellwords doesn't do anything with constructs of the type --foo=bar afaik
<apeiros>
no, it doesn't. as that's a single argument.
<apeiros>
it's optionparsers which do something with that.
<apeiros>
not the shell.
blenny has left #ruby [#ruby]
<apeiros>
and it's depending on the individual optionparser what it actually does with it.
<Thomas-0725>
text="someTextWithoutSpaces"; words=["some", "words"]; ... Is there an obvious, easy solution to find the index of the first character of a word in text that is not in words? e.g. first_difference("thisIsText", ["this", "text"]) == 5
<apeiros>
e.g. whether -xyz is a single flag "xyz" or a contraction of "-x -y -z"
<apeiros>
so all *those* special cases are still undealt with.
<apeiros>
Thomas-0725: do you mean == 4?
<apeiros>
remember, strings are 0 indexed
<Thomas-0725>
apeiros, I do. My mistake
<ryanprior>
apeiros: I do want something like an option parser.
<apeiros>
ryanprior: I don't know your use case, but remember that each optionparser deals with options differently. see my example.
Fezzler has joined #ruby
<ryanprior>
apeiros: my use case is writing bash completions, so option parsers that just take an option string and return a data structure representing its contents aren't actually that useful
<ljarvis>
and good option parsers will allow you to configure the ambiguity away
fgo has quit [Ping timeout: 256 seconds]
<apeiros>
ryanprior: you keep repeating that. it doesn't really provide meaningful context, though.
<ryanprior>
hmm, I'm not sure what more to say
<Thomas-0725>
apeiros, for more context, see here ( http://pastebin.com/kd7hf2Nh ) ... specifically, the PigLatinConsonants.first_non_consonant_position(word) method.
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<Thomas-0725>
noted.
Fezzler has quit [Client Quit]
existensil has joined #ruby
allcentury has quit [Ping timeout: 264 seconds]
NeverDie has joined #ruby
<apeiros>
Thomas-0725: I don't have any obvious way, and too late for me to come up with something sensible.
<Thomas-0725>
alrighty. Anyone else?
<apeiros>
also the rules matter a bit. e.g. foo("thisthis", ["this"]) == 4 or nil?
hotpancakes has quit [Remote host closed the connection]
<micalexander>
I want to include mina-deploy https://github.com/mina-deploy into my gem and work directly with it allowing me to have access to the variables set in the config/deploy.rb. What is the best way to do this? Am I stuck with only being about to call its commands using exec? Or can I interface with it directly?
<Thomas-0725>
apeiros it would equal nil
<apeiros>
and what about "thisthis", ["is", "thi"] ?
<apeiros>
(or just "this", ["is", "thi"])
arooni-mobile has joined #ruby
<Thomas-0725>
in that case, we would seek for the longer words first, which would mean that "s" would be excluded, and the return value would be 3.
rehat has joined #ruby
Juanchito has quit [Quit: Connection closed for inactivity]
<apeiros>
so text already hit is no longer eligible
gnudon has quit [Read error: Connection reset by peer]
<Thomas-0725>
correct
<apeiros>
kinda important for a correct algorithm :-p
<apeiros>
any characters which can't be in the string? e.g. "\0"?
<apeiros>
can't -> are not allowed (in the original string)
<rehat>
I need help with reading ruby docs. I am reading a tutorial on Mechanize and it has this line 'agent.page.parser.css('form')' I see the parser method in the doc but not css. Am I reading this wrong?
existensil has quit [Quit: WeeChat 0.4.2]
<Thomas-0725>
apeiros, we can assume that the original string is just lowercase, alphabetical characters.
eggoez has quit [Ping timeout: 246 seconds]
<apeiros>
Thomas-0725: k. gsub your way through it, replacing stuff with \0 of same length. then just =~ /[^\0]/ :)
revath has quit [Ping timeout: 256 seconds]
chipotle has joined #ruby
rbowlby has quit []
existensil has joined #ruby
xkef_ has quit [Ping timeout: 256 seconds]
zacstewart has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Thomas-0725>
=~ returns the position of the first exclusion? I thought it returned false. Also, did you view the pastebin/gist.github post? I believe you have described what I already did.
<Thomas-0725>
true/false
<apeiros>
>> t="thisIsText"; ws=["this", "text"]; ws.each do |w| t.gsub!(w, "\0"*w.size) end; t =~ /[^\0]/
simplyianm has quit [Remote host closed the connection]
<apeiros>
=~ returns the position of the match
<apeiros>
nil if nothing matched
<apeiros>
docs help with such things ;-p
<Thomas-0725>
oh ok. That is convenient. I was using .index
<Thomas-0725>
In any case, our solutions are essentially the same. So now I at least have backup that my solution doesn't have any glaring issues.
<apeiros>
Thomas-0725: oh, also "Text" != "text"
<Thomas-0725>
right right. I downcase the input string
ferr has quit [Quit: WeeChat 1.2]
<Thomas-0725>
I was using caps only to highlight word spacing for you, my human reader.
simplyianm has joined #ruby
xkef has joined #ruby
ruurd has quit [Quit: Zzzzz z zz ...]
bubbys has joined #ruby
bubbys has quit [Client Quit]
<apeiros>
k, kinda important too :-p
<apeiros>
("kinda important" = include it in your descriptions)
Soda has quit [Remote host closed the connection]
eggoez has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
<Thomas-0725>
ok. Well, issue solved. I posted the paste to clarify any ambiguity in my original question. I will note however to be more specific with future questions.
<Thomas-0725>
Thanks bud
SylarRuby has quit [Remote host closed the connection]
xxneolithicxx has joined #ruby
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
bungoman has quit [Remote host closed the connection]
Zai00 has quit [Quit: Zai00]
<apeiros>
yw
simplyianm has quit [Remote host closed the connection]
hololeap has joined #ruby
sross07 has quit [Read error: Connection reset by peer]
charlenopires has joined #ruby
sross07 has joined #ruby
casadei_ has joined #ruby
fenjamin has joined #ruby
hotpancakes has joined #ruby
but3k4 has joined #ruby
balazs has quit [Remote host closed the connection]
<fenjamin>
im looking at destructive methods and {|tree| tree + " Tree"}
zacstewart has quit [Ping timeout: 265 seconds]
<fenjamin>
more specifically trees.collect! {|tree| tree + " Tree"}
<cout>
fenjamin: if you start with Zero then the result should should be a multiple of Tree :)
<fenjamin>
i've assigned trees to an array and would like to understand more about {|tree| tree + " Tree"}
<fenjamin>
|tree| what does that mean?
<adaedra>
argument of a block
<Antiarc>
That's just a block which accepts a argument named "tree", and calls tree.+("Tree") and returns the result
<fenjamin>
and so || is to declare an item without using a parameter?
RobertBirnie has quit [Client Quit]
weemsledeux has joined #ruby
<Thomas-0725>
fenjamin, when you call a method and give it a {block}, it basically uses the {block} as a separate method with parameters in |here| instead of (here). So trees.each { |variable| some code} basically means that it will take every item in the array trees and pass it, one-by-one, into the block of code you give it with the individiaul elements passed in as the |tree| parameter.
kirun has quit [Quit: Client exiting]
<fenjamin>
awesome
weemsledeux has quit [Max SendQ exceeded]
<fenjamin>
I understand clearly!
<Thomas-0725>
Like Antiarc said, it will help you to read up on code blocks, Enumerable class, and Enumerable methods. fenjamin
<apeiros>
fenjamin: same as with a method or any other variable
<apeiros>
def foo(bar) # ruby does not care that you named the argument "bar". it's not relevant to ruby.
<Antiarc>
Understanding blocks is pretty fundamental to grokking Ruby
<Antiarc>
It's worth spending some time on
<apeiros>
same with trees = ["some", "trees"]. ruby has no concept of language. it doesn't understand that your variable refers to a concept in the real world. you could just as well assign those values to x0123z
<fenjamin>
you would only declare a parameter if you have no use immediately using it
dopie has joined #ruby
Cache_Money has joined #ruby
phutchins2 has joined #ruby
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<fenjamin>
blocks really really want to use a method that you didn't do anything to previously
<fenjamin>
*use blocks when you really really want to use a method that yo udidn't do anything to previously
<apeiros>
o0
vt102 has quit [Ping timeout: 256 seconds]
chipotle has quit [Quit: cheerio]
<apeiros>
I don't think I understood what you were saying in any of the last 3 messages of yours…
<fenjamin>
when you declare a method without a parameter you can use a block on that method when you suddenly need to do something to that method
<adaedra>
õ_o
<fenjamin>
parameters merely save an ability to perform something
<apeiros>
fenjamin: anyway, let me phrase it differently: *all* names in a computer program are *for you*, the programmer. the computer doesn't care at all. all it needs is that different variables have different names.
<fenjamin>
aperios: i know and love this part of ruby. my programming school curriculm feels otherwise.
<apeiros>
fenjamin: use tab completion. my nick ain't aperios.
<fenjamin>
which makes it tremendously confusing and hard to understand because i feel like i'm performing a routine of "who's on first"
nertzy has quit [Read error: Connection reset by peer]
<apeiros>
parameters don't save an ability to perform something.
<apeiros>
parameters pass values.
<apeiros>
from one part of your program to another.
nertzy has joined #ruby
<fenjamin>
but in and of themselves are useless until you perform an action on them
einarj has quit [Remote host closed the connection]
<apeiros>
whether you do something with that parameter immediately or later is up to the method. it's not part of it being a parameter.
Pupeno_ has joined #ruby
whiteline has quit [Ping timeout: 252 seconds]
<fenjamin>
apeiros, cool
<apeiros>
um. you could say that about all data.
<fenjamin>
this helps me to learn
<fenjamin>
brb
<apeiros>
regardless of whether the data is passed as params or not… data you don't do something with is useless (even if "do something" just means "store it to disk")
Pupeno has quit [Ping timeout: 244 seconds]
lxsameer has quit [Remote host closed the connection]
Thomas-0725 has joined #ruby
FernandoBasso has quit [Ping timeout: 256 seconds]