jhass changed the topic of #ruby to: Welcome new users migrating from #ruby-lang! || Rules & more: http://ruby-community.com || Ruby 2.2.2; 2.1.6; 2.0.0-p645: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org/ruby/
<Senjai> I'm fine with that, I just feel like its probably worth raising an issue on Teaspoon about it
freerobby has joined #ruby
Niandalu has joined #ruby
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Niandalu> PART
<Senjai> Niandalu: NO
Aswebb_ has quit [Ping timeout: 246 seconds]
pengin has joined #ruby
crdpink2 has joined #ruby
crdpink has quit [Ping timeout: 248 seconds]
sharpmachine has quit [Remote host closed the connection]
ruby-lang111 has joined #ruby
Muhannad has quit [Ping timeout: 276 seconds]
Akagi201 has quit [Remote host closed the connection]
Akagi201 has joined #ruby
m3_del has quit [Remote host closed the connection]
AndyBotwin has quit [Quit: Leaving]
axsuul has joined #ruby
millerti has joined #ruby
Niandalu` has joined #ruby
ruby-lang111 has quit [Ping timeout: 246 seconds]
mrmargolis has joined #ruby
mister_solo has quit [Ping timeout: 264 seconds]
nateberkopec has joined #ruby
Akagi201 has quit [Ping timeout: 246 seconds]
Niandalu has quit [Ping timeout: 250 seconds]
graft_ has quit [Quit: Lost terminal]
<Ox0dea> Senjai: The C source indicates that only brackets are treated like they are in regular expressions, so you can't group or negate a whole string.
DLSteve has quit [Quit: Leaving]
<Ox0dea> You could put together a character class that will match everything but "legacy", but that's gross.
_whitelogger has joined #ruby
[H]unt3r has quit [Quit: Leaving]
s2013 has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
s2013 has quit [Client Quit]
wallerdev_ has quit [Ping timeout: 246 seconds]
findaway has joined #ruby
axilla_ has joined #ruby
mrmargolis has joined #ruby
oo_ has joined #ruby
axilla has quit [Ping timeout: 255 seconds]
d0lph1n98 has quit [Ping timeout: 264 seconds]
findaway has quit [Ping timeout: 264 seconds]
i8igmac has joined #ruby
Soda has quit [Remote host closed the connection]
RoryHughes has quit [Ping timeout: 256 seconds]
iooner has quit [Ping timeout: 256 seconds]
teotwaki has quit [Ping timeout: 256 seconds]
Dwarf has quit [Ping timeout: 256 seconds]
<Tarkers34> regex to match all numbers, regardless of how many decimal points are in them? I literally mean that, even if a "number" has 4 decimal points. So it would match: 3, 4.4, 5.554, 543.43.54.34.43. However, with this string "..2.3.4.5.....6.7.8.9" it would have 2 match groupsL 2.3.4.5 and 6.7.8.9
lolmaus has quit [Ping timeout: 256 seconds]
<Tarkers34> my attempt was /[+-]?(?=\d*)(?=\.?\d)\d*\.?\d*(?:[+-]?\d+)?/, gone very arwy :(
arooni-mobile has quit [Ping timeout: 248 seconds]
jaxxstorm has quit [Ping timeout: 256 seconds]
aamador has quit [Quit: Leaving]
<stoodfarback> Ox0dea: Could you? I tried for a few minutes, couldn't think of a way.
weaksauce has quit [Ping timeout: 248 seconds]
<jfarmer> Tarkers34 Decimal points can't follow each other?
<jfarmer> I assume like "2..4" is bad
jaxxstorm has joined #ruby
bradleyp_ has quit [Ping timeout: 248 seconds]
<Tarkers34> jfarmer, yeah that's it. Decimal points can't follow each other :)
RoryHughes has joined #ruby
iooner has joined #ruby
teotwaki has joined #ruby
podman has quit [Quit: Connection closed for inactivity]
Pupeno has joined #ruby
<zenspider> ?regexp
<ruboto> I don't know anything about regexp
<jfarmer> Oh..
<Tarkers34> A test string could be ".45.5xei68.6g5554.4343.23232...43323...4"
<jfarmer> Uhm...
<Tarkers34> no worries, it's tricky stuff regex haha
<zenspider> you might want to try on http://rubular.com
serivich has quit [Ping timeout: 248 seconds]
<zenspider> put all the data it could match in the text box, and your regexp in the regxp box, tweak until it looks right
bruno- has quit [Ping timeout: 248 seconds]
Dwarf has joined #ruby
<Tarkers34> zenspider : Yeah thought I had it http://rubular.com/r/GEWyQU04Nc :( the match groups are all wrong though...those aren't isolated groups (rubular isn't showing the matches for some reason, at least not for me)
<Tarkers34> it's matching 'number' fragments, and they're right next to each other...it isn't working :/
sarkyniin has quit [Ping timeout: 256 seconds]
dfockler has joined #ruby
<zenspider> wow. that quickref is useless
<zenspider> ?quickref
<zenspider> Tarkers34: (?=) zero-width positive look-ahead assertion
<zenspider> why are you using that?
Pupeno has quit [Ping timeout: 255 seconds]
<jfarmer> You souldn't need to.
<Tarkers34> yeah I'm not great at regex :P
<zenspider> no, just answer the question
maletor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider> self deprecation won't make you better. thinking about the problem will.
sharpmachine has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider> ruboto: regexp is Read http://www.zenspider.com/Languages/Ruby/QuickRef.html#regexen and use http://rubular.com to experiment
dfockler has quit [Ping timeout: 250 seconds]
willharrison has joined #ruby
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brain_shim has quit [Ping timeout: 246 seconds]
<Obfuscate> Tarkers34: Why not just \d+(\.\d+)*
<Obfuscate> If you really need something complex, then you might want to try negative look-ahead instead: e.g. \.(?!\.)
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
workmad3 has joined #ruby
<Tarkers34> Obfuscate: I tried someonething like that earlier...match groups just don't work though regex = /\d+(\.\d+)*/ https://gist.github.com/anonymous/a7a037e7de6beb976062
<Tarkers34> hey I'm going to bed now, thanks very much for your help guys I'll look at it tomorrow
Spami has quit [Quit: This computer has gone to sleep]
<Obfuscate> Tarkers34: Just wrap it in an extra set of parentheses.
<jfarmer> Tarkers34 You can reference match groups in the regex itself
<jfarmer> like (some_group).\1+
jpfuentes2 has joined #ruby
<Obfuscate> There's no need for backreferences there (and one should try hard to avoid them when possible).
jenrzzz has quit [Ping timeout: 252 seconds]
nateberkopec has joined #ruby
<Obfuscate> Tarkers34: /(\d+(?:\.\d+)*)/
fgo has joined #ruby
* Obfuscate evaporates.
toretore has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hodI is now known as oaavl
oaavl is now known as bosma
ixti has quit [Ping timeout: 265 seconds]
lolmaus has joined #ruby
fgo has quit [Ping timeout: 265 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
msnyon has quit [Quit: Textual IRC Client: www.textualapp.com]
arescorpio has joined #ruby
workmad3 has joined #ruby
joshbamboo1 has quit [Quit: Leaving]
<zenspider> Obfuscate: generally... we want people to try to solve their own problems, rather than just handing them it. helps them learn
Agoldfish has quit [Quit: G'Bye]
nodeworm has quit [Quit: Switching to subconscious.]
nodeworm has joined #ruby
sarkyniin has joined #ruby
araujo has quit [Ping timeout: 256 seconds]
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby
Helheim has quit [Ping timeout: 256 seconds]
Lucky___ has joined #ruby
bonhoeffer has joined #ruby
<Obfuscate> zenspider: Fair enough. I could have handled it better.
Helheim has joined #ruby
Indian has quit [Ping timeout: 244 seconds]
gf3 has quit [Ping timeout: 256 seconds]
araujo has joined #ruby
gf3 has joined #ruby
<zenspider> thanks!
mrmargolis has quit [Remote host closed the connection]
akkad has quit [Ping timeout: 256 seconds]
yqt has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 256 seconds]
d0lph1n98 has joined #ruby
jpfuentes2 has joined #ruby
d0lph1n98 has quit [Client Quit]
workmad3 has joined #ruby
d0lph1n98 has joined #ruby
Indian has joined #ruby
Rickmasta has joined #ruby
akkad has joined #ruby
havenwood has joined #ruby
tkuchiki has joined #ruby
martinma4 has joined #ruby
bffff_ has quit [Quit: Connection closed for inactivity]
sharpmachine has quit [Remote host closed the connection]
martinma4 has quit [Remote host closed the connection]
tkuchiki_ has joined #ruby
pgatt has quit [Quit: Connection closed for inactivity]
brain_shim has joined #ruby
findaway has joined #ruby
<Ox0dea> Obfuscate: No need for the outer parentheses, right?
<Obfuscate> Ox0dea: Correct, for ruby at least, since they seem to be implicit.
solocsha1 has quit [Ping timeout: 255 seconds]
tkuchiki has quit [Quit: Leaving...]
findaway has quit [Ping timeout: 244 seconds]
jeramyRR has joined #ruby
_blizzy_ has joined #ruby
fantazo has joined #ruby
bruno- has joined #ruby
_blizzy_ has quit [Ping timeout: 248 seconds]
jamo_ has quit [Ping timeout: 256 seconds]
Aswebb_ has joined #ruby
jamo_ has joined #ruby
Vile` has quit [Ping timeout: 256 seconds]
ooesili has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bigkevmcd has quit [Ping timeout: 252 seconds]
bigkevmcd has joined #ruby
Vile` has joined #ruby
Indian has quit [Ping timeout: 248 seconds]
agent_white has quit [Read error: Connection reset by peer]
Aswebb_ has quit [Ping timeout: 264 seconds]
n008f4g_ has quit [Ping timeout: 264 seconds]
agent_white has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
freerobby has quit [Quit: Leaving.]
charliesome has quit [Ping timeout: 276 seconds]
frem has quit [Quit: Connection closed for inactivity]
bradleyprice has joined #ruby
charliesome has joined #ruby
arooni-mobile has joined #ruby
sporkmonger has joined #ruby
axsuul has quit [Read error: No route to host]
sporkmonger has left #ruby [#ruby]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
ryba has quit [Ping timeout: 252 seconds]
brain_shim has quit [Ping timeout: 264 seconds]
Rickmasta has joined #ruby
baweaver has joined #ruby
jtdoncas has quit [Quit: WeeChat 1.1.1]
swgillespie has joined #ruby
ryez has joined #ruby
ecksit has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jamesaxl|2 has quit [Ping timeout: 246 seconds]
nateberkopec has quit [Quit: Leaving...]
bf4 has joined #ruby
jpfuentes2 has joined #ruby
agent_white has quit [Quit: leaving]
<Ox0dea> baweaver: With or without invocation?
<Ox0dea> Or do you reckon now's not the time?
CloCkWeRX has joined #ruby
<baweaver> Ping me later tonight when I get home
<Ox0dea> Copy that.
<baweaver> probably around 9 PST
<baweaver> Finishing up some code for review before I call in for a nice long weekend
symm- has quit [Ping timeout: 246 seconds]
mleung has joined #ruby
<baweaver> cheers
baweaver has quit [Remote host closed the connection]
Vile` has quit [Ping timeout: 255 seconds]
bonhoeffer has quit [Read error: Connection reset by peer]
bonhoeffer has joined #ruby
Indian has joined #ruby
Vile` has joined #ruby
navs__ is now known as navs_
mleung has quit [Quit: mleung]
idafyaid has joined #ruby
mrmargolis has joined #ruby
jeramyRR has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gambl0re has joined #ruby
jack_rabbit has joined #ruby
hololeap has quit [Read error: Connection reset by peer]
hololeap has joined #ruby
shinnya has quit [Ping timeout: 276 seconds]
rawtext has joined #ruby
towski_ has quit [Remote host closed the connection]
jack_rabbit has quit [Ping timeout: 252 seconds]
symm- has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
it_tard has quit [Quit: yawn]
haudoing has joined #ruby
jeramyRR has joined #ruby
<haudoing> hello
<haudoing> anyone know how to use chef?
<haudoing> I have a newbie question..
balazs has joined #ruby
hololeap has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
sharpmachine has joined #ruby
_blizzy_ has joined #ruby
Akagi201 has joined #ruby
bigkevmcd has quit [Read error: Connection reset by peer]
<centrx> haudoing, See also #chef
<centrx> haudoing, Also, daytime America/Europe is more active in general
<haudoing> list
bigkevmcd has joined #ruby
<haudoing> centrx: hey thanks for reply!
<centrx> You are welcome
<haudoing> centrx: seems like there is very less chef on freenode..
<haudoing> centrx: so that's one of the reason I came :)
sharpmachine has quit [Ping timeout: 264 seconds]
cytoskeletor has joined #ruby
<centrx> It's a quiet time on Freenode, 10:30PM here
_blizzy_ has quit [Read error: Connection reset by peer]
brain_shim has joined #ruby
devbug has joined #ruby
symm- has quit [Ping timeout: 256 seconds]
centrx has quit [Quit: Shutting down, Please wait...]
<haudoing> centrx: it's 10:42 AM here Taiwan
jeramyRR has quit [Quit: Peace out!]
_blizzy_ has joined #ruby
<sevenseacat> timezones. how do they work?
<haudoing> time
radialneon has quit [Remote host closed the connection]
<haudoing> ?
radialneon has joined #ruby
Akagi201_ has joined #ruby
<sevenseacat> as centrx said, it's a quiet time right now.
amclain has joined #ruby
Pupeno has joined #ruby
Akagi201 has quit [Ping timeout: 246 seconds]
Niandalu` has quit [Remote host closed the connection]
balazs has quit [Remote host closed the connection]
m3_del has joined #ruby
CloCkWeRX has quit [Ping timeout: 244 seconds]
brain_shim has quit [Ping timeout: 255 seconds]
darkf has joined #ruby
Pupeno has quit [Ping timeout: 255 seconds]
brain_shim has joined #ruby
<haudoing> oh.. I thought your "they" imply to "timezones"
<haudoing> anyway gnsd
<haudoing> thanks
danielpclark has quit [Ping timeout: 246 seconds]
cirn0 has joined #ruby
mleung has joined #ruby
axsuul has joined #ruby
bigkevmcd has quit [Read error: Connection reset by peer]
mleung has quit [Client Quit]
bigkevmcd has joined #ruby
arup_r has joined #ruby
arup_r has quit [Remote host closed the connection]
stoodfarback has quit [Ping timeout: 264 seconds]
braincrash has quit [Quit: bye bye]
havenwood has quit [Ping timeout: 246 seconds]
danielpclark has joined #ruby
Ropeney has joined #ruby
bonhoeffer has quit [Quit: bonhoeffer]
behrz has joined #ruby
braincras has joined #ruby
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cytoskeletor has joined #ruby
CloCkWeRX has joined #ruby
<willharrison> not ruby related but does anyone in here have rsi?
behrz has quit [Client Quit]
devbug_ has joined #ruby
ecksit has joined #ruby
lessless has joined #ruby
devbug has quit [Ping timeout: 248 seconds]
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Deele has joined #ruby
devbug has joined #ruby
devbug_ has quit [Ping timeout: 246 seconds]
stoodfarback has joined #ruby
ItSANgo_ has joined #ruby
balazs has joined #ruby
balazs has quit [Remote host closed the connection]
bf4 has quit [Ping timeout: 264 seconds]
balazs has joined #ruby
gix has quit [Ping timeout: 255 seconds]
arooni-mobile has quit [Ping timeout: 248 seconds]
ItSANg___ has quit [Ping timeout: 248 seconds]
pgatt has joined #ruby
djbkd has quit [Quit: My people need me...]
mrmargolis has quit [Remote host closed the connection]
m3_del has quit [Remote host closed the connection]
balazs has quit [Remote host closed the connection]
Indian has quit [Ping timeout: 244 seconds]
gix has joined #ruby
iateadonut has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
solocshaw has joined #ruby
ecksit has quit [Quit: Textual IRC Client: www.textualapp.com]
mbff has joined #ruby
<mbff> Question: Do I use "bundle/setup" when creating gems? Or is bundle/setup just for creating ruby applications
charliesome has quit [Quit: zzz]
<nofxx> mbff, it's bundle install , or bundle update
m3_del has joined #ruby
<mbff> no like as an alternative to requiring all your gems
<mbff> you can just use bundle/setup I believe.
workmad3 has quit [Ping timeout: 252 seconds]
oo_ has quit [Remote host closed the connection]
<nofxx> mbff, hmm.. didn't knew. as in require 'bundle/setup' ? guess it's not for gems as gems don't use a lock
m3_del has quit [Read error: Connection reset by peer]
Aswebb_ has joined #ruby
devbug_ has joined #ruby
m3_del has joined #ruby
sharpmachine has joined #ruby
astrobun_ has joined #ruby
auzty has joined #ruby
mleung has joined #ruby
devbug has quit [Ping timeout: 256 seconds]
davedev24_ has quit []
skade has joined #ruby
sharpmachine has quit [Ping timeout: 256 seconds]
Aswebb_ has quit [Ping timeout: 264 seconds]
renderful has joined #ruby
skade has quit [Ping timeout: 248 seconds]
StephenOTT has joined #ruby
yeticry has quit [Ping timeout: 246 seconds]
renderful has quit [Ping timeout: 248 seconds]
houhoulis has joined #ruby
yeticry has joined #ruby
sharpmachine has joined #ruby
oo_ has joined #ruby
balazs has joined #ruby
StephenOTT has quit [Client Quit]
fgo has joined #ruby
radialneon has left #ruby ["Leaving"]
chouhoulis has quit []
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
havenwood has joined #ruby
radialneon has joined #ruby
nuck has joined #ruby
fgo has quit [Ping timeout: 256 seconds]
gix has quit [Ping timeout: 256 seconds]
balazs has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stoodfarback has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
balazs has joined #ruby
balazs has quit [Remote host closed the connection]
JoshL has quit []
brain_shim has quit [Ping timeout: 256 seconds]
mleung has quit [Quit: mleung]
gix has joined #ruby
nodeworm has quit [Quit: Switching to subconscious.]
nodeworm has joined #ruby
devbug has joined #ruby
oo_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
oo_ has joined #ruby
michael_mbp has quit [Excess Flood]
sharpmachine has quit [Ping timeout: 264 seconds]
devbug_ has quit [Ping timeout: 264 seconds]
tkuchiki_ has quit [Remote host closed the connection]
rawtext has quit [Quit: Textual IRC Client: www.textualapp.com]
baweaver has joined #ruby
michael_mbp has joined #ruby
sharpmachine has joined #ruby
Rickmasta has joined #ruby
meatchicken has quit [Ping timeout: 248 seconds]
dgutierrez1287 has joined #ruby
meatchicken has joined #ruby
oliver___ has joined #ruby
dgutierrez1287 has quit [Ping timeout: 246 seconds]
sharpmachine has quit [Ping timeout: 256 seconds]
ooesili has quit [Quit: leaving]
vdamewood has joined #ruby
pepperbreath has left #ruby [#ruby]
sharpmachine has joined #ruby
mbff has quit [Remote host closed the connection]
sharpmachine has quit [Remote host closed the connection]
CloCkWeRX has quit [Ping timeout: 256 seconds]
psyprus has quit [Ping timeout: 248 seconds]
blue_deref has quit [Quit: bbn]
devbug_ has joined #ruby
devbug has quit [Ping timeout: 252 seconds]
rushed has joined #ruby
Randroid has joined #ruby
michael_mbp has quit [Excess Flood]
psyprus has joined #ruby
michael_mbp has joined #ruby
arescorpio has quit [Quit: Leaving.]
willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
revath has joined #ruby
skade has joined #ruby
Akagi201_ has quit [Remote host closed the connection]
revath has left #ruby [#ruby]
chrisco has joined #ruby
blahwoop has joined #ruby
<blahwoop> hi all, im writing a caesar cipher rot-13. i can get it to work for all the letters but i don't know how to ignore the spaces and keep the spaces or any other non characters
<Aeyrix> What's your current code?
i8igmac has quit [Ping timeout: 264 seconds]
<baweaver> Ox0dea: little later than I wanted to get home
<baweaver> What fresh hell have you brought me tonight?
chrisco has quit []
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chrisco has joined #ruby
fgo has joined #ruby
<blahwoop> basically i just need it to ignore the spaces or non letters
<blahwoop> as is
jpfuentes2 has joined #ruby
Randroid has quit [Quit: Randroid]
s2013 has joined #ruby
chrisco has quit [Client Quit]
devbug has joined #ruby
jpfuentes2 has quit [Ping timeout: 244 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
haudoing has quit [Ping timeout: 264 seconds]
CloCkWeRX has joined #ruby
devbug_ has quit [Ping timeout: 246 seconds]
thiagovsk has quit [Quit: Connection closed for inactivity]
Al3ks has joined #ruby
Pupeno has joined #ruby
jenrzzz has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
_blizzy_ has quit [Ping timeout: 246 seconds]
revath has joined #ruby
iamninja has joined #ruby
Pupeno has quit [Ping timeout: 246 seconds]
Al3ks has quit [Quit: Leaving]
bigkevmcd has quit [Read error: Connection reset by peer]
<Aeyrix> blahwoop: eh
<Aeyrix> line 14
<Aeyrix> cipher(rotation)[letter] unless letter == ' '
tyl has joined #ruby
<tyl> Hi, Is having an activerecord object with less attributes more efficient? in irb when you type ObjectSpace.memsize_of("ActiveRecordObject") most of the activerecord instances are of the same size despite having less attributes
sarkyniin has quit [Quit: Quit]
yfeldblum has quit [Ping timeout: 248 seconds]
<pontiki> hello folks
<baweaver> tyl #RubyOnRails
<baweaver> short: it doesn't matter enough to care
keen__________10 has joined #ruby
<blahwoop> Aeyrix: i went with return letter if /[^a-zA-Z]/.match(letter) right above that cipher method
<baweaver> If it does you either need to rethink your database or use a different framework
<Aeyrix> blahwoop: Slightly more efficient to only do the substitution if it's a letter
<havenwood> pontiki: hey
<Aeyrix> as opposed to doing the sub and only returning it if it's a letter
<tyl> baweaver I have asked rubyonrails but they don't seem to know how rails is loading the activerecord object, so I was thinking since this has more to do with the mem a ruby object holds I should just ask it here. in other languages like C++ i have found if an object instance is big it takes more cycles when it goes through the cpu
keen___________9 has quit [Ping timeout: 276 seconds]
<baweaver> >> alpha = [*?a..?z,*?A..?Z]
<ruboto> baweaver # => ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", ...check link for more (https://eval.in/391392)
<blahwoop> Aeyrix: the problem is it wont decrypt properly
<Aeyrix> tyl: Is having an engine with less cylinders more efficient?
peter_paule has joined #ruby
<Aeyrix> blahwoop: Same on decrypt.
<baweaver> >> alpha = [*?a..?z,*?A..?Z]; alpha['a']
<ruboto> baweaver # => no implicit conversion of String into Integer (TypeError) ...check link for more (https://eval.in/391394)
<baweaver> >> alpha = [*?a..?z,*?A..?Z].join; alpha['a']
<ruboto> baweaver # => "a" (https://eval.in/391395)
<tyl> Aeyrix no assuming the cylinders are the same
<baweaver> >> alpha = [*?a..?z,*?A..?Z].join; alpha['1']
<ruboto> baweaver # => nil (https://eval.in/391397)
<Aeyrix> tyl: Unless... ?
darlinger has joined #ruby
m3_del has quit [Remote host closed the connection]
<baweaver> tyl: There are far more important things to worry about. Of course larger objects are slower
<tyl> aeyrix you mean efficiency in terms of going from point a to b faster?
<Aeyrix> tyl: Economy.
<blahwoop> Aeyrix: i tried it. it just gives me all in one word no spaces
<baweaver> >> [*?a..?z,*?A..?Z].join =~ /c/
<ruboto> baweaver # => 2 (https://eval.in/391403)
<tyl> Aeyrix i guess smaller cc cars are always said to be more econimical
<Aeyrix> tyl: Unless?
tkuchiki has joined #ruby
<darlinger> hey I need a little help with a ruby exercise I'm doing. I'm building a towers of hanoi game as an object with instance variables as arrays representing the disks and pegs for the game. I can't think of a good way to take user input to designate the pegs.
chouhoulis has quit [Remote host closed the connection]
<darlinger> I'll gist the code in a second
<baweaver> >> alpha = [*?a..?z,*?A..?Z].join; pos = alpha =~ /c/; alpha[(pos + 13) % 52]
<tyl> baweaver this kinda goes reverse from most of the computer languages i have learnt, usually we really care about the size of the object in the memory
<ruboto> baweaver # => "p" (https://eval.in/391404)
<baweaver> >> alpha = [*?a..?z,*?A..?Z].join; pos = alpha =~ /Z/; alpha[(pos + 13) % 52]
<ruboto> baweaver # => "m" (https://eval.in/391405)
<baweaver> rotating alphabet <3
<tyl> hmmm i'll have to just conduct some test to see i guess
<Aeyrix> tyl: You're caring about optimising the wrong thing entirely.
<Aeyrix> You're not answering my questions, which will help you answer yours.
<tyl> well i am not sure why it would not be less uneconomical
<baweaver> blahwoop: see my mad stream above
<Aeyrix> The "unless" is "unless you need the power". You can't run a minesite truck on a tiny four cylinder engine.
<tyl> i guess only if the person steps on the acceperator
<tyl> accelerator
<Aeyrix> [15:08:26] <Aeyrix>The "unless" is "unless you need the power". You can't run a minesite truck on a tiny four cylinder engine.
niemcu has joined #ruby
<darlinger> i just need to know how to take input from gets to specify instance variables in an object
<Aeyrix> If you need an AR object with 30 attributes
<Aeyrix> you need an AR object with 30 attributes
<pontiki> darlinger: without looking at the gist; what i would think of is the *only* input you have for TOH is from peg and to peg, all you should need is 1, 2 or 3, 1
<Aeyrix> you can't optimise that away
skade has quit [Quit: Computer has gone to sleep.]
<tyl> Aeyrix i don't actually need all the attributes like all of them time
<jfarmer> tyl Comparatively speaking, among all the the things put into memory when you instantiate a new AR object, the number of attributes is insignificant
<sevenseacat> tyl: sounds like in the past you've been dealing with a lot lower-level languages
<tyl> some of them could be put into a different table
<Aeyrix> ^
<sevenseacat> Ruby is a very high-level language
<Aeyrix> tyl: If it's related to one model
<Aeyrix> put them on that model
<Aeyrix> don't push them around places trying to save memory
<baweaver> which cares very little for memory economy
<sevenseacat> we care more about better ways to do things, than micro-optimizing every byte of memory
<jfarmer> tyl It's like you're looking at two bathtubs and wondering if the one that has a slightly dimpled floor is more water-efficient.
<baweaver> High level languages focus on solving problems themselves
<darlinger> pontiki: but how do i take that input and use it to designate the pegs within the object?
<sevenseacat> jfarmer: nice analogy.
phutchins1 has quit [Ping timeout: 255 seconds]
<tyl> ok
<darlinger> pontiki: i was thinking possibly an if statement that just returns the identifier for the array depending on the input
<havenwood> jfarmer: what pattern are the dimples? bumping up or down?
Wolland has joined #ruby
peter_paule has quit [Ping timeout: 246 seconds]
<sevenseacat> who cares if one bathtub is foot shorter than the other, or made out of steel instead of ceramic
Rickmasta has joined #ruby
<sevenseacat> or is missing a plughole
<Aeyrix> people who dislike steel?
<Aeyrix> :^)
<baweaver> the point is that while some would focus on getting memory efficiency up and keeping objects down, another could have a basic blogging site already done.
<pontiki> hum, darlinger, i thought the question was how to represent and request the input
cirn0 has quit [Remote host closed the connection]
<baweaver> some can do that in 15 minutes
<baweaver> god speed trying that in C++/C/Java
<pontiki> i apologize, i haven't got mental bandwidth to go deeper
tkuchiki has quit [Ping timeout: 252 seconds]
<tyl> baweaver well the main app is finished already I am just looking at weaknesses in the code
<jfarmer> tyl Put another way: by the point you've decided to use an ActiveRecord object (or even Ruby, really), you're well past the point of caring about low-level memory optimizations.
<baweaver> NewRelic
<jfarmer> That ship has sailed.
<tyl> i usually do optimisation during the refactor stage
<baweaver> Focus on N+1 queries
<baweaver> that's going to be your biggest win
<sevenseacat> you've got bigger weaknesses to worry about than memory allocation of AR objects.
radialneon has quit [Ping timeout: 276 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
mrmargolis has joined #ruby
<tyl> jfarmer yeah i see the philosophy here
<sevenseacat> get something like bullet to detect common problems
<jfarmer> tyl I wouldn't call it a "philosophy" — it's a statement of fact.
<tyl> its a different type of mindset you have to have
<darlinger> pontiki: yes. i get that the user would use 1, 2, or 3 to designate pegs. but how do I take that strings from input and use them to designate variables?
<jfarmer> If you care about memory efficiency at that level then you shouldn't use Ruby (or Python or other high-level, interpreted, dynamically-typed languages).
jenrzzz has joined #ruby
<jfarmer> It's just the wrong tool if that's honestly your priority.
speaking1ode has joined #ruby
tkuchiki has joined #ruby
<baweaver> If you _really_ need speed, better frameworks are Yesod, Scotty, Play, and Phoenix
<sevenseacat> omg phoenix
<baweaver> Warp in Haskell is extremely fast
abuzze has joined #ruby
<jfarmer> tyl I'll put it a third and final way: if you want to optimize the memory usage of your Ruby apps, the win you get by allocating one fewer object will dwarf virtually any optimization you could practically make to the memory usage of a particular class of objects.
cirn0 has joined #ruby
mrmargolis has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby
<jfarmer> tyl If you're comfortable with C, you should go look at the stock Ruby interpreter's source code (https://en.wikipedia.org/wiki/Ruby_MRI)
<tyl> I'll have a look at it when i have a chance
<pipework> I would suggest measuring to determine what needs looking at. Only then should you consider how you should rectify it.
SOLDIERz has joined #ruby
cirn0 has quit [Remote host closed the connection]
blahwoop has quit [Remote host closed the connection]
<pipework> benchmarking and profiling.
<tyl> pipework thats what i intend to do later
cirn0 has joined #ruby
<pipework> tyl: Ah then do it later and don't worry now.
sharpmachine has joined #ruby
<pontiki> steps to beautiful code: 1) make it work. 2) make it pretty. 3) make it fast.
<havenwood> tyl: In Rubyland Rails is quite a heavyweight in general. Compare for example with Roda and Sequel. Here're some non-db plain ole "Hello World" memory comparisons per request for various Ruby frameworks: https://github.com/luislavena/bench-micro#memory-allocationrequest
<baweaver> Amusingly Warp and Yesod give Phoenix a run for its money, if not leave it in the dust in some cases.
<baweaver> Though you have to learn Haskell
<baweaver> tradeoffs
<jfarmer> Yeah. Every single request to a Rails app is going to generate hundreds of String and/or Symbol objects.
<havenwood> ngx_mruby smokes all of the above
bruno- has joined #ruby
<pontiki> yesod is kind of freaky
<havenwood> apples and oranges
<tyl> havenwood thanks for the link
<darlinger> is there an easy way to write a conditional like "if variable is equal to this or that"?
cirn0 has quit [Remote host closed the connection]
<havenwood> tyl: Do take a look at Roda, it's lovely to use. I've heard good things about Lotus but not used it personally.
<baweaver> Really all things being equal all of those above are within the same order of magnitude
<tyl> jfarmer according to this old 2.x rails report its about 8,500 objects per request
<baweaver> anything past that is splitting hairs honestly.
Channel6 has quit [Quit: Leaving]
<sevenseacat> yes, thats an old rails 2.x report
<jfarmer> tyl Anything about Rails 2 is irrelevant at this point, really.
workmad3 has quit [Ping timeout: 256 seconds]
whiteline has quit [Ping timeout: 248 seconds]
<baweaver> tyl: We have two startup teams. One focuses on getting something out the door no matter how slow it is, the other focuses on making it fast. Who's going to win?
<tyl> yeah but it kinda gives you a ballpark figure
<pipework> tyl: Not really.
<pipework> Things have changed a lot since then.
<sevenseacat> no, it really doesn't.
<jfarmer> Rails 2 and Rails 3 are very different things internally
<pipework> Try to keep within 2 years.
<pipework> And ruby has changed since then.
<baweaver> The first team would destroy the second, hands down. Fast counts for junk if you're not the first out the door.
<sevenseacat> try to keep within at least the last major version
<tyl> baweaver the app is done already i am just looking at where code could be improved, yes I do realize the main goal of a startup is to get stuff out of the door asap
<pipework> baweaver: Win what?
<pipework> Getting to market first?
<sevenseacat> tyl: again, new relic, bullet. go. play.
Aswebb_ has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<baweaver> getting to market is most of the battle. If you can crank new features faster than the other team can think you're going dominate
sharpmachine has quit [Ping timeout: 255 seconds]
<baweaver> of course other factors abound, yes
casadei has quit [Remote host closed the connection]
stoodfarback has joined #ruby
<baweaver> then again you could also react substantially faster to said factors as well.
<tyl> rails 4 seems around 2740 compared to rails 2 1820 for the example quoted in this blog
<tyl> sevenseacat yeah i am looking through
brain_shim has joined #ruby
bruno- has quit [Ping timeout: 276 seconds]
Wolland has quit []
dhjondoh has joined #ruby
Aswebb_ has quit [Ping timeout: 252 seconds]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
oo_ has quit [Remote host closed the connection]
nodeworm has quit [Quit: Switching to subconscious.]
rushed has quit [Quit: rushed]
oo_ has joined #ruby
Akagi201 has joined #ruby
darlinger has quit [Quit: leaving]
tyl has left #ruby ["Textual IRC Client: www.textualapp.com"]
rushed has joined #ruby
duncannz has joined #ruby
auzty has quit [Quit: Leaving]
krz has joined #ruby
fgo has quit [Ping timeout: 246 seconds]
jlast has quit [Ping timeout: 248 seconds]
lolmaus has quit [Read error: Connection reset by peer]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lolmaus has joined #ruby
khebbie has joined #ruby
Akagi201 has quit [Ping timeout: 248 seconds]
bluOxigen has joined #ruby
fgo has joined #ruby
apofis has joined #ruby
djbkd has joined #ruby
gianlucadv has joined #ruby
revath has quit [Ping timeout: 250 seconds]
s2013 has joined #ruby
Akagi201 has joined #ruby
yfeldblum has joined #ruby
Royalb15 has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
apofis has quit [Ping timeout: 265 seconds]
NightMonkey has quit [Ping timeout: 252 seconds]
<shevy> ponies on rails!
<shevy> lol
NightMonkey has joined #ruby
<shevy> "Memory usage climbed to 131MB, confirming my hypothesis that a Rails version is worth approximately 7 floppy disks."
dagda1 has joined #ruby
ramfjord has joined #ruby
tvw has joined #ruby
Sypheren_ is now known as Sypheren
yfeldblum has quit [Remote host closed the connection]
Pupeno has joined #ruby
Trynemjoel has quit [Ping timeout: 256 seconds]
tekacs has quit [Ping timeout: 264 seconds]
shaman42_ has quit [Ping timeout: 252 seconds]
<Radar> Hey, /variant|stock|barcode|(?<!feature\s)option/i <- What does the ?<! mean here in this regex?
shaman42 has joined #ruby
swiftynb has joined #ruby
<swiftynb> is anyone alive?
tekacs has joined #ruby
<Radar> yes
<swiftynb> @radar what do you say to this
<swiftynb> ?
<Radar> to what?
<ruboto> swiftynb, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/ea1324a0ef6991f1ad10
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<Radar> Awww snap
<Radar> LOL
<Radar> Someone is heavily invested in PHP / Asp.net :)
oo_ has quit [Remote host closed the connection]
<swiftynb> lol, i have not done any php for like 6 years
arup_r has joined #ruby
<Radar> There's a good future in both Ruby + Python.
<swiftynb> but apperently ruby is "garbage" and i should pay him
<Radar> They're not dead.
<Radar> No, he's an idiot.
<Radar> That's just like my opinion
oo_ has joined #ruby
olistik has quit [Remote host closed the connection]
<swiftynb> lol, i just don't want to relearn php and would rather pay someone to use a language i have exp with >_>
Trynemjoel has joined #ruby
<swiftynb> cause php sucks ballz
<tbuehlmann> "is not so secure" brought a big smile to my face
<swiftynb> lawl
<pontiki> [citation needed]
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
<swiftynb> he wants like $500 to make a simple 5 page wordpess site...... no login functions or anything like that
ta has joined #ruby
<Radar> How many hours do you expect it to take?
<tbuehlmann> totally agreeing with radar. that person has a strong opinion here, not reflecting reality accurately
chinmay_dd has joined #ruby
howdoi has joined #ruby
<swiftynb> lol well all i wanted was a simple 5 page professional site, i could build the entire thing minus the graphics in about an hour.....
<Sypheren> O_O
<pontiki> then just use jekyll or middleman...
arup_r_ has joined #ruby
<swiftynb> the oonly thing i was looking for was someone good with graphics and clean layouts and able to write professionally
<pontiki> then you don't want a developer at all!!! LOL
m3_del has joined #ruby
<swiftynb> meh, didn't have time to do it myself, now i do/work with a visual artist that is also free that i will pawn most of it off to. Just though that was quite the opinion about ruby any python
<shevy> hmm
<shevy> hire pontiki
<shevy> let her use MS paint
<swiftynb> PAInt IS AMAZING!!!
<pontiki> i don't have MS Paint :(
<swiftynb> I tried adobe stuff and it is hardz
<pontiki> i have to use shit like Corel Painter n stuff
<swiftynb> NO! Microsoft paint is the only option!
chouhoulis has joined #ruby
arup_r has quit [Ping timeout: 276 seconds]
<shevy> :)
<pontiki> i no have anys MS :(
<swiftynb> NOOB u should be using vista with php like the rest of us
<pontiki> *sniff*sniff*
* pontiki weeps in her wheaties
<swiftynb> pontiki: Unignore <_>
m3_del has quit [Ping timeout: 264 seconds]
devbug has quit [Read error: Connection reset by peer]
lictor36 has joined #ruby
<pontiki> err, wut?
<pontiki> oh, i'm +g
speaking1ode has quit [Ping timeout: 244 seconds]
<swiftynb> idk what that is lol
<pontiki> ok, give it a go, swiftynb
<swiftynb> done
<pontiki> it sets your user so you get to control who can PM
kobain has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
chouhoulis has quit [Ping timeout: 264 seconds]
eGGsha has joined #ruby
tagrudev has joined #ruby
niemcu has quit [Ping timeout: 244 seconds]
MatthewsFace has joined #ruby
<sphex> bah. at this point, the only reason PHP still exists must be because outsourcing PHP web development to India is really cheap.
riotjones has joined #ruby
stan has joined #ruby
<shevy> well legacy code
<shevy> phpBB forum and mediawiki
<sevenseacat> *cough wordpress
<shevy> sphex on a game, they were using moin-wiki, which I think is in python; I hated to use it compared to mediawiki, it really was a usability disaster. only phpwiki is worse haha, but it is also simpler in usage
scripore has quit [Quit: This computer has gone to sleep]
serivich has joined #ruby
scripore has joined #ruby
Deele has quit [Quit: User excited]
<sphex> eh, yeah.. I guess. the good PHP web apps tend to be *really* good; insane amounts of (cheaper) developer dev time went in them...
<sphex> and when people need them modified they know it can be outsourced easily
sharpmachine has joined #ruby
<baweaver> Ox0dea: O_O
ta has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
roolo has joined #ruby
sharpmachine has quit [Ping timeout: 246 seconds]
tyl has joined #ruby
Royalb15 has quit [Quit: Leaving]
tyl has left #ruby [#ruby]
uptownhr has joined #ruby
yfeldblum has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
khebbie has joined #ruby
hedgecore has quit [Quit: leaving]
bigkevmcd has joined #ruby
bigkevmcd has quit [Excess Flood]
revath has joined #ruby
bigkevmcd has joined #ruby
jlast has joined #ruby
yfeldblum has joined #ruby
brain_shim has quit [Ping timeout: 252 seconds]
oo_ has quit [Remote host closed the connection]
micmus has joined #ruby
vdamewood has quit [Quit: Life beckons.]
ta has joined #ruby
skade has joined #ruby
oo_ has joined #ruby
codecop has joined #ruby
lolmaus has quit [Remote host closed the connection]
blaines_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Dopagod has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
anisha has joined #ruby
lordkryss has joined #ruby
Dopagod has quit [Client Quit]
scripore has quit [Quit: This computer has gone to sleep]
GnuYawk has quit [Quit: WeeChat 1.0]
rdark has joined #ruby
tesuji has joined #ruby
dhjondoh has joined #ruby
fabrice31 has joined #ruby
olistik has joined #ruby
fabrice31 has quit [Remote host closed the connection]
rushed has quit [Quit: rushed]
fabrice31 has joined #ruby
crdpink has joined #ruby
crdpink2 has quit [Ping timeout: 248 seconds]
poguez_ has quit [Quit: Connection closed for inactivity]
_ht has joined #ruby
toretore has quit [Quit: This computer has gone to sleep]
GnuYawk has joined #ruby
postmodern has quit [Quit: Leaving]
mrmargolis has joined #ruby
crdpink2 has joined #ruby
crdpink has quit [Ping timeout: 248 seconds]
fabrice31 has quit [Read error: Connection reset by peer]
lala has quit [Quit: Connection closed for inactivity]
fabrice31 has joined #ruby
oo__ has joined #ruby
GnuYawk has quit [Client Quit]
oo_ has quit [Read error: Connection reset by peer]
Sehryn_ has joined #ruby
fabrice31_ has joined #ruby
pabs has quit [Ping timeout: 255 seconds]
pabs has joined #ruby
mrmargolis has quit [Ping timeout: 252 seconds]
s2013 has quit [Quit: Textual IRC Client: www.textualapp.com]
fabrice31_ has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 264 seconds]
Sehryn_ has quit [Quit: Leaving]
m3_del has joined #ruby
fabrice31_ has joined #ruby
GnuYawk has joined #ruby
GnuYawk has joined #ruby
brain_shim has joined #ruby
blueOxigen has joined #ruby
corecode_ has joined #ruby
petems_ has joined #ruby
fabrice31 has quit [Ping timeout: 252 seconds]
Freijo has joined #ruby
dhjondoh1 has joined #ruby
sphex_ has joined #ruby
perrier_ has joined #ruby
rvchangue_ has joined #ruby
funnel_ has joined #ruby
howdoicomputer has quit [Read error: Connection reset by peer]
bluOxigen has quit [Ping timeout: 250 seconds]
Helheim has quit [Ping timeout: 250 seconds]
corecode has quit [Ping timeout: 250 seconds]
petems has quit [Ping timeout: 250 seconds]
n1ftyn8 has quit [Ping timeout: 250 seconds]
Heero has quit [Ping timeout: 250 seconds]
perrier has quit [Ping timeout: 250 seconds]
sphex has quit [Read error: Connection reset by peer]
dhjondoh has quit [Ping timeout: 250 seconds]
rdark has quit [Ping timeout: 250 seconds]
izzol has quit [Ping timeout: 250 seconds]
funnel has quit [Ping timeout: 250 seconds]
rvchangue has quit [Ping timeout: 250 seconds]
stylus has quit [Ping timeout: 250 seconds]
drizz has quit [Ping timeout: 250 seconds]
Fraeon has quit [Ping timeout: 250 seconds]
d0lph1n98 has quit [Ping timeout: 250 seconds]
certainty has quit [Ping timeout: 250 seconds]
skyjumper has joined #ruby
drzel has quit [Ping timeout: 250 seconds]
skyjumper has quit [Ping timeout: 250 seconds]
skyjumper has joined #ruby
skyjumper has quit [Changing host]
rvchangue_ is now known as rvchangue
Spleeze has quit [Ping timeout: 250 seconds]
marens_ has quit [Ping timeout: 250 seconds]
Prira has quit [Ping timeout: 250 seconds]
izzol has joined #ruby
petems_ has quit [Changing host]
petems_ has joined #ruby
drizz has joined #ruby
stylus has joined #ruby
funnel_ is now known as funnel
marens has joined #ruby
n1ftyn8_ has joined #ruby
Helheim_ has joined #ruby
d0lph1n99 has joined #ruby
Prira has joined #ruby
rdark has joined #ruby
petems_ is now known as petems
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
m3_del has quit [Ping timeout: 244 seconds]
tkuchiki has quit [Remote host closed the connection]
certainty has joined #ruby
drzel has joined #ruby
Heero has joined #ruby
Aswebb_ has joined #ruby
andikr has joined #ruby
Spleeze has joined #ruby
Akagi201 has quit [Ping timeout: 255 seconds]
niemcu has joined #ruby
terlar has joined #ruby
polysics has joined #ruby
oo__ has quit [Remote host closed the connection]
eGGsha has joined #ruby
Aswebb_ has quit [Ping timeout: 246 seconds]
ta has quit [Remote host closed the connection]
alex88 has joined #ruby
oo_ has joined #ruby
GitGud is now known as GitGod
arup_r_ has quit [Remote host closed the connection]
roolo has quit [Remote host closed the connection]
Helheim_ is now known as Helheim
jenrzzz has quit [Ping timeout: 255 seconds]
sharpmachine has joined #ruby
klingeldraht has joined #ruby
arup_r has joined #ruby
xcesariox has joined #ruby
d0lph1n99 has quit [Ping timeout: 248 seconds]
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
khebbie has joined #ruby
sharpmachine has quit [Ping timeout: 250 seconds]
d0lph1n98 has joined #ruby
brain_shim has quit [Ping timeout: 252 seconds]
iamninja has quit [Read error: Connection reset by peer]
iamninja has joined #ruby
tkuchiki has joined #ruby
krz has quit [Read error: Connection reset by peer]
KrzaQ has quit [Ping timeout: 264 seconds]
amclain has quit [Quit: Leaving]
glowcoil_ has joined #ruby
pjaspers_ has joined #ruby
daxroc_ has joined #ruby
glowcoil has quit [Ping timeout: 250 seconds]
daxroc has quit [Ping timeout: 250 seconds]
pjaspers has quit [Ping timeout: 250 seconds]
glowcoil_ has quit [Changing host]
glowcoil_ has joined #ruby
glowcoil_ is now known as glowcoil
daxroc_ is now known as daxroc
krz has joined #ruby
sphex_ is now known as sphex
dhjondoh1 has quit [Quit: dhjondoh1]
shoutsid has joined #ruby
arup_r has quit []
revdan has joined #ruby
blackmesa has joined #ruby
senayar has joined #ruby
iamninja has quit [Ping timeout: 252 seconds]
sandelius has joined #ruby
RazorX has quit [Ping timeout: 252 seconds]
coetry has joined #ruby
<coetry> What are your guys' thoughts on Ruby targeting wasm (web assembly)?
serivich has quit [Ping timeout: 255 seconds]
<coetry> and potentially allow ruby to replace javascript as a client side programming language?
<bnagy> there was a big goaround the day of the wasm announce
<coetry> do you guys see this as a new page for the ruby community and more specifically the rails community?
<bnagy> upshot was "maybe mruby"
jfarmer has quit []
<coetry> taking the principles of mruby and going even further though, building on that inspiration
<coetry> do you feel the advancements in the web platform can also impact the development of the ruby language and other languages as well?
dionysus69 has joined #ruby
doertedev has joined #ruby
jfarmer has joined #ruby
<contradictioned> can anybody help me with bundler? i am developing on two gems A and B in parallel, thus i have in A's Gemfile an entry 'B', path: '/some/where/B'
yfeldblum has quit [Ping timeout: 248 seconds]
uptownhr has quit [Ping timeout: 255 seconds]
<contradictioned> but somehow updates in B are not visible in A
_blizzy_ has joined #ruby
shoutsid has quit []
<adaedra> Bonjour
<contradictioned> i.e. if i add stupid `puts "blabla"` code in B, it is not output when I call the according method in A. is there something i'm loosing sight of?
towski_ has joined #ruby
mister_solo has joined #ruby
dhjondoh has joined #ruby
hagabaka has quit [Read error: Connection reset by peer]
Nirgali43 has quit [Ping timeout: 250 seconds]
scottymeuk has quit [Ping timeout: 250 seconds]
coffeeju1 has quit [Ping timeout: 250 seconds]
spectra has quit [Ping timeout: 250 seconds]
aep has quit [Ping timeout: 250 seconds]
andikr has quit [Ping timeout: 265 seconds]
Nirgali42 has joined #ruby
aep has joined #ruby
scottymeuk has joined #ruby
coffeeju1 has joined #ruby
uptownhr has joined #ruby
Aswebb_ has joined #ruby
<apeiros> contradictioned: did you gist your code? (don't have the backlog, so I can't look)
hagabaka has joined #ruby
_blizzy_ has quit [Ping timeout: 248 seconds]
spectra has joined #ruby
coffeecupp has joined #ruby
RazorX has joined #ruby
unshadow_ has joined #ruby
k3asd` has joined #ruby
jfarmer has quit []
ndrei has quit [Ping timeout: 252 seconds]
Joufflu has joined #ruby
brain_shim has joined #ruby
konsolebox has joined #ruby
konsolebox has quit [Max SendQ exceeded]
blackmesa has quit [Ping timeout: 244 seconds]
unshadow has quit [Ping timeout: 256 seconds]
konsolebox has joined #ruby
<contradictioned> apeiros: there's not much code to show ;)
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> contradictioned: ok. can't help you without code.
toretore has joined #ruby
<pontiki> do you bundle update A to get B's updates?
senayar has quit [Remote host closed the connection]
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
<contradictioned> I've tried, but bundler didn't show any changes
ratazzi has quit [Ping timeout: 252 seconds]
joonty has joined #ruby
ruby-lang693 has joined #ruby
RazorX has quit [Remote host closed the connection]
<contradictioned> okay, I bumped the version of B's gemspec, now it works
fgo has joined #ruby
<ruby-lang693> Hello, sorry i'm french, Is this tutorial available for ruby 2 ? http://ruby-doc.org/docs/beginner-fr/xhtml/
<contradictioned> but this means, i have to do a version bump for every little code change
lkba_ has quit [Ping timeout: 244 seconds]
langlands has joined #ruby
<ruby-lang693> It's a french tutorial
<ruby-lang693> but i don't if it is good for ruby 2
coetry has quit [Quit: Lost terminal]
whiteline has joined #ruby
<baweaver> 2003 is too old
Matthews_ has joined #ruby
<baweaver> seeing if I can find anything
IanV0rn2341 has joined #ruby
GnuYawk has quit [Read error: Connection reset by peer]
<baweaver> though honestly (and take as you will) you would be better served by going with the english versions as they're far more likely to be up to date.
ton31337 has joined #ruby
tvb has joined #ruby
<adaedra> ruby-lang693: bonjour
<ton31337> anyone is using gem 'zk' for zookeeper?
<adaedra> as baweaver said, you will have more luck with english resources
<ruby-lang693> Un francais !
mikecmpbll has joined #ruby
<tvb> Hi, I need some help with exception raising and rescueing
m3_del has joined #ruby
<ruby-lang693> thank you, have you got a good english tutorial
<ruby-lang693> for ruby 2 ?
revdan has left #ruby ["Textual IRC Client: www.textualapp.com"]
<ruby-lang693> on internet
<sphex> ruby-lang693: everything in that tutorial looks compatible with ruby 2 to me
fgo has quit [Ping timeout: 256 seconds]
<adaedra> ruby-lang693: looked at the offical guide? https://www.ruby-lang.org/fr/documentation/quickstart/
<ruby-lang693> Yes but is just for 20 minutes
<adaedra> tvb: we can help you if you state your issue
<tvb> got this piece of code: http://pastebin.com/cPXimP7C
<ruboto> tvb, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/ac5e6f0209857bbcfd23
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
adminc has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sphex> ruby-lang693: oh wait.. I didn't check right.
IanV0rn2341 has quit [Max SendQ exceeded]
MatthewsFace has quit [Ping timeout: 252 seconds]
eGGsha has joined #ruby
<baweaver> sphex: It might be, but 2003 is pushing your luck a bit. Best to stay within 3 years just to avoid fun little gotchas.
eGGsha is now known as eGGshke
<tvb> adaedra: the raise is working if x is 0 but the code is not contineuing
IanV0rn2341 has joined #ruby
<ruby-lang693> Okay, it's not a good tutorial for ruby 2
<tvb> and if x = 1 or higher I won't get any errors but the result after will be null
<tvb> what am I doing wrong?
<ruby-lang693> But have you got a good english tutorial
adminc has quit [Remote host closed the connection]
stoodfarback has quit [Ping timeout: 256 seconds]
jeanlinux has joined #ruby
<baweaver> ruby-lang693: see that above link for book recommendations
<bnagy> tvb: don't do anything you're doing in that code :)
<baweaver> past that, look into try-ruby or 'learn ruby the hard way'
<bnagy> if you raise, just raise "whatever"
<sphex> baweaver: yeah.. I would have assumed so. but I don't notice anything deprecated in it.. looks surprisingly good to me. it doesn't seem to cover encodings at all though.
ton31337 has left #ruby [#ruby]
<bnagy> because mostly you want to be using StandardError
ryba has joined #ruby
<baweaver> most people won't touch them honestly.
<bnagy> tvb: also, don't use rescue to set default
m3_del has quit [Ping timeout: 255 seconds]
<adaedra> ruby-lang693: please note that channel rules state that you shouldn't pm someone without asking first.
<baweaver> semantics, but more specific errors are better for later reference
<tvb> bnagy: "don't do anything you're doing in that code :)" you mean all is wrong?
<baweaver> all is Zuul
<bnagy> tvb: pretty much, yeah, sorry :/
<baweaver> agreed
<baweaver> try instead:
<tvb> ok it is my first day of ruby, so what do I need to do different?
<bnagy> tvb: I just explained all that :)
RazorX has joined #ruby
<baweaver> >> x = 0; x = x < 0 ? 1 : x
<ruboto> baweaver # => 0 (https://eval.in/391576)
<ruby-lang693> I have this tutorial http://learnrubythehardway.org/book/
<baweaver> >> x = -1; x = x < 0 ? 1 : x
<ruboto> baweaver # => 1 (https://eval.in/391578)
<baweaver> ah, backwards
<bnagy> baweaver: o_0
<tvb> :o
<adaedra> ruby-lang693: it is often considered as a good resource, yes :)
<bnagy> HI WELCOME TO RUBY HAVE A FACEFUL OF TERNARY
blackmesa has joined #ruby
eGGshke is now known as eGGsha
uptownhr has quit [Quit: uptownhr]
<bnagy> tvb: x = 1 if x.zero?
<baweaver> >> x = 0; x = if x > 0 then x else 1
<ruboto> baweaver # => /tmp/execpad-ad7c191cdd37/source-ad7c191cdd37:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/391582)
senayar has joined #ruby
<baweaver> >> x = 0; x = if x > 0 then x else 1 end
<ruboto> baweaver # => 1 (https://eval.in/391583)
<baweaver> fine, no ternaries.
<adaedra> D:
<baweaver> >> true ? :true : :false # but this is what they do
<ruboto> baweaver # => :true (https://eval.in/391584)
<tvb> bnagy: zero or should not be allowed
<baweaver> >> false ? :true : :false # but this is what they do
<ruboto> baweaver # => :false (https://eval.in/391585)
<bnagy> tvb: oh my bad, I read the logic wrong
<tvb> so should I not raise if the given argument is 0 or lower?
<bnagy> no, because you're rescuing it immediately
<bnagy> so what's the point? Just check.
<tvb> on the cli the given argument is an option parameter
<baweaver> option(al)?
<bnagy> don't use exceptions as a standin for obvious flow control
<tvb> optional, as in if not given 1 should be used
<tvb> bnagy: ok
coffeecupp has quit [Ping timeout: 246 seconds]
<baweaver> >> def method(a=1) a end; method
<bnagy> well you can use defaults for that
<ruboto> baweaver # => 1 (https://eval.in/391588)
<baweaver> >> def method(a=1) a end; method(3)
<ruboto> baweaver # => 3 (https://eval.in/391589)
<baweaver> REPL :D
<bnagy> but your example is sanitising arguments
<tvb> ah define (a=1) in the method
<tvb> check
<bnagy> so you would have a default and also x = 1 if x <= 0
<tvb> and I have a default in the option parser, but it is not used with rspec
<baweaver> or x = 1 unless x > 0
<flughafen> oi oi oi!
<flughafen> shevy: nothing has taken off today
<tvb> ok let me change the code a bit and repaste to check
<baweaver> fair warning, to_i coerces types instead of checking validity
lkba has joined #ruby
<baweaver> >> 'a'.to_i
<ruboto> baweaver # => 0 (https://eval.in/391590)
<baweaver> >> Integer('a')
<ruboto> baweaver # => invalid value for Integer(): "a" (ArgumentError) ...check link for more (https://eval.in/391591)
<baweaver> If you need to coerce them that is.
ruby-lang693 has quit [Quit: Page closed]
Matthews_ has quit [Remote host closed the connection]
<Ox0dea> >> _=$$/$$;@_=[$.]*(($_=[*' '..?{]*'')=~/$/);(@__=->__,___{(__=~/$/)!=(___=~/$/)?!$_:(@_[$_=~/#{__[$.]}/]+=_;@_[$_=~/#{___[$.]}/]-=_;__[$.+=_]?@__[__,___]:!!(@_*'')[/^#{_-_}+$/])})['obscurantist', 'subtractions']
<ruboto> Ox0dea # => true (https://eval.in/391592)
<tvb> uhm got the unless wrong tho
<baweaver> AWS sdk then eh
<tvb> nah
<baweaver> ah hi Ox0dea
<baweaver> t1.small is an AWS instance type at least.
solocshaw has quit [Ping timeout: 255 seconds]
<baweaver> anagrams eh?
sharpmachine has joined #ruby
<Ox0dea> Indeed.
<tvb> baweaver: it is but im not using the SDK. It is just some little test im writing
<baweaver> fair enough
<baweaver> Ox0dea: give me a bit
<Ox0dea> Of course. Mind, that's not the hard one. :)
<Ox0dea> I did a variadic one as well.
<Ox0dea> >> @_,$_,@__=->_,__{_==''?_:(__[_[$_-$_]]?_[$_-$_]:'')+@_[_[$_..-$_],__]},$$/$$,@__=->_{__,___=_[$_-$_],_[$_..-$_];_==''?_:@__[@_[___,->_{_<__}]]+__+@__[@_[___,->_{_>=__}]]};($__=->*_{__=@__[_[$.]];$*[$_-$_]==__ ?_:$*<<__;_[$.+=$_]?$__[*_]:!$*[$_]})['allergy', 'gallery', 'largely', 'regally']
<ruboto> Ox0dea # => true (https://eval.in/391595)
<baweaver> 'the' infers more than
<baweaver> ....one
<Ox0dea> Heh.
<baweaver> do you want both muggled?
<Ox0dea> The latter, if you're only doing one.
<baweaver> this late probably that
<Ox0dea> It's got something fancy in it.
<baweaver> I wait with bated breath to find it
<Ox0dea> Alas, it's specialized for strings to keep things short, but the generalization falls right out.
<yorickpeterse> morning
sharpmachine has quit [Ping timeout: 252 seconds]
Hounddog has joined #ruby
<adaedra> Ox0dea: that's horiffic
toretore has quit [Quit: This computer has gone to sleep]
_whitelogger has joined #ruby
tekacs has joined #ruby
Oka has joined #ruby
lee-jon has quit [Quit: lee-jon]
elektronaut has joined #ruby
drPoggs has joined #ruby
axl_ has quit [Quit: Leaving]
dionysus69 has quit [Quit: dionysus69]
coffeecupp has joined #ruby
axl_ has joined #ruby
brain_shim has quit [Ping timeout: 264 seconds]
<baweaver> Ox0dea: half asleep, probably going to call it a night on this one. Got a good way through the first lambda expression
<Ox0dea> baweaver: Ah, all right, then.
<baweaver> 'night mate, I'll ping you when I have something.
<Ox0dea> Good night. I eagerly await said ping.
<adaedra> gn Ox0dea
dionysus69 has joined #ruby
baweaver has quit [Remote host closed the connection]
IanV0rn2341 has quit []
lee-jon has joined #ruby
darlinger has joined #ruby
<darlinger> is there any way to create an empty array without it automatically turning into Nil class?
<sevenseacat> foo = [] ?
lee-jon has quit [Client Quit]
<zotherstupidguy> whats the name of the channel of unrelated ruby things?
<darlinger> sevenseacat: still get a method error with NilClass
mister_s_ has joined #ruby
<sevenseacat> darlinger: and the error is?
<Ox0dea> ?ot zotherstupidguy
<ruboto> zotherstupidguy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<sevenseacat> and the code is?
lee-jon has joined #ruby
<sevenseacat> you might be trying to access the first element of an empty array, which is nil
<darlinger> sevenseacat: give me a second and I will send a gist
Scroff has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
Scroff has quit [Read error: Connection reset by peer]
Scroff has joined #ruby
konsolebox has joined #ruby
baweaver has joined #ruby
mister_solo has quit [Ping timeout: 265 seconds]
<flughafen> what's the biggest/best ruby connference to go to in europe?
<sevenseacat> darlinger: and the error is?
n008f4g_ has joined #ruby
Akagi201 has joined #ruby
<darlinger> sevenseacat: run it. anything Array#method that I try to use with the empty arrays gives me a missing method error because it automatically turns into NilClass
<sevenseacat> darlinger: no it doesn't. I'd appreciate if you could post the full error you obviously have right in front of you on your screen.
houhoulis has quit [Remote host closed the connection]
<Ox0dea> sevenseacat: It's okay; that's enough code to see the problem.
<darlinger> sorry wrong buffer
<darlinger> ./towers_of_hanoi.rb:38:in `move': undefined method `empty?' for nil:NilClass (NoMethodError) from ./towers_of_hanoi.rb:59:in `<main>'
<darlinger> it's infuriating
<Ox0dea> darlinger: You don't need to pass @left and @right into the call to #move.
<sevenseacat> darlinger: you havent defined @left and @right
<Ox0dea> The instance knows its own @left and @right, so just access them directly from within #move.
<sevenseacat> therefore they are nil
<canton7> darlinger, line 59, @left and @right are undefined
<darlinger> ohhhhh
<canton7> Ox0dea, I think that will defeat the point of the game :P
<sevenseacat> Ox0dea: it is enough to tell the error, but we dont encourage people to just dump their code and go 'fix it for me'
corecode_ has left #ruby ["ERC (IRC client for Emacs 24.5.1)"]
<sevenseacat> 'you run the code, find the problem, and tell me how to fix it'
<darlinger> hmmm. well then how do i take user input to designate which instance variables I want to mess with it
<Ox0dea> You'll need to do some restructuring.
<canton7> you could: expose left, right, and middle to users of TowerGame, so usage is 'game1.move(game1.left, game1.right)'
<darlinger> sevenseacat: in my defense I did tell you a description of the error as well as present the code. i just didn't copy and paste the error for you
<canton7> or you could accept another form of identifier, e.g. 'game1.move(:left, :right)'
baweaver has quit [Ping timeout: 248 seconds]
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
<sevenseacat> darlinger: against your defence, the error has nothing to do with arrays
dramforever has joined #ruby
dramforever has left #ruby [#ruby]
<darlinger> canton7: oh that works? thanks
<canton7> darlinger, also, line 53, did you mean to have a '5' in there?
<canton7> darlinger, you'll need to write some more code for either of those options, but they're both valid end goals
<darlinger> canton7: oh good catch. still a work in progress. I have to fix that so that it changes with the number of rings
olistik has joined #ruby
mrmargolis has joined #ruby
<darlinger> canton7: i plan on handling all the moves with private methods
<canton7> darlinger, heck you've already got a @pegs dict - you could pass 'left', 'middle' or 'right' to move, and use @pegs to map that to the right column
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<darlinger> canton7: that's the plan :D i just was testing the move method to see if it worked. didn't realize I was having a scope issue >_>
<canton7> :P
dagda1 has quit [Read error: No route to host]
dagda1 has joined #ruby
_blizzy_ has joined #ruby
<darlinger> canton7: thanks for your help. i've been bashing my head against this for a few hours now
unshadow has joined #ruby
mrmargolis has quit [Ping timeout: 248 seconds]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Asher has quit [Quit: Leaving.]
rikkipitt has joined #ruby
gizmore has joined #ruby
ndrei has joined #ruby
unshadow_ has quit [Ping timeout: 265 seconds]
<darlinger> canton7: still getting nil class error
Asher has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
<darlinger> canton7: with correct scope this time
bigkevmcd has quit [Read error: Connection reset by peer]
<canton7> darlinger, pastie your modified code and the exact error message
<darlinger> ./towers_of_hanoi.rb:50:in `move': undefined method `push' for nil:NilClass (NoMethodError) from ./towers_of_hanoi.rb:67:in `<main>'
nolic has joined #ruby
bigkevmcd has joined #ruby
<canton7> darlinger, @left is nil
<canton7> see if you can figure out why ;)
<darlinger> just realized i had a mistake with TowerGame#move. had @left and @right switched
Oka has quit []
<darlinger> canton7: still throws same error
_blizzy_ has joined #ruby
avril14th has joined #ruby
<canton7> darlinger, @left is nil
<canton7> see if you can figure out why ;)
revath has left #ruby [#ruby]
MissionCritical has quit [Ping timeout: 252 seconds]
<darlinger> canton7: the TowerGame#initialize
<canton7> indeed
<darlinger> canton7: why doesn't @left take the contents of @win?
<sphex> hey. so when a block is passed down to a method, how are return/next/break from the block handled? they seem to do the right thing for built-in iterators, but how do they work? do they throw special exceptions?
<canton7> darlinger, because you don't assign @win to it ;)
<darlinger> canton7: does win not have a value until the method is done executing?
<canton7> darlinger, again, you don't assign @win to @left
<canton7> read your code, very carefully
beilabs_ has quit [Ping timeout: 276 seconds]
stamina has joined #ruby
ton31337 has joined #ruby
mister_s_ has quit [Ping timeout: 264 seconds]
<ton31337> anyone is using zookeeper with ruby?
<darlinger> canton7: ohhhh oops. caught it. who keeps changing my identifiers?? :p
fgo has joined #ruby
rikkipit_ has joined #ruby
<ton31337> https://gist.github.com/ton31337/0aae0e34e2dfffee31c9 no idea, what's wrong here. I can't see any events :/
tkuchiki has quit [Remote host closed the connection]
lee-jon has quit [Quit: lee-jon]
<canton7> darlinger, nope, not scope. You wrote @left = @win_seq, not @left = @win
d0lph1n98 has quit [Ping timeout: 252 seconds]
pgatt has quit [Quit: Connection closed for inactivity]
rikkipitt has quit [Ping timeout: 248 seconds]
<darlinger> canton7: it works :)
tkuchiki has joined #ruby
<canton7> good good
pengin has joined #ruby
oliver___ has quit []
<darlinger> canton7: how do I print the name of a variable as a string?
<canton7> by writing the name of the variable as a string
allomov has joined #ruby
<yorickpeterse> darlinger: you can't, the only way to get all local variables in a scope is to call "local_variables"
KrzaQ has joined #ruby
<yorickpeterse> e.g.
<yorickpeterse> >> foo = 10; local_variables
<ruboto> yorickpeterse # => [:foo] (https://eval.in/391605)
senayar has quit [Remote host closed the connection]
<avril14th> Hello, I have a question about drying up the writing of some methods using meta programmation: https://gist.github.com/muichkine/d1a53c75137b85cd09b2 any input is welcome
<darlinger> yorickpeterse: gotcha. hmmm
<canton7> DRY is not about lines of code. It's about business logic
<canton7> having boilerplate does not mean you're violating DRY
ton31337 has left #ruby [#ruby]
m3_del has joined #ruby
CloCkWeRX has quit [Ping timeout: 252 seconds]
fgo has quit [Ping timeout: 264 seconds]
zotherstupidguy has left #ruby ["WeeChat 1.2"]
<yorickpeterse> You could dynamically define the methods though
<avril14th> like? automatically prepending a module that lists all ias_* methods and override them with self.ias{ super } ?
allomov has quit [Read error: Connection reset by peer]
rikkipitt has joined #ruby
wallerdev has quit [Quit: wallerdev]
rikkipit_ has quit [Ping timeout: 265 seconds]
m3_del has quit [Ping timeout: 276 seconds]
eGGsha has joined #ruby
<yorickpeterse> eh no, I was thinking of using something like define_method to dynamically define the methods with whatever they're supposed to retunr
<yorickpeterse> * return
Siyfion has joined #ruby
pengin has quit [Remote host closed the connection]
allomov has joined #ruby
<avril14th> well, each returns its own stuff with a different logic, so I need to write their body one by one anway
senayar has joined #ruby
<tvb> bnagy: how can I check for string and if it is not a string submit a default?
<avril14th> tvb: obj.kind_of? String
<tvb> yeah but how about the if not?
<avril14th> obj.kind_of?(String) ? obj : 'default'
<tvb> ah
MissionCritical has joined #ruby
symm- has joined #ruby
<avril14th> or if you know that the object is either nil or a string: obj ||= 'default'
nofxx has quit [Ping timeout: 248 seconds]
stamina has quit [Remote host closed the connection]
rikkipitt has quit [Ping timeout: 264 seconds]
<tvb> avril14th: instance_type.kind_of?(String) ? instance_type : 't1.small'
<tvb> im submitting 2 (without quotes, so should be int?) and the check is not working
<tvb> expected: "t1.small"
<tvb> got: 2
rikkipitt has joined #ruby
lee-jon has joined #ruby
marcoecc has joined #ruby
ninja-maid-robot has quit [Quit: fix config]
<avril14th> >> 2.kind_of?(String) ? 'ah' : 'beh'
<ruboto> avril14th # => "beh" (https://eval.in/391617)
<bnagy> tvb: not very rubyish to do it that way
ninja-maid-robot has joined #ruby
<shevy> tvb you can also use more than one line, via if/else, or unless/else, if the ? confuses you
<tvb> bnagy: do educate me
<bnagy> mostly people would just String(arg) or something
<yorickpeterse> eh?
<bnagy> and/or handle problems with the arg later
<yorickpeterse> What's not "Rubyish" about using a ternary?
rikkipitt has quit [Client Quit]
<bnagy> well ternary is awful
<avril14th> bnagy: String(arg) with 2 will not return 't1.small'
<yorickpeterse> bnagy: because...?
<bnagy> but I was talking about checking concrete type
<Darkwater> nothing wrong with ternary imo
<avril14th> tvb: back to your question, somethng else is messing up. code?
<Darkwater> better than a 5-line if/else block
Igorshp has joined #ruby
sinkensabe has joined #ruby
konsolebox has quit [Remote host closed the connection]
<tvb> avril14th: not sure, let me paste
krz has quit [Read error: Connection reset by peer]
<shevy> damn
sharpmachine has joined #ruby
<tvb> *gist
<bnagy> which is kind of a strawman because you almost never need if else to not use ternary
<shevy> some projects from rubyforge don't seem to exist on rubygems.org :(
<shevy> oh no wait
<shevy> "libxosd-ruby"
<ljarvis> tvb: what else would instance_type be?
<yorickpeterse> clearly we need a Gem to wrap if/else in a certain pattern
<yorickpeterse> and preferably include it in ActiveSupport
<shevy> nothing wrong with if/else
weemsledeux has joined #ruby
<avril14th> tvb: that's strange code.
yfeldblum has joined #ruby
beilabs_ has joined #ruby
<ljarvis> yorickpeterse: ActiveCondition
<shevy> no wonder - ternary is in that code :>
<avril14th> tvb: you specify default values, fine. Now you say "if the guy calling the code gives me shit, lets use default"
einarj has joined #ruby
<tvb> ljarvis: t2.small or any other string (I wont have to check for any valid aws type further tho)
<yorickpeterse> I joke but I basically did something pretty close to that
<yorickpeterse> although it serves a different use case
<tvb> avril14th: default if not submitted at all, right?
<yorickpeterse> https://github.com/olery/maybe this
bruno- has joined #ruby
<ljarvis> tvb: so.. if it's a string why do you need to check if it's a string?
<tvb> because one can type 2 as well
<bnagy> you should be checking if it's a valid instance type
<ljarvis> tvb: why?
<bnagy> there's no benefit to just checking if it's a string
<tvb> becuase instance_type can be submitted as option parse
<avril14th> tvb: yes, default if you pass nil. In which case you can write that better. Now, your code handles the case where a guy could call for instance "num_instance = -2". Should you really check that? if yes, why not raise an exception?
marcoecc has quit [Ping timeout: 264 seconds]
ahmetkapikiran has joined #ruby
<ljarvis> tvb: but you discard the 2 completely
<tvb> avril14th: not writing an exception because bnagy advised me not to
<ljarvis> "if this is 2, ignore it completely and use t1.small" it makes no sense
<avril14th> tvb: :)
<bnagy> sigh. I told you not to use an exception to check if an arg is < 0 and then instantly handle it
<tvb> true
<bnagy> because that's dumb.
sharpmachine has quit [Ping timeout: 264 seconds]
apofis has joined #ruby
<bnagy> here, imvho, just validate the arg directly, don't mess about wondering what ruby type it is
<avril14th> tvb: default values are useful to avoid writing them everywhere. Checking that something not supposed to happen is the point of exceptions isn't it?
<tvb> avril14th: true
<bnagy> someone is going to pass something else stringish one day and your api will be broken for no reason
lee-jon has quit [Quit: lee-jon]
lxsameer has joined #ruby
<avril14th> maybe so
<bnagy> so just look it up in a hash of valid instance types, which you're going to have to do at some point
<avril14th> or maybe you have backend logic that does the stuff rights and before that you have methods that check that params are fine
<tvb> bnagy: right
<avril14th> aren't controllers supposed to check passed params, and not backend logic code?
<tvb> avril14th: meh I want to keep it simple
<bnagy> then you can do instance_type = valid[instance_arg] || "some default"
<ljarvis> valid.fetch
bruno- has quit [Ping timeout: 252 seconds]
<shevy> if I have a string for a class method, called string = 'foobar'; and that class method exists, like Bar.foobar; the way I invoke this is: Bar.send(string) # string can be a different method, foobar is just one example) - My question is, is there an alternative to .send() in this example?
<ljarvis> shevy: public_send is what you want
<ljarvis> unless you actually want it to potentially call a private method (almost never what you want)
<tvb> so this would make more sense
<tvb> instance_type === 't2.small' ? instance_type : 't2.small'
<bnagy> ljarvis: ha. I always forget fetch :/
<tvb> given that I only need to check for t2.smal
Scroff has quit [Ping timeout: 244 seconds]
<bnagy> uh.. wat
<ljarvis> tvb: that makes it *always* 't2.small' :/
<avril14th> shevy: send is fine, isn'it it? :)
Scroff has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
dagda1 has quit [Read error: No route to host]
<shevy> avril14th I guess
<avril14th> you could eval "Bar.#{string}" if you want to really mess things up / uglify though
<avril14th> :)
<avril14th> public_send is basicaly a send with permission check
<ljarvis> :/
<tvb> ljarvis: guess that is fine in this case. I really don't want to extend the logic
<yorickpeterse> lol using eval() with user input
<yorickpeterse> surely that will never go wrong
<ljarvis> tvb: so wait, you don't want to allow anything but "t2.small"?
<canton7> tvb, I rewrote your code: "instance_type = 't2.small'"
<avril14th> yorickpeterse: exactly what I said :)
<ljarvis> ^^
djbkd has quit [Quit: My people need me...]
dagda1 has joined #ruby
<tvb> canton7: heh that makes sense hmm
<tvb> ok maybe I need some exceptions here and there
jeanlinux has quit [Remote host closed the connection]
anisha is now known as anarang
<shevy> Ox0dea, haha look - I just found this project https://rubygems.org/gems/ascii - now your rugen thing could become a rugen-ascii thing!
<shevy> and an ascii representation of the unicode snowman \o/
A205B064 has quit [Ping timeout: 264 seconds]
coffeecupp has quit [Quit: Leaving]
<tvb> bnagy: how about this
<tvb> instance_types = ['t1.small', 't2.small']
<tvb> instance_types.include? instance_type ? instance_type : 't2.small'
<ljarvis> so.. they CAN be different?
<ljarvis> kill me
lee-jon has joined #ruby
* adaedra kills ljarvis
* yorickpeterse intervenes
skyrocker1 has left #ruby [#ruby]
<ljarvis> tvb: define INSTANCE_TYPES with an array of allowed types, and write: instance_type = INSTANCE_TYPES.fetch(instance_type, 't2.small')
<ljarvis> you are done
<tvb> ljarvis: well, they can but I thought to keep it simple and just won't allow it for now
<ljarvis> tvb: this is simple eitherway, really
<tvb> ljarvis: true
krz has joined #ruby
<shevy> tvb btw you can also simplify such an array: instance_types = %w( t1.small t2.small ) <--- saves you the ',' in the middle, especially useful the longer the Array is
<bnagy> tvb: stop writing ternary
<bnagy> especially with boolean? methods :<
<shevy> haha
<shevy> or use ONLY boolean methods when you use the ternary!
sinkensabe has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
renderful has joined #ruby
towski_ has quit [Remote host closed the connection]
chinmay_dd has quit []
ramfjord has quit [Ping timeout: 244 seconds]
Aswebb_ has quit []
renderful has quit [Ping timeout: 265 seconds]
fantazo has joined #ruby
lkba_ has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
<tvb> ljarvis: getting fetch': no implicit conversion of String into Integer
<tvb> because im submitting 2
michael_mbp has quit [Excess Flood]
andikr has joined #ruby
IanV0rn2341 has joined #ruby
blackmesa has quit [Ping timeout: 265 seconds]
lkba has quit [Ping timeout: 252 seconds]
d0lph1n98 has joined #ruby
User458764 has quit [Ping timeout: 252 seconds]
astrobun_ has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 256 seconds]
codecop has quit [Remote host closed the connection]
michael_mbp has joined #ruby
<bnagy> I suspect ljarvis meant a hash not an array
User458764 has joined #ruby
ndrei has joined #ruby
<bnagy> Array also has a fetch method, which is probably what's causing the confusion
<tvb> hmm ok lets try that
<shevy> bnagy uses remote mind reading technique
<shevy> he is watching you as you type tvb!
el3k0n has joined #ruby
<tvb> shevy: I am real happy with all the help from all of you guys :)
<shevy> yeah you should buy bnagy a beer when he comes around!
<bnagy> when you define the hash it's kind of ugly though, cause it would have to be {'t1.small' => 't1.small'} if you're using fetch
<bnagy> but it makes the rest of the code clean, so meh
KrzaQ has quit [Read error: Connection reset by peer]
<tvb> bnagy:
<tvb> instance_types = Hash.new
<tvb> instance_types[1] = 't1.small'
<tvb> instance_types[2] = 't2.small'
<Ox0dea> >> foo = [1,2,3]; foo.zip(foo).to_h
<tvb> instance_type = instance_types.fetch(instance_type, 't2.small')
<ruboto> Ox0dea # => {1=>1, 2=>2, 3=>3} (https://eval.in/391654)
<tvb> seems to work for me
<bnagy> tvb: oh, you want to look up from a number to a string?
<bnagy> then yes, using a hash is perfect now
darlinger has quit [Quit: leaving]
<tvb> define number?
<bnagy> instance_types[1] = 't1.small' means the key is the number 1
marr has joined #ruby
Indian has joined #ruby
<bnagy> also, don't paste into the chan
KrzaQ has joined #ruby
blackmesa has joined #ruby
<tvb> bnagy: sorry about that
pepperbreath1 has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
pepperbreath1 has left #ruby [#ruby]
olistik has quit [Read error: Connection reset by peer]
Rickmasta has joined #ruby
gf3 has quit [Ping timeout: 264 seconds]
olistik has joined #ruby
JStoker has quit [Ping timeout: 264 seconds]
JStoker has joined #ruby
JStoker has quit [Changing host]
JStoker has joined #ruby
lkba_ has quit [Ping timeout: 264 seconds]
gf3 has joined #ruby
lkba has joined #ruby
drager has quit [Ping timeout: 256 seconds]
m3_del has joined #ruby
drager has joined #ruby
machty has quit [Ping timeout: 256 seconds]
<tvb> bnagy: I am not sure what you mean with "look up for a number to a string". I am submitting `2` and wanting to check that against the hashes defined in instance_types
Igorshp has quit [Remote host closed the connection]
<tvb> if not found, make instance_type 't2.small'
Igorshp has joined #ruby
KrzaQ has quit [Remote host closed the connection]
KrzaQ has joined #ruby
lkba has quit [Remote host closed the connection]
<bnagy> do INSTANCE_TYPES = %w( blah.large blah.small .. more here) VALID_INSTANCES = INSTANCE_TYPES.zip(INSTANCE_TYPES).to_h
<bnagy> then use the fetch trick ljarvis said
m3_del has quit [Ping timeout: 276 seconds]
<bnagy> instance = VALID_INSTANCES.fetch(arg, 'default.blah.here')
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
machty has joined #ruby
ramfjord has joined #ruby
<tvb> hmm
<bnagy> I am still not 100% convinced of the cleanliness of this approach, but it should at least work
<tvb> ok
<tvb> I understand the code so its ok
<bnagy> otherwise use an array then do arg = default unless VALID.include? arg or something
<tvb> undefined method `to_h
<tvb> ?
ryba has quit [Ping timeout: 256 seconds]
<ljarvis> you're on an older version of ruby which doesn't define to_h
neanderslob has quit [Read error: Connection reset by peer]
<tvb> ruby 2.0.0p481
<ljarvis> Hash[foo] instead of foo.to_h
<ljarvis> yep, it's old
<ljarvis> internet old
<tvb> oh osx default i guess
<ljarvis> D:
ramfjord has quit [Ping timeout: 264 seconds]
<Tarkers34> Ox0dea: your regex worked perfectly from last night, thankyou
<adaedra> use Hash[]
<tvb> jep
<ljarvis> or use the code I pasted :)
sash_ has quit [Ping timeout: 256 seconds]
sash_ has joined #ruby
* ljarvis prefers his
<bnagy> because it's longer and slower?
<ljarvis> since when is longer code a bad thing?
akkad has quit [Ping timeout: 250 seconds]
<ljarvis> and why is it slower? if you have a big fat list mine will in fact be exponentially faster
<shevy> long code leads to the java syndrome
riffraff has joined #ruby
skyjumper has quit [Ping timeout: 250 seconds]
pgatt has joined #ruby
<bnagy> ljarvis: because irl the Set creation is going to be slower than one list lookup
skyjumper has joined #ruby
<ljarvis> in this case perhaps
<bnagy> but fundamentally who cares
pgatt has quit [Changing host]
pgatt has joined #ruby
<ljarvis> but lets be honest, the different is inconsequential unless the list is huge
<bnagy> I'm not seriously faulting it for speed
sharpmachine has joined #ruby
<bnagy> I'm just angry at NFS right now
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
akkad has joined #ruby
<tvb> http://rubyforge.org/projects/netaddr/ => RubyForge Could Not Connect to Database:
<ljarvis> tvb: rubyforge is dead
<tvb> oh old link then
<shevy> good old rubyforge :(
<bnagy> tvb: another thing you could consider instead of all of this stuff is just raising ArgumentError
<bnagy> some people would argue that silently substituting a default for an invalid arg is bad API behaviour
revath has joined #ruby
<tvb> well lets throw in an argument error for my next task, just for fun
GeorgesLeYeti has joined #ruby
<GeorgesLeYeti> Hi
shredding has joined #ruby
<bnagy> like.. user makes a typo, keeps seeing wrong instance launch, spends hours wondering why
<tvb> bnagy: valid point
<ljarvis> ^ +1
sharpmachine has quit [Ping timeout: 248 seconds]
<tvb> first I need to verify the correctness of an ip address that has been submitted
<ljarvis> what does correctness mean?
<tvb> and convert it to the correct CIDR
bruno- has joined #ruby
<GeorgesLeYeti> I'm using a gem which display some info while using it. Is it possible no to print these info but only the ones i'm using into my function
<GeorgesLeYeti> Sorry if it's not clear
<ljarvis> GeorgesLeYeti: a gem prints something to STDOUT?
<GeorgesLeYeti> ljarvis, How could i know that ?
chinmay_dd has joined #ruby
<ljarvis> GeorgesLeYeti: it'll print in your terminal (probably)
<Ox0dea> ljarvis: Could be stderr.
<ljarvis> pedant
<tvb> ljarvis: I was looking at netaddr, but lets try ipaddress
<GeorgesLeYeti> ljarvis, then yes
<Ox0dea> GeorgesLeYeti: You'll need to determine if it's printing to stdout or stderr.
<Ox0dea> But yes, you can redirect either of them.
<ljarvis> GeorgesLeYeti: you could redirect stdout/stderr to determine
<ljarvis> see IO#reopen
<ljarvis> er
<ljarvis> yes
Akagi201 has quit [Remote host closed the connection]
<ljarvis> tvb: the last netaddr release was 7 years ago
<tvb> Noticed that yeah
khebbie has joined #ruby
revath has quit [Ping timeout: 246 seconds]
blackmes1 has joined #ruby
tomphp has joined #ruby
<bnagy> oh no, it probably hasn't kept up with all the new aspects of ip addressing
<GeorgesLeYeti> i'm pretty sure then display is coming from this line: puts response.inspect
<GeorgesLeYeti> into my gem
revath has joined #ruby
<Ox0dea> >> require 'stringio'; $stdout = StringIO.new; puts 'this gets captured'; ret = $stdout.string; $stdout = STDOUT; ret
<ruboto> Ox0dea # => "this gets captured\n" (https://eval.in/391662)
<Ox0dea> GeorgesLeYeti: ^
<bnagy> nice
Mon_Ouie has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
<tvb> ljarvis: I installed the gem
<tvb> however
<tvb> `require': cannot load such file -- ipaddress (LoadError)
tkuchiki has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 252 seconds]
tkuchiki has joined #ruby
riffraff has quit [Quit: Leaving]
Musashi007 has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
<tvb> Successfully installed ipaddress-0.8.0
oo_ has quit [Remote host closed the connection]
bubbys has quit [Ping timeout: 264 seconds]
tkuchiki has quit [Remote host closed the connection]
bubbys has joined #ruby
<tvb> hmm gem_path is emtpy?
<tvb> echo $GEM_PATH
mrmargolis has joined #ruby
Azure has quit [Read error: Connection reset by peer]
oo_ has joined #ruby
<tvb> oh but gem env is telling me
tkuchiki has joined #ruby
sdothum has joined #ruby
<tvb> - GEM PATHS:
<tvb> - /Library/Ruby/Gems/2.0.0
yeticry has quit [Ping timeout: 256 seconds]
nolic has quit [Ping timeout: 252 seconds]
Azure has joined #ruby
AlexRussia has quit [Quit: WeeChat 1.2-dev]
nolic has joined #ruby
jenrzzz has joined #ruby
dede has joined #ruby
yeticry has joined #ruby
mrmargolis has quit [Ping timeout: 246 seconds]
mandarinkin has joined #ruby
ramfjord has joined #ruby
polysics has quit []
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy> so where did it download it then
senayar has quit [Remote host closed the connection]
<shevy> is it in /Library/Ruby/Gems/2.0.0/cache/ ?
senayar has joined #ruby
rmoriz has quit [Quit: ZNC - http://znc.in]
jenrzzz has quit [Ping timeout: 264 seconds]
jmhmccr has quit [Quit: Connection closed for inactivity]
<tvb> yes
rmoriz has joined #ruby
<tvb> updating ruby to 2.2.2
unshadow_ has joined #ruby
mister_solo has joined #ruby
Musashi007 has quit [Quit: Musashi007]
centrx has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lee-jon has quit [Quit: lee-jon]
lee-jon has joined #ruby
fgo has joined #ruby
Mon_Ouie has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
vondruch has quit [Quit: Ex-Chat]
vondruch has joined #ruby
unshadow has quit [Ping timeout: 265 seconds]
<tvb> nice; ruby -v ruby 2.2.2p95
eGGsha has joined #ruby
ndrei has quit [Ping timeout: 276 seconds]
DEA7TH_ has joined #ruby
<tvb> ok got the same :(
<tvb> installed the gem again
<tvb> `require': cannot load such file -- ipaddress (LoadError)
fgo has quit [Ping timeout: 256 seconds]
yqt has joined #ruby
dagda1 has quit [Read error: Connection reset by peer]
<izzol> tvb: which OS ?
<tvb> osx 10.10
bhuvanaurora has joined #ruby
<izzol> do you have it in: /Library/Ruby/Gems/{ver}/gems/ ?
claw_ has quit [Ping timeout: 248 seconds]
<tvb> /Library/Ruby/Gems/2.0.0/gems/ipaddress-0.8.0/VERSION: ASCII text, with no line terminators
<tvb> version 2.0.0? Running 2.2.2 now
<jhass> tvb: is it in gem list? also what's your entire gem env output now (-> gist.github.com) and while at it, what's gem which ipaddress?
claw has joined #ruby
<tvb> should I create a symlink?
<jhass> no
<jhass> how did you update to ruby 2.2.2?
<izzol> tvb: so you installed it in 2.0.0 and you are using 2.2.2
<tvb> gem env: GEM_PATHS - /Users/tvb/.rvm/gems/ruby-2.2.2
<jhass> did you run gem install again after updating?
<tvb> jhass: \curl -L https://get.rvm.io | bash -s stable --ruby & rvm install 2.2.2 --autolibs=enable
Musashi007 has joined #ruby
<tvb> jhass: yes
dhjondoh has quit [Remote host closed the connection]
<jhass> then I'd like my other questions answered :)
<tvb> it is in the 'gem list'
<tvb> ill gist it
<jhass> tvb: since RVM, also add rvm info
<izzol> - /Users/tvb/.gem/ruby/2.0.0/bin
rodfersou has joined #ruby
A124 has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<tvb> izzol: you are saying?
blackmes1 has quit [Ping timeout: 264 seconds]
<jhass> yeah, something is adding to the shell path
<jhass> check your .$SHELLrc, .profile and .$SHELL_profile (bash by default on OS X iirc?)
<tvb> .profile perhaps?
<tvb> [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
<jhass> that's wanted
<tvb> ok
swiftynb has quit [Remote host closed the connection]
<adaedra> Should be bash on recent OSXes
<jhass> more like PATH="$(ruby yadayada):$PATH"
<tvb> export PATH="/Users/tristan/.gem/ruby/2.0.0/bin:$PATH"
<tvb> heh
<jhass> yeah
<jhass> that one, drop it
<jhass> if you're going to RVM
blackmes1 has joined #ruby
<tvb> ok
<tvb> - GEM PATHS:
<tvb> - /Users/tristan/.rvm/gems/ruby-2.2.2
<tvb> ok paths are looking good now
<jhass> so, ruby -ripaddress -e'puts "ok"'
<jhass> prints ok and nothing else?
<tvb> intalling ipaddress again
<tvb> it is not installing in the correct dir
<tvb> I dont see it /Users/tvb/.rvm/gems/ruby-2.2.2/cache/
<tvb> + in
<jhass> well, actually, what does command -v gem print?
<tvb> ruby -ripaddress -e'puts "ok"' prints ok tho
<jhass> ah, nvm then
<jhass> it should work now
<izzol> :)
<tvb> `require': cannot load such file -- ipaddress (LoadError)
NeverDie has joined #ruby
<tvb> it doesnt :(
lxsameer has quit [Quit: Leaving]
<jhass> tvb: what exact command is throwing that?
chinmay_dd has quit []
<tvb> require 'ipaddress'
<jhass> no, that's the code
<tvb> oh
<jhass> I'm asking for the command you invoke that code with
<tvb> ruby test.rb --instances 0 --instance-type t2.small --allow-ssh-from 37.17.210.74
<jhass> is that the same exact shell you did ruby -ripaddress from?
pusewicz has quit []
fgo has joined #ruby
pusewicz has joined #ruby
<tvb> uhm yes?
m3_del has joined #ruby
<jhass> no other terminal window or so?
<tvb> nope
<tvb> same shell, one command after the other
<jhass> no user switching/no sudo?
<shevy> hehe
<tvb> nada
<izzol> you executing it on the remote host?
<tvb> nope
<tvb> localhost
<jhass> tvb: directory switching?
<tvb> negative
<shevy> soon we are out of options
<jhass> s/soon//
<shevy> tvb: a cat on the desk pulling the plug?
<jhass> makes no sense
<tvb> shevy: thats it :)
<tvb> hmm
<shevy> well alright
<shevy> how many rubies do you have, and where are they?
<jhass> tvb: command -v ruby ?
<izzol> what is # which ruby ?
<bnagy> ruby -e "require 'ipaddress'"
<shevy> I have one ruby only for instance
<tvb> jhass: gives: /Users/tvb/.rvm/rubies/ruby-2.2.2/bin/ruby
<shevy> aha!
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass> shevy: that's what we want (and established earlier)
<shevy> the problem!
<tvb> which ruby is the same
<tvb> I dont see it?
<jhass> tvb: ignore shevy
<shevy> :(
<tvb> :)
<jhass> tvb: able to share test.rb wholly?
<tvb> sure
aryaching has joined #ruby
<jhass> oh
<tvb> ?
<jhass> did you ever mention you use bundler? :P
<shevy> !!!
<tvb> no..
<jhass> you need to add gem 'ipaddress' to your Gemfile and run bundle install
<tvb> oh doh
<tvb> Im all new to this
m3_del has quit [Ping timeout: 264 seconds]
<jhass> no worries, should've asked earlier about that
<bnagy> bumbler strikes again
blackmesa has joined #ruby
<shevy> ttp://cowboyjob.com/post/1666830/god-I-hate-that-choice-made-by-bundler-there
<tvb> Using ipaddress 0.8.0
eGGsha has joined #ruby
<shevy> damn I even mispaste
<t_> i have a troubleshooting checklist and 3rd on it is check gems are installed and correct version :p
<tvb> better!
<shevy> unless we rename http to ttp
<t_> it tends to occur more often than you would think
<t_> dont feel bad
<shevy> tvb \o/
<shevy> one problem down, 99 more to come
blackmes1 has quit [Ping timeout: 252 seconds]
ryez has quit [Ping timeout: 246 seconds]
<tvb> ipaddress works perfectly
<adaedra> 99 little bugs in the code, patch it around, 167 little bugs in the code
<tvb> adaedra: hahaha
oo_ has quit [Remote host closed the connection]
Indian has quit [Ping timeout: 265 seconds]
oo_ has joined #ruby
harleypig has quit []
harleypig has joined #ruby
adamski2600 has joined #ruby
vcoinminer has quit []
vcoinminer has joined #ruby
symm- has quit [Ping timeout: 256 seconds]
gizmore has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
sharpmachine has joined #ruby
AlexRussia_ has joined #ruby
oo_ has quit [Remote host closed the connection]
AlexRussia_ has quit [Remote host closed the connection]
oo_ has joined #ruby
fabrice31 has joined #ruby
jenrzzz has joined #ruby
sharpmachine has quit [Ping timeout: 244 seconds]
nettoweb has joined #ruby
intinig has joined #ruby
fabrice31 has quit [Remote host closed the connection]
AlexRussia_ has joined #ruby
<tvb> guys what does the @ mean in ruby?
fabrice31 has joined #ruby
<tvb> @aws = Aws.new
AlexRussia_ is now known as AlexRussia
<centrx> tvb, it means it's an instance variable
<adaedra> it's not a symbol, it's part of the name
<tvb> ah
<tvb> so if I want to call aws.function()
<tvb> I rather call @aws.function()
<tvb> ..are prefixed by the @ symbol. This is enforced by Ruby - if your variable does not start with a @, it is considered to be a local variable.
<jhass> it's @aws.method, girl, but yeah ;)
<tvb> :P
<DefV> jhass: <3 for your effort on the BUNDLED_WITH issue
<DefV> 100x <3
ndrei has joined #ruby
<tvb> !jhass:++
millerti has joined #ruby
<tvb> so im not sure how many kudos I have left but I am on a roll now :) and my next question is I have two files. One with a class definition and one where I want to call the class en do something with output
yeticry has quit [Ping timeout: 252 seconds]
Meeh_ is now known as Meeh
<tvb> assume the one with the output is called output.rb and the one with the class is called class.rb. Then I would require 'class' in output.rb, right?
nfk has joined #ruby
<jhass> DefV: you're welcome, I guess
<jhass> tvb: well, that's how it should be but you have to setup $LOAD_PATH in order to work with require (instead of require_relative)
<tvb> hmm
<tvb> i guess it needs to load relatively
<tvb> yeah
<jhass> $LOAD_PATH is the list of directories require searches through
<tvb> works better :)
diegoviola has joined #ruby
<jhass> the require 'bundler/setup' for example adds all the directories of the gems specified in your Gemfile and removes everything else
aryaching has quit [Ping timeout: 264 seconds]
oo_ has quit [Remote host closed the connection]
<jhass> hence you couldn't load ipaddress earlier
<tvb> right!
<tvb> bah
<jhass> so a common thing to do is to setup $LOAD_PATH (it's just an Array), at the entry point of your application
<tvb> rubocop: 5 files inspected, 51 offenses detected
<tvb> here we go again
<jhass> or if you're writing a Gem that's basically done for you
fantazo has quit [Quit: Verlassend]
revath has quit [Quit: Leaving.]
revath has joined #ruby
axsuul has quit [Ping timeout: 264 seconds]
DEA7TH_ has quit [Quit: DEA7TH_]
dfockler has joined #ruby
ldnunes has joined #ruby
yeticry has joined #ruby
platzhirsch has joined #ruby
<tvb> rubocop is bitching about this line
<tvb> being to long
<tvb> def generate_resources(num_instances = 1, instance_type = 't2.small', cidr_ip = '127.0.0.1')
shredding has quit [Ping timeout: 264 seconds]
<tvb> how can I 'shrink' that line without removing the logic of the variable naming?
<tvb> put it on the next line with a \?
<ljarvis> no need for the \
<ljarvis> just add a new line after one of the commas
<Darkwater> yeah, there's commas
<tvb> cool, that works
<Darkwater> so it won't be ambiguous, so you won't need backslashes
stef204 has joined #ruby
Rickmasta has joined #ruby
blackmesa has quit [Ping timeout: 265 seconds]
dfockler has quit [Ping timeout: 255 seconds]
SOLDIERz has quit [Ping timeout: 246 seconds]
vondruch has quit [Quit: Ex-Chat]
ramfjord has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jeanlinux has joined #ruby
<DefV> jhass: that may have been a bit random, but I just read through the GH issue in anger, so to me it makes sense
yfeldblum has quit [Ping timeout: 248 seconds]
<jhass> DefV ;)
<tvb> what does this mean?
<tvb> interpreted as grouped expression
el3k0n has quit [Ping timeout: 252 seconds]
yqt has quit [Ping timeout: 256 seconds]
tekacs has quit [Ping timeout: 276 seconds]
tekmaster has joined #ruby
<sevenseacat> context required
ramfjord has quit [Ping timeout: 244 seconds]
tekmaster is now known as tekacs
sandstrom has joined #ruby
<tvb> expect(result['InstanceSecurityGroup']['Properties'] \
<tvb> ['SecurityGroupIngress'][0]['CidrIp']).to eq ('127.0.0.1/32')
JohnBat26 has joined #ruby
blackmesa has joined #ruby
<tvb> well, pasted the wrong line but the other one is simulair
<sevenseacat> thats a hell of a nested hash
<tvb> rspec/instance_spec.rb:22:68: W: (...) interpreted as grouped expression.
<tvb> expect(result['EC2Instance']['Properties']['InstanceType']).to eq ('t2.small')
senayar has quit [Remote host closed the connection]
<Ox0dea> tvb: Put the opening parentheses right next to the method name.
<sevenseacat> aye.
jeramyRR has joined #ruby
serivich has joined #ruby
<sevenseacat> remove the space between eq and (
mnemon2 has joined #ruby
<tvb> ah right
<tvb> thanks
vondruch has joined #ruby
Siyfion has quit [Quit: Textual IRC Client: www.textualapp.com]
<tvb> funny
dumdedum has quit [Quit: foo]
<tvb> spec/spec_helper.rb:45:1: C: Do not use block comments.
<tvb> =begin
<tvb> its bitching about an automated generated file
<adaedra> =end
ta has joined #ruby
spectra_ has joined #ruby
<adaedra> (sorry, this unclosed comment disturbed me)
spectra has quit [*.net *.split]
zack6849 has quit [*.net *.split]
mnemon has quit [*.net *.split]
alem0lars has quit [*.net *.split]
silverdust has quit [*.net *.split]
<TheBrayn> ok (
<Darkwater> lo
<adaedra> argh )
<sevenseacat> lol
<tvb> adaedra: huh?
alem0lars has joined #ruby
<TheBrayn> <%-
silverdust has joined #ruby
<adaedra> tvb: don't worry, just me being silly
<adaedra> TheBrayn: you want me to die? :<
<tvb> adaedra: there is an =end
silverdust is now known as Guest77924
<tvb> in spec_helper
<adaedra> :|
<sevenseacat> whoosh
<Darkwater> doesn't this apostrophe annoy you as well?
<adaedra> Darkwater: no, apostrophes are ok.
<Darkwater> ok '
<yorickpeterse> '
<adaedra> '_'
<Darkwater> %w
Musashi007 has quit [Quit: Musashi007]
serivich has quit [Ping timeout: 246 seconds]
iamninja has joined #ruby
zack6849 has joined #ruby
zack6849 has quit [Changing host]
zack6849 has joined #ruby
senayar has joined #ruby
GitGod is now known as GitGud
emilkarl has joined #ruby
revath has quit [Ping timeout: 252 seconds]
<tvb> bnagy: you know earlier we talk about instance_type should be a string?
<tvb> we came up with checking for allowed types
<tvb> now I run a test with instance_type = '' and it fails
DEA7TH_ has joined #ruby
<tvb> because we are not checking it for being an empty string
mister_solo has quit [Ping timeout: 250 seconds]
<tvb> guess I have to implement variable.nil? || variable.empty?
<Ox0dea> tvb: Object#nil? is already a thing, as is String#empty?.
<tvb> 'thing'?
<Ox0dea> You don't need to implement them; they are already there.
<tvb> hmm so now what?
serivich has joined #ruby
<Ox0dea> Whatever you were gonna do after implementing them, I suppose.
<tvb> i mean with implement, put them in my code
<tvb> and check for it
<Ox0dea> You should learn Ruby. ^_^
Papierkorb has joined #ruby
<tvb> I am trying :
<tvb> :P
<Ox0dea> >> [1.nil?, nil.nil?, 'foo'.empty?, ''.empty?]
<ruboto> Ox0dea # => [false, true, false, true] (https://eval.in/391732)
chouhoulis has joined #ruby
<tvb> first day ruby, hack first day programming besides some minor php experience
cytoskeletor has joined #ruby
lee-jon has quit [Quit: lee-jon]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
m3_del has joined #ruby
<tvb> ok lets implement an exception here is the variable is emtpy
lee-jon has joined #ruby
<Ox0dea> tvb: "Implement" is closer to "create" rather than "use".
<tvb> agreed
<tvb> lets use an exception then ;)
claw has quit [Ping timeout: 248 seconds]
claw has joined #ruby
jeanlinux has quit [Remote host closed the connection]
jeanlinux has joined #ruby
<tvb> ok so bnagy need some advise here
keen__________11 has joined #ruby
<tvb> got raise "empty!" if instance_type.nil? || instance_type.empty?
chouhoulis has quit [Ping timeout: 264 seconds]
<tvb> it is obviously raising an exception if I submit ''
ryba has joined #ruby
keen__________10 has quit [Ping timeout: 244 seconds]
fabrice31_ has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
KetaPan has joined #ruby
fabrice31_ has joined #ruby
<tvb> now i am trying to check that with rspec
<tvb> someting like
<tvb> expect(result.generate_resources.to raise_error("empty!")
m3_del has quit [Ping timeout: 264 seconds]
<Darkwater> think you forgot a )
fabrice31 has quit [Ping timeout: 246 seconds]
<tvb> hm true
<tvb> im not sure what it returning the exception here
IanV0rn2341 has quit []
<tvb> the method i suppose?
eGGsha has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 264 seconds]
revath has joined #ruby
jeanlinux has quit [Remote host closed the connection]
KetaPan has quit [Read error: Connection reset by peer]
<Ox0dea> tvb: That unfortunate miscommunication back there regarding "implement" made me sound like a total dick. Sorry about that. :/
<tvb> Ox0dea: hey no worries!
chipotle has joined #ruby
<tvb> You had valid point, got it noted :)
<Cork> Resolve.getaddresses resolves the ipv4 OR ipv6, is there a way to get all of them?
charliesome has joined #ruby
IanV0rn2341 has joined #ruby
<Cork> (and it needs to include things from the hosts file)
but3k4 has joined #ruby
sharpmachine has joined #ruby
catphish has joined #ruby
<catphish> is it possible to make initialize private to force people to use alternative initializers?
ta has quit [Remote host closed the connection]
<sevenseacat> yes
<jhass> singleton_class.private :new
mrmargolis has joined #ruby
<catphish> thanks
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tvb> can you do a describe inside a describe with rspec?
<yorickpeterse> Yes
<Darkwater> I'd use a context tho
<izzol> I don't like rspec.
<tvb> Darkwater: I am using context wrong then?
<bougyman> i don't like the way the people here use rspec.
sharpmachine has quit [Ping timeout: 265 seconds]
<Darkwater> oh wait, I'm mistaken
<Darkwater> never mind me
<bougyman> in my projects that use bacon, they add some metacrap to try and turn it into rspec.
<bougyman> and they broke the hell out of it.
<Darkwater> describe -> [context ->] it
<Darkwater> iirc
<bougyman> all I need is bacon.
centrx has quit [Ping timeout: 252 seconds]
Akagi201_ has joined #ruby
<tvb> it is erroring on missing class
<tvb> undefined method `generate_resources' for nil:NilClass
mrmargolis has quit [Ping timeout: 265 seconds]
<tvb> I assumed the before would fix that?
<Darkwater> I'm not sure
_whitelogger has joined #ruby
jeanlinux has quit [Remote host closed the connection]
<ljarvis> evaluated/captured
<ljarvis> make sense?
<tvb> somewhat
<ljarvis> which part is confusing?
<tvb> 14:38:10 <ljarvis> the method call is what raises <--
<ljarvis> tvb: the method generate_resources raises an exception if there is some bad argument, correct?
<tvb> correct
weemsledeux has quit [Read error: Connection reset by peer]
<ljarvis> calling that method is "the method call"
<ljarvis> does that sentence still confuse you?
<tvb> result = @aws.generate_resources(0, '', 2) is 'calling the method'
<ljarvis> correct, and what happens?
weemsledeux has joined #ruby
<tvb> it raises an exception
<sevenseacat> at what point of the execution
andikr has quit [Remote host closed the connection]
<sevenseacat> before, during or after you try and catch it?
<tvb> raise "empty!" if instance_type.nil? || instance_type.empty?
<tvb> during i guess?
<sevenseacat> where are you trying to catch it?
<tvb> after?
<sevenseacat> which line of code is trying to catch it
<ljarvis> show us in the code
<tvb> ok let me gist it again, sorry guys
<ljarvis> right, but where are you trying to *catch* it
<sevenseacat> thats irrelevant to the test
<tvb> ljarvis: I guess i am not
<ljarvis> so you're not testing it?
<tvb> that is probably the part I missed..
konsolebox has joined #ruby
<tvb> Ok so my understanding is
<tvb> that it tests if the method being called is raising the error "emtpy".
<sevenseacat> you're not caling a methof there
<sevenseacat> method
<sevenseacat> you just have a variable - `result`
<tvb> I did here
<sevenseacat> which is outside the testing line
<tvb> aha
<sevenseacat> the point of using { } there is to define a block, so the before and after can be tested
<sevenseacat> and compared
tkuchiki has joined #ruby
<sevenseacat> before - no exception. after - exception.
freerobby has joined #ruby
<sevenseacat> if thats true, then the assertion passes
<sevenseacat> *before calling the block, after calling the block
<tvb> hmm need some example to visualize what you are talking about
chipotle has quit [Quit: cheerio]
tkuchiki has quit [Remote host closed the connection]
<sevenseacat> you have it right there in the code you're looking at
<sevenseacat> the code you wrote
jeanlinux has joined #ruby
<sevenseacat> in simpler form, expect { raise "Error!" } to raise_error
<sevenseacat> calling the block is what raises the error
<sevenseacat> so the assertion passes
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis> ^ good example
langlands has joined #ruby
<tvb> expect { raise "Error!" } to raise_error("Error!") does make sense
<ljarvis> great
<sevenseacat> \o/
<sevenseacat> so now you can put what you actually expect to raise the error, inside that block
<tvb> @aws.generate_resources is raising the error
<ljarvis> yes!
<sevenseacat> double \o/
<ljarvis> so where does it go?
<sevenseacat> we're getting there
senayar has quit [Remote host closed the connection]
<ljarvis> charliesome: does eval-in have a public api?
<tvb> well I would put it inside the block
<charliesome> ljarvis: sorta
<charliesome> ljarvis: you can POST to / passing the same params that the form on the homepage passes
<charliesome> and then GET /:id.json
langland_ has quit [Ping timeout: 255 seconds]
<ljarvis> charliesome: ah ok, wanted to check before I did that in case it was considered a dick move
<charliesome> as long as you set a meaningful User-Agent, it's fine by me :)
<ljarvis> nice one, ta
<yorickpeterse> is the API webscale?
<yorickpeterse> I heard Docker is the future, you should use that
<ljarvis> is it build in slash?
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yorickpeterse> and React native
senayar has joined #ruby
<yorickpeterse> it's also the future
<ljarvis> heh
<yorickpeterse> According to some wise person on HackerNews you should bet on it
dgutierrez1287 has joined #ruby
<ljarvis> i'll bet my lifes earnings
<yorickpeterse> so I did, I pulled all my money from the bank and invested it in Facebook
<yorickpeterse> so I know React is going to be big
<ljarvis> good call, especially with nucleus or whatever its called
<tvb> sevenseacat: I have the feeling I missed something while you educated me
<sevenseacat> uh oh.
<tvb> tried to put @aws.generate_resources inside the { } as that is the method raising the error
<sevenseacat> ok
<tvb> but is not evaluating it, so it seems
ahmetkapikiran has quit [Quit: ahmetkapikiran]
<sevenseacat> tvb: your error is?
<tvb> Failure/Error: result = @aws.generate_resources(0, '', 2)
<tvb> RuntimeError:
<tvb> empty!
<sevenseacat> because thats before the block
<tvb> hmmm
avdi has quit []
jeregrine has quit []
avdi has joined #ruby
<sevenseacat> I am unsure of what your tests are trying to achieve
<tvb> so "result = @aws.generate_resources(0, '', 2)" is actually raising the error
<tvb> before the expect has ran
<sevenseacat> because if you raise an exception, everything else is pretty much meaningless
jeregrine has joined #ruby
<ljarvis> ^
<sevenseacat> return values and whatnot
<ljarvis> you shouldn't care about the return value
<ljarvis> (in this case)
<Igorshp> Hi guys. I have a ruby program that changes the logger format based on $stdout.tty variable. is there a way to manualy force it to true?
<Igorshp> from outside of that program
eGGsha has quit [Quit: Textual IRC Client: www.textualapp.com]
DEA7TH_ has quit [Quit: DEA7TH_]
<tvb> well, I am expecting the app to raise an error when the argument is ''. That is what I wanted to test.
<tvb> perhaps its a silly test
<ljarvis> it is, but that's besides the point
<tvb> oh and because it is throwing an error
<tvb> the test suite is failing
otisZart has joined #ruby
<ljarvis> if only test suits passed when there are errors being thrown ;)
<tvb> which is kind of expected because that is what a exception is for, but unwanted ofcourse
dgutierr_ has joined #ruby
thelastinuit has joined #ruby
<izzol> ehh, I'm trying to parse an e-mail in Go and it's sounds like mission impossible (so far). In ruby it takes me 5 min :(
JoshL has joined #ruby
<ljarvis> izzol: yes I can see your dispair in the go channel
<ljarvis> despair*
dgutierrez1287 has quit [Ping timeout: 248 seconds]
<yorickpeterse> How dare you criticize Go, the glorious language from dear leader Rob Pike
jeanlinux has quit [Remote host closed the connection]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
m3_del has joined #ruby
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sevenseacat> glorious leader?
<yorickpeterse> Sorry
<diegoviola> Rob Pike? Plan 9 didn't seem to have taken off
<yorickpeterse> I meant "glorious dear leader"
<yorickpeterse> oh wait
<yorickpeterse> I already typed that
<yorickpeterse> derp
jeramyRR has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yorickpeterse> diegoviola: ssssshhh
<yorickpeterse> Plan 9 is the future
<diegoviola> where is his plan 9 used?
<diegoviola> on 10 computers?
<yorickpeterse> In the future
jeramyRR has joined #ruby
<izzol> :)
DEA7TH_ has joined #ruby
dgutierr_ has quit [Remote host closed the connection]
<Ox0dea> We have Rob Pike to praise/blame for UTF-8.
m3_del has quit [Ping timeout: 252 seconds]
rippa has joined #ruby
<ljarvis> ?ot
<ruboto> this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<maloik> :D
<lee-jon> :D
<Ox0dea> >> Encoding::UTF_8
<ruboto> Ox0dea # => #<Encoding:UTF-8> (https://eval.in/391798)
<lee-jon> Although UTF-8 could be considered a Ruby related problem :|
freerobby has quit [Quit: Leaving.]
JoshL has quit []
<maloik> I wouldn't say that, my terminal/irssi breaks quite hard when people use funky characters
lnx_ is now known as lnx
<Ox0dea> maloik: On whom do you put the blame for that, exactly?
<lee-jon> ▤
bjeanes has quit []
jenrzzz has joined #ruby
<maloik> myself and myself alone
bjeanes has joined #ruby
<Darkwater> <insert BEL here>
<jhass> nah we're +c here
<maloik> well, and the colleague that set up this server
<maloik> :D
dblessing has joined #ruby
<DefV> maloik: encoding is 100% client setting ;-)
bruno- has quit [Ping timeout: 246 seconds]
<DefV> unless your server doesn't have an UTF-8 encoding configured but I know that server and it does ;-)
<maloik> it's not the default though I believe
<jhass> luckily it is for most clients these days
<lee-jon> What’s not default?
<maloik> was mostly kidding though, I'm just too lazy to figure this out
<maloik> it doesn't really bother me THAT much
Geet has joined #ruby
featheryahn_ has quit []
featheryahn_ has joined #ruby
MasterPiece has joined #ruby
<jhass> maloik: join #ruby-offtopic and play a round of hangman with us then!
<Geet> whats the best way to learn ruby?
charliesome has quit [Quit: zzz]
<adaedra> I'm thinking about parsing xml, what to use?
<jhass> Geet: solve a problem you have with it
<adaedra> (I know there are some people expert on that in here)
acke has joined #ruby
<Geet> cheers
<Ox0dea> adaedra: Oga.
apofis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Geet> i'll give it a go
<jhass> adaedra: oga and yell at yorickpeterse if it doesn't work
jenrzzz has quit [Ping timeout: 256 seconds]
<adaedra> Did you mean: omega ruby
<adaedra> Google, google, google.
brettnem has quit [Quit: brettnem]
hellschreiber has quit []
Geet has quit [Client Quit]
alxndr has quit []
alxndr has joined #ruby
<Darkwater> Developers, developers, developers, developers.
chouhoulis has joined #ruby
<adaedra> jhass: I'll see what I can do for the second part. :)
hellschreiber has joined #ruby
tkuchiki has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<tvb> ljarvis: I am having an issue with ipaddress
sharpmachine has joined #ruby
<tvb> when submitting 2 the p of cidr_ip is "2"
<tvb> and the above code is responding as true (eg the ip address "2" is valid)
chouhoulis has quit [Ping timeout: 246 seconds]
tkuchiki has joined #ruby
abuzze has quit [Remote host closed the connection]
<tvb> even p = IPAddress.valid? "2" is returning true
<tvb> weird
_blizzy_ has quit [Ping timeout: 265 seconds]
tkuchiki has quit [Remote host closed the connection]
<Ox0dea> Well, it is a valid IP address; it's just another represenation of 0.0.0.2.
<jhass> well, I guess if you dig through the RFCs it actually is
sharpmachine has quit [Ping timeout: 244 seconds]
<tvb> Ox0dea: why is it complaining with the following then?
<tvb> `initialize': Invalid IP "2"
<tvb> iprange = IPAddress::IPv4.new cidr_ip
mister_solo has joined #ruby
<yorickpeterse> adaedra: No, https://github.com/yorickpeterse/oga
<yorickpeterse> omega Ruby, heh
<jhass> mmh, I wonder if it's a valid v6 but not a valid v4
blueOxigen has quit []
<jhass> yup, that seems to be it
<adaedra> yorickpeterse: :)
<jhass> tvb: IPAddress.valid_ipv4? "2" #=> false
<tvb> undefined method `valid_ipv4' for IPAddress:Module
whippythellama has joined #ruby
<jhass> the ? is part of the method name
OrbitalKitten has joined #ruby
JoshL has joined #ruby
otisZart has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mister_solo has quit [Ping timeout: 246 seconds]
nettoweb has joined #ruby
<tvb> damn im getting done here
<tvb> its time to wrap up and leave the ruby school :)
scripore has joined #ruby
apofis has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
krz has quit [Read error: Connection reset by peer]
revath has quit [Ping timeout: 246 seconds]
lessless has joined #ruby
Indian has joined #ruby
enebo has joined #ruby
Muhannad has joined #ruby
mister_solo has joined #ruby
apofis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
emilkarl has quit [Quit: emilkarl]
erts has joined #ruby
<adaedra> You can't
<adaedra> Once you go into ruby, you don't leave it
<adaedra> Of ever
<Darkwater> once you go ruby, you never go back
<diegoviola> once you go Ruby you learn how to write code, unlike PHP
mrmargolis has joined #ruby
millerti has joined #ruby
<catphish> tvb: what is this IPAddress class? it's not part of ruby is it?
<diegoviola> Sorry about that
<tvb> ipaddress gem
<catphish> i normally just use IPAddr
<tvb> catphish: yeah, but it was recommended earlier by ljarvis and it works so :)
<catphish> or does it ;)
<catphish> i don't believe "2" is a valid IP
<catphish> though 2 could be
GeorgesLeYeti has quit [Quit: Quitte]
<adaedra> I think it isn't
millerti has quit [Client Quit]
<tvb> I think p is putting it in quotes
<Darkwater> 2 isn't
<Darkwater> 2.2 is
<catphish> 2 is (it's an integer representing 0.0.0.2)
<adaedra> ::2 and 2:: also
<catphish> "2" is not
<tvb> having some issues with no implicit conversion of Fixnum into String
<catphish> 2.2 is - if you believe in pre-classful IP addresses :)
<tvb> iprange = IPAddress::IPv4.new cidr_ip
<Darkwater> 2.2 represents 2.0.0.2
<tvb> where cidr_ip = 2
<catphish> tvb: don't pass an integer to it
<tvb> trying to find out how to convert it correctly
tvw has quit [Read error: Connection reset by peer]
<catphish> tvb: well what data do you have, why 2?
<diegoviola> writing code with python makes me angry for some reason
<tvb> well I picked 2 as a test to run against the check for valid ip address
<Darkwater> running code with python makes me angry
<catphish> it's expecting a string, so if you have an integer, you've done something wrong i'd guess
<Darkwater> because often people use a shebang with /usr/bin/python
<diegoviola> I feel I have to be very strict/explicit with python for some reason
<Darkwater> which resolves to python 3 for me, but those scripts often need 2
emilkarl has joined #ruby
<catphish> tvb: to be clear, it's expecting a string, if you're passing 2 to it (an integer) then don't
atom3 has quit [Ping timeout: 276 seconds]
cnngimenez has joined #ruby
<tvb> catphish: I understand
<tvb> so I have to check if it is a string or not, and if not convert it?
<catphish> tvb: where is the data coming from?
<tvb> rspec
<Darkwater> just to input.to_s
<jhass> catphish: 2 does appear to be a valid IPv6 (and is another notation of 2::)
<Darkwater> >> "string".to_s
<ruboto> Darkwater # => "string" (https://eval.in/391870)
<Darkwater> >> 5.to_s
<ruboto> Darkwater # => "5" (https://eval.in/391871)
<catphish> tvb: don't put integers in your rspec then
tagrudev has quit [Remote host closed the connection]
<tvb> catphish: but that is something in the real world could happen als the same arguement used in rspec is an option in option parser
atom3 has joined #ruby
<tvb> so one could enter just 2
<catphish> in the real world, if someone passes it an integer it *should* throw an error
<tvb> however, i noticed option parser converts it to a string already
<tvb> no implicit conversion of Fixnum into String
<catphish> that error means its expecting a string, but received an integer, and they're not sufficiently alike to automatically convert
hinbody has joined #ruby
msnyon has joined #ruby
<tvb> catphish: I understand
<izzol> tvb: try with .to_s
<catphish> the error is perfectly correct and means there's a bug elsewhere in the code causing it to receive an integer
<tvb> izzol: nah I just changed the rspec to be a string
<catphish> IMO blindly converting data types to strings is the wrong solution
<tvb> it does not make sense to test against an int as there wont be any int never
<catphish> the correct solution is to raise an error if a programmer ever passes it an integer
<izzol> you never know
CamonZ has joined #ruby
<Darkwater> what if yuo change the options parser to one that does automatically convert "2" to 2
<catphish> tvb: the user input should always be a string anyway
<tvb> Darkwater: then Im screwed
<tvb> :D
<Darkwater> :shrug:
<tvb> Ok last question for today
<tvb> got the rspec as the following now
<tvb> describe -> context -> it
<izzol> ehh, I cannot work because of that weather :<
devdazed has joined #ruby
<tvb> now do I need to 'define' the it as well?
<tvb> as in describe it
<catphish> i don't know much about rspec i'm afraid
<sevenseacat> the it block is always the inner-most rspec construction
<sevenseacat> that defines the test iself
<tvb> I guess I don't
<tvb> it do works fine
<tvb> sevenseacat: and not the context?
<sevenseacat> I might have misunderstood the question because it didnt make a lot of sense
<tvb> sevenseacat: heh wait
<sevenseacat> yes, ive seen that code a lot now
<tvb> "with correct arguments" -> it
<tvb> do I need to describe the it as well?
<sevenseacat> as you said, it works without it
<tvb> it does
intinig has quit [Remote host closed the connection]
<sevenseacat> that answers your question
<tvb> but what is best practice here?
sharpmachine has joined #ruby
intinig has joined #ruby
<tvb> run every expect in its own it and describe in the it what it tests?
<sevenseacat> to delete most of that spec and rewrite it
<izzol> As I remember you can do is like: it 'bla bla bla' do (...)
<tvb> sevenseacat: hah!
<sevenseacat> one assertion per test, better descriptions
<tvb> sevenseacat: check
<sevenseacat> your error and success messages are all going to be meaningless
anarang has quit [Quit: Leaving]
fabrice31_ has quit [Remote host closed the connection]
gamename has joined #ruby
unshadow_ has quit [Quit: leaving]
fabrice31 has joined #ruby
fabrice31 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
fabrice31 has quit [Remote host closed the connection]
kobain has joined #ruby
fabrice31 has joined #ruby
m3_del has joined #ruby
dopie has joined #ruby
kraljev11 has joined #ruby
BTRE has quit [Ping timeout: 256 seconds]
intinig has quit [Ping timeout: 256 seconds]
otisZart has joined #ruby
nfk has quit [Quit: yawn]
<tvb> writing good tests is hard
riotjones has quit [Remote host closed the connection]
bruno- has joined #ruby
m3_del has quit [Ping timeout: 265 seconds]
<sevenseacat> just takes a lot of practice.
DoubleMalt has joined #ruby
terlar has quit [Quit: WeeChat 1.2]
thiagovsk has joined #ruby
<izzol> tvb: try with minitest. Rspec is not so easy.
acke has quit [Remote host closed the connection]
<tvb> izzol: I have to work with rspec this time, thanks
rawtext has joined #ruby
OrbitalKitten has quit [Read error: Connection reset by peer]
dagda1 has joined #ruby
brain_shim has joined #ruby
OrbitalKitten has joined #ruby
jpfuentes2 has joined #ruby
Rollabunna has joined #ruby
_blizzy_ has joined #ruby
Exuma has joined #ruby
revath has joined #ruby
i8igmac has joined #ruby
rawtext has quit [Client Quit]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fabrice31 has quit [Remote host closed the connection]
Exuma has quit [Client Quit]
fabrice31 has joined #ruby
chouhoulis has joined #ruby
BTRE has joined #ruby
brettnem has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
sluukkonen has quit [Ping timeout: 264 seconds]
_blizzy_ has joined #ruby
gambl0re has quit [Ping timeout: 246 seconds]
chouhoulis has quit [Ping timeout: 252 seconds]
mary5030 has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
Muhannad has quit [Remote host closed the connection]
psyprus has quit [Changing host]
psyprus has joined #ruby
senayar has quit [Remote host closed the connection]
diegoviola has quit [Ping timeout: 246 seconds]
Muhannad has joined #ruby
k3asd` has quit [Ping timeout: 265 seconds]
decoponio has joined #ruby
Baprath has joined #ruby
davedev24_ has joined #ruby
lavros has joined #ruby
izzol has quit [Ping timeout: 246 seconds]
izzol has joined #ruby
diegoviola has joined #ruby
<Darkwater> wait, you don't need parentheses around arguments when defining a function?
<adaedra> no
<adaedra> some people like it without, some people with
<Darkwater> I've never seen anyone use it without
<Darkwater> I think it's ugly with
mrmargolis has quit [Remote host closed the connection]
<ljarvis> no it's ugly without :)
<adaedra> I think it's ugly without
<Darkwater> thought they were necessary
AlexRussia has quit [Quit: WeeChat 1.3-dev]
<ljarvis> Darkwater: most of mechanize/nokogiri is built without parens.. some people just like the style
sharpmachine has quit [Remote host closed the connection]
sepp2k has joined #ruby
AlexRussia has joined #ruby
diegoviola has quit [Changing host]
diegoviola has joined #ruby
mary5030 has quit [Remote host closed the connection]
arturmartins has joined #ruby
senayar has joined #ruby
i8igmac has quit [Ping timeout: 244 seconds]
<yorickpeterse> I heard there are also people that use "then" in if statements
headius has joined #ruby
Exuma has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<ljarvis> yeah also lots of those in mechanize
<ljarvis> drbrain loves a then
<yorickpeterse> I really don't get why
eGGsha has joined #ruby
<yorickpeterse> They add exactly nothing
Baprath has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0/20150511103725]]
diegoviola has quit [Remote host closed the connection]
iamninja has quit [Ping timeout: 264 seconds]
sharpmachine has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
<eam> next you're going to hate on the semicolon
<adaedra> def foo;
<adaedra> puts "bar";
<adaedra> ...
cpruitt has joined #ruby
n008f4g_ has quit [Ping timeout: 265 seconds]
sluukkonen has joined #ruby
kies^ has joined #ruby
<maloik> I still think we should switch to a tab and 3 spaces for indentation
<workmad3> maloik: we should switch to a space and a >
<yorickpeterse> I think the first step is to must make "then" a syntax error
<workmad3> > > >indented 3 times
<maloik> nice!
<yorickpeterse> but I think it's more likely for me to get married tomorrow than for parse.y to ever be cleaned up
<maloik> much more obvious
<maloik> yorickpeterse: mail order bride!
<apeiros> I think we should be more avant-garde than that
skade has joined #ruby
<apeiros> we should use ; for indentation
<maloik> (or groom, if that is your thing)
<eam> yorickpeterse: probably easier for you to get married
senayar has quit [Read error: Connection reset by peer]
<workmad3> ooh, how about
dopie has quit [Quit: This computer has gone to sleep]
<adaedra> oooh, how about DON'T
<yorickpeterse> eam: yeah, I'm at least not made out of 11000 lines of wtf
<workmad3> adaedra: hmm... it would look a bit odd multiple times at the start of a line
<eam> and that's not counting the regex parser
<workmad3> DON'TDON'TDON'T some indent...
<ljarvis> obviously we should use back to back parenthesis. ()def foo;()()bar -- it would be a syntax error if one wasn't closed so we can ensure at the very least, the number of parens are always even
darkf has quit [Quit: Leaving]
<eam> ljarvis: hm, this guarantees an even number of indent characters, I like it
sharpmachine has quit [Read error: Connection reset by peer]
<adaedra> You're all horrible
<adaedra> Is it the heat that affects you?
skade has quit [Client Quit]
<ljarvis> I should propose it, shouldn't be hard to add to parse.y
senayar has joined #ruby
Exuma has quit []
<workmad3> adaedra: no, we're like this anyway :P
<yorickpeterse> sounds like somebody wants to cut their wrist
<yorickpeterse> should we call the police?
<ljarvis> the parse.y police
<ljarvis> that thing really should be policed
<eam> rubocop
adambeynon has quit []
<adaedra> I can't cut my wrist, it melted
adambeynon has joined #ruby
emilkarl has quit [Quit: emilkarl]
jaygen has joined #ruby
<yorickpeterse> OFFENCE DETECTED: NO WHITESPACE BEFORE CLOSING }
<yorickpeterse> OFFENCE DETECTED: CODE DOES NOT FOLLOW GUIDELINES SET BY SOME RUBY DEV [10.000 instances]
<yorickpeterse> ^ rubocop
<yorickpeterse> I also really don't get why it suggests "fail" over "raise"
sharpmachine has joined #ruby
<yorickpeterse> it's literally just a meaningless alias
<yorickpeterse> and you don't fail errors, you raise them
* yorickpeterse shakes cane
acke has joined #ruby
<ljarvis> Success! http://jarvo.io/s/3oZq0A.png
phutchins1 has joined #ruby
<workmad3> ljarvis: SO PRETTY!!!!
<adaedra> D:
<yorickpeterse> wtf
jaygen_ has quit [Ping timeout: 276 seconds]
<yorickpeterse> oh, that's already valid syntax IIRC
<adaedra> >>()puts "Hello"
<ruboto> adaedra # => /tmp/execpad-290f947aa5c4/source-290f947aa5c4:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/391907)
<yorickpeterse> oh hm it's not
<yorickpeterse> interesting
<yorickpeterse> ljarvis: you monster
rawtext has joined #ruby
<ljarvis> in other news, I forgot how to record the number of times a character occurs in vim and use that are a replacement
<ljarvis> s/are/as/
* yorickpeterse just fucked up stuff in Pry, so hence he thought it would work
otisZart has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yorickpeterse> ljarvis: also how on earth can you stare at this font all day?
<yorickpeterse> the aliasing is all over the place
<ljarvis> :O
<ljarvis> SACRILIDGE
<ljarvis> or that word spelt properly
<yorickpeterse> monospaced, unaliased fonts fo lyfe
<ljarvis> my font is fucking delicious
<ljarvis> it's monospaced, just aliased
<adaedra> what?
<Ox0dea> yorickpeterse: Tamsyn?
<sevenseacat> sacrilege
<ljarvis> ty
<adaedra> you don't code in Comic-Sans?
<ljarvis> Bitsream Vera Sans Mono
<ljarvis> that is my jam
<ljarvis> dun like
<ljarvis> never got on with old ass monospaced thing tiny noob fonts
<workmad3> yorickpeterse: that font makes small children cry :(
<ljarvis> !
<ljarvis> workmad3: <3
<yorickpeterse> Good thing I'm not a small child
sevenseacat has quit [Quit: Me dun like you no more.]
<adaedra> you made sevenseacat leave! D:
<ljarvis> hmm
<yorickpeterse> adaedra: they left in awe
<ljarvis> of my screenshot prolly
phizzbuzz has joined #ruby
symm- has joined #ruby
<darix> yorickpeterse: stop breaking things!
Papierkorb_ has joined #ruby
<adaedra> we all know monofur is best programming font
<yorickpeterse> Hobo Std
<yorickpeterse> or just use Times New ROman
<yorickpeterse> works everywhere
* adaedra shoots yorickpeterse
<yorickpeterse> :<
<ljarvis> na that one can't do lower case o's
olistik has quit []
<yorickpeterse> where's the police brutality now?
<adaedra> fun fact
<yorickpeterse> normally it's all "OOOH THAT'S OFFTOPIC" and now it's all ok
<adaedra> in french, "font" is « police »
<ljarvis> ?ot
<ruboto> this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
DoubleMalt has quit [Remote host closed the connection]
ramfjord has joined #ruby
<apeiros> /kick yorickpeterse here's the power tripping psycho cop police brutality - happy? :D
<adaedra> The ?ot, aka ?STOPFUNNOW
bayed has quit [Quit: Connection closed for inactivity]
m3_del has joined #ruby
acke has quit [Remote host closed the connection]
<Ox0dea> >> (___=->_,__=''{__=_[$.]+__;_[$.+=$$/$$]?___[_,__]:__})['?gnirts a esrever ot yaw tseb eht siht sI']
<ruboto> Ox0dea # => "Is this the best way to reverse a string?" (https://eval.in/391917)
mburns has quit [Ping timeout: 256 seconds]
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Darkwater> yes
<Ox0dea> I thought so.
riotjones has joined #ruby
<Darkwater> clever use of $.
<Darkwater> and $$/$$
Igorshp_ has joined #ruby
gamename has quit []
m3_del has quit [Ping timeout: 244 seconds]
Aztec_ has joined #ruby
Igorshp has quit [Read error: Connection reset by peer]
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Aztec_> I have an array of objects with a "start" date property that is sorted asc. by that property
thoraxe has joined #ruby
xcesariox has joined #ruby
<Aztec_> I want to move all elements with a start-date smaller than Time.now to be moved to the back. can i do this in-place or should i use a new array for the sorted objects?
<thoraxe> if I have a Gemfile that specifies only one source, why would "bundle install" go to rubygems.org if that is not the source specified?
<Ox0dea> Aztec_: array.rotate(array.index { |o| o.start < Time.now })
<Ox0dea> Or something along those lines.
<Ox0dea> Also #rotate!.
Igorshp_ has quit [Read error: No route to host]
<Aztec_> oh wow, i knew there had to be a more elegant solution than iterating and inserting at the back ^^thx, Ox0dea
<Ox0dea> Sure thing.
<Ox0dea> In hindsight, you'll want to flip the comparison as well.
riotjones has quit [Ping timeout: 252 seconds]
gambl0re has joined #ruby
<adaedra> Ox0dea: r,w = Array.new(2) { IO.pipe }; fork do r[0].close; w[1].close; STDOUT.reopen(r[1]); STDIN.reopen(w[0]); exec 'rev' end; w[0].close; r[1].close; w[1].write "?siht tuoba woH"; w[1].close; r[0].read
blue_deref has joined #ruby
<Ox0dea> Shelling out cannot possibly be the best way to reverse a string in Ruby.
<adaedra> awww.
<Aztec_> so Ox0dea I assume this approaches it from the opposite direction, by moving all future events to the front
<ljarvis> seems inconclusive
a346 has joined #ruby
bullcitydev has joined #ruby
nettoweb has joined #ruby
iamjoe has joined #ruby
solars has quit [Ping timeout: 246 seconds]
<Darkwater> Ox0dea: finally understand it know
<Ox0dea> Aztec_: It finds the index of the first future event and rotates the array to the left that many times.
<Darkwater> took long lol
<Ox0dea> Darkwater: Really?
<Darkwater> the obfuscated code? yeah
<Darkwater> note that I had to figure out lambdas as well
<Darkwater> since I have like 0 experience with them
senayar has quit [Remote host closed the connection]
sharpmachine has quit [Ping timeout: 250 seconds]
<Ox0dea> >> foo = [1, 2, 3, 4, 5, 6]; foo.rotate(foo.index { |e| e > 3 })
<ruboto> Ox0dea # => [4, 5, 6, 1, 2, 3] (https://eval.in/391919)
<Ox0dea> Aztec_: ^ Replace the 3 with Time.now and everything ought to fall into place.
joneshf-laptop has quit [Ping timeout: 256 seconds]
<Aztec_> yea i didn't get #rotate until now
joneshf-laptop has joined #ruby
<Aztec_> but i'm getting nil from #index...pretty sure it's just a detail though
pizzaops has quit []
pizzaops has joined #ruby
xcesariox has quit [Ping timeout: 256 seconds]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
dopie has joined #ruby
sharpmachine has joined #ruby
<ccooke> Aztec_: I must admit, in a similar problem (a set of metrics for a monitoring system), I always simply use sort_by and resort the metric set each time.
kies^ has quit [Ping timeout: 265 seconds]
<ccooke> However, that's also because the metrics after being processed need to be reinserted at effectively random points.
<ccooke> A b-tree would be more efficient, but for the datasets I'm using it's not necessary
<ccooke> (and sort_by is much easier to read)
<Aztec_> i'm dealing with, at most, 30 items so a b-tree would be overkill
<ccooke> yeah. sort_by is a perfectly reasonable solution, and it's clearer to read what's going on
<Aztec_> but is there a way to use sort_by in the way i want to use it? having a delimiter, with the values smaller ending up behind the values larger than the delimiter?
<Ox0dea> ccooke: I think you've misinterpreted the problem Aztec_ is trying to solve.
<Aztec_> :>
<ccooke> Ox0dea: entirely possible, I just came back from a meeting :-)
<Aztec_> it's always nice to have b-trees appear in discussions though
havenwood has joined #ruby
bruno- has quit [Quit: Lost terminal]
<ccooke> ah, yes
timonv has joined #ruby
<Ox0dea> ccooke: Aztec_ wants to, essentially, join the partitions of a sorted array in the opposite order.
n1ftyn8_ has quit []
chinmay_dd has joined #ruby
n1ftyn8_ has joined #ruby
<Ox0dea> >> foo = [1,2,3,4,5,6]; foo.partition { |x| x > 3 }.reduce(:+)
<ruboto> Ox0dea # => [4, 5, 6, 1, 2, 3] (https://eval.in/391930)
bhuvanaurora has quit [Ping timeout: 250 seconds]
<Ox0dea> But using #rotate and #index is a little nicer and can be done in-place.
avril14th has quit [Remote host closed the connection]
jack_rabbit has joined #ruby
langland_ has joined #ruby
Channel6 has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
<Aztec_> test passes Ox0dea....my setup/data-prep was a mess, which is why index found nothing
langlands has quit [Ping timeout: 250 seconds]
michael_mbp has quit [Excess Flood]
alex88 has quit []
jeanlinux has joined #ruby
<Ox0dea> Aztec_: That's good, but I've got some crow to eat; #sort_by is indeed better, but you have to account for the fact that Ruby's booleans aren't comparable/ordered.
<Ox0dea> >> foo = [1,2,3,4,5,6]; foo.sort_by { |x| x > 3 ? 0 : 1 }
<ruboto> Ox0dea # => [4, 5, 6, 1, 2, 3] (https://eval.in/391934)
zzor has joined #ruby
<Ox0dea> This does rely on Ruby's preserving insertion order, but of course it does.
jeanlinux has quit [Remote host closed the connection]
michael_mbp has joined #ruby
mrmargolis has joined #ruby
cytoskeletor has joined #ruby
DEA7TH_ has quit [Quit: DEA7TH_]
<Aztec_> hm that's indeed even nicer
<shevy> you eat crows?
<Ox0dea> It reads nicer, anyhow, but I suspect #rotate moves data about less frequently.
fabrice31 has quit [Remote host closed the connection]
tvb has quit [Quit: Leaving...]
atom3 has quit [Ping timeout: 276 seconds]
atom3 has joined #ruby
apofis has joined #ruby
bruno- has joined #ruby
jeanlinux has joined #ruby
acke has joined #ruby
renderfu_ has joined #ruby
jack_rabbit has quit [Ping timeout: 276 seconds]
penzur has joined #ruby
mrmargolis has quit [Ping timeout: 256 seconds]
rdema has quit [Ping timeout: 264 seconds]
peteykun has joined #ruby
renderfu_ has quit [Ping timeout: 276 seconds]
bb010g has quit []
bb010g has joined #ruby
kraljev11 has quit [Quit: kraljev11]
wallerdev has joined #ruby
dumdedum has quit [Quit: foo]
chinmay_dd has quit [Ping timeout: 256 seconds]
GnuYawk has joined #ruby
GnuYawk has joined #ruby
serivich has quit [Ping timeout: 246 seconds]
iamjoe has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
chinmay_dd has joined #ruby
joonty has quit [Quit: joonty]
Akagi201_ has quit [Remote host closed the connection]
maZtah has quit []
Papierkorb_ has quit [Quit: Konversation terminated!]
maZtah has joined #ruby
apofis has quit [Quit: Textual IRC Client: www.textualapp.com]
fgo has quit [Ping timeout: 256 seconds]
mikecmpbll has quit [Ping timeout: 255 seconds]
MasterPiece has quit [Quit: Leaving]
sharpmachine has quit [Read error: Connection reset by peer]
TheHodge has quit [Quit: Connection closed for inactivity]
sarkyniin has joined #ruby
victortyau has joined #ruby
senayar has quit [Remote host closed the connection]
einarj has quit [Remote host closed the connection]
mandarinkin has quit [Ping timeout: 265 seconds]
senayar has joined #ruby
senayar has joined #ruby
senayar has quit [Changing host]
meph has joined #ruby
sharpmachine has joined #ruby
mandarinkin has joined #ruby
m3_del has joined #ruby
yeticry has quit [Ping timeout: 264 seconds]
lavros has quit [Ping timeout: 246 seconds]
chinmay_dd_ has joined #ruby
chinmay_dd has quit [Ping timeout: 246 seconds]
serivich has joined #ruby
penzur has quit [Read error: Connection reset by peer]
m3_del has quit [Ping timeout: 246 seconds]
scunc has joined #ruby
penzur has joined #ruby
bf4 has joined #ruby
scunc has left #ruby [#ruby]
chinmay_dd has joined #ruby
chinmay_dd_ has quit [Ping timeout: 265 seconds]
lavros has joined #ruby
shinnya has joined #ruby
penzur has quit [Client Quit]
sankaber has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
endash has joined #ruby
intyl has quit [Ping timeout: 246 seconds]
NeverDie has joined #ruby
endash has quit [Client Quit]
sbhatore has joined #ruby
mandarinkin has quit [Ping timeout: 250 seconds]
acke has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 265 seconds]
JoshL has quit []
white_bear has quit [Quit: leaving]
abuzze has joined #ruby
doertedev has quit [Quit: Lost terminal]
chinmay_dd_ has joined #ruby
findaway has joined #ruby
chinmay_dd has quit [Ping timeout: 265 seconds]
willharrison has joined #ruby
<sbhatore> Hey! This is a question regarding aes-256-gcm encryption algorithm. The function p2 works in the case of aes-256-cbc algorithm
<sbhatore> while it doesn't in case of aes-256-gcm for the similar code
<sbhatore> and gives this error: OpenSSL::Cipher::CipherError: in the decipher.final. Can someone help me with this please, on how to make the gcm encryption work. It encrypts perfectly, but gives the above error in decryption.
sharpmachine has quit [Ping timeout: 264 seconds]
bryancp has quit []
bryancp has joined #ruby
abuzze has quit [Remote host closed the connection]
arturmartins has quit [Quit: Leaving...]
senayar has quit [Ping timeout: 246 seconds]
lictor36 has quit [Read error: Connection reset by peer]
dopie has joined #ruby
deimos has quit []
chinmay_dd has joined #ruby
deimos has joined #ruby
findaway has quit [Ping timeout: 265 seconds]
pgatt has quit [Quit: Connection closed for inactivity]
stan has quit [Ping timeout: 246 seconds]
mandarinkin has joined #ruby
chinmay_dd_ has quit [Ping timeout: 265 seconds]
abuzze has joined #ruby
blackmesa has joined #ruby
Aryasam has joined #ruby
<havenwood> sbhatore: You're not setting the #auth_tag=?
<sbhatore> havenwood: Hmmm..I think I tried that. Let me try again
<havenwood> sbhatore: Err, rather saving #auth_tag and providing it to the decipher.
neanderslob has joined #ruby
sharpmachine has joined #ruby
<havenwood> sbhatore: tag = cipher.auth_tag
rdema has joined #ruby
chinmay_dd has quit [Ping timeout: 265 seconds]
n008f4g_ has joined #ruby
mburns has joined #ruby
chinmay_dd has joined #ruby
chouhoulis has joined #ruby
axl_ has quit [Quit: Leaving]
<sbhatore> havenwood: Thanks a bunch. You saved my day :) I think I did the tag think incorrectly before
<sbhatore> thing*
<havenwood> sbhatore: you're welcome!
fgo has joined #ruby
jaredrhine has joined #ruby
<shevy> \o/
<shevy> we dance the RUBY dance
elektronaut has quit [Ping timeout: 252 seconds]
<shevy> pythons can dance too... I saw it in the jungle book :)
<sweeper> you can leave python behind
Agoldfish has joined #ruby
<sweeper> you can dance if you want to
drPoggs has quit [Ping timeout: 252 seconds]
<shevy> your nick invites me to dance!
chouhoulis has quit [Ping timeout: 264 seconds]
_whitelogger has quit [Ping timeout: 252 seconds]
_whitelogger has joined #ruby
catphish has quit [Quit: Leaving]
lee-jon has quit [Quit: lee-jon]
User458764 has quit [Remote host closed the connection]
drPoggs has joined #ruby
elektronaut has joined #ruby
fgo has quit [Ping timeout: 276 seconds]
charles81 has quit []
charles81 has joined #ruby
willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bf4 has quit [Ping timeout: 248 seconds]
manveru has quit []
manveru has joined #ruby
bcavileer has quit []
bcavileer has joined #ruby
d0lph1n98 has quit [Quit: Lost terminal]
chinmay_dd_ has joined #ruby
Hounddog has quit [Remote host closed the connection]
dagda1 has quit [Read error: No route to host]
chinmay_dd_ has quit [Remote host closed the connection]
mleung has joined #ruby
mfranzwa has joined #ruby
chinmay_dd has quit [Ping timeout: 244 seconds]
speaking1ode has joined #ruby
Jackneill has joined #ruby
konsolebox has quit [Remote host closed the connection]
JimmyNeutron has joined #ruby
willharrison has joined #ruby
Channel6 has quit [Quit: Leaving]
mleung has quit [Client Quit]
jaroslav has joined #ruby
tlarevo has joined #ruby
<jaroslav> guys, can somebody please help me understand how to properly build a simple gem, with the main file "lib/foo.rb" implementing class, not module?
<jaroslav> I know it is possible, saw some examples, however I'd like to follow standard 'bundler' setup, with gem version in "lib/foo/version.rb" <- that's causing problems
Pupeno has quit [Ping timeout: 246 seconds]
<havenwood> jaroslav: class Foo; VERSION =
northfurr has joined #ruby
<apeiros> ?guys jaroslav
<ruboto> jaroslav, we're not all guys - did you mean folks, y'all, everyone?
<havenwood> jaroslav: Change that file to `class Foo` instead of `module Foo`.
sarkyniin has quit [Ping timeout: 256 seconds]
Akagi201 has joined #ruby
<jaroslav> apeiros: sorry, I guess that can be a language difference, I'm using "guys" thinking about all possible genders
davedev2_ has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
<apeiros> jaroslav: cool. but in here, not everybody feels that way, so please try to use another word (or just leave it off - your question works without it too)
<jaroslav> apeiros: ack
<apeiros> thx :)
bmurt has joined #ruby
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
abuzze has quit [Remote host closed the connection]
<shevy> jaroslav basically, all you have to do is load up all the .rb files in your gem-structured code
<shevy> so lib/foo/version is really: require 'foo/version.rb'
Aztec_ has quit [Ping timeout: 246 seconds]
<jaroslav> havenwood: I have additional problem, my class 'Foo' inherits from 'JIRA::Client'. And that's what I have in my foo.rb; But if in lib/foo/version.rb I just write: "class Foo; VERSION = ", it doesn't work as it complains 'superclass mismatch' ;)
tlarevo has quit []
<jhass> jaroslav: yap, you have to repeat it everywhere. Or reconsider making the toplevel a class
davedev24_ has quit [Ping timeout: 248 seconds]
<jhass> common alternatives are Foo::Client and such
bigkevmcd has quit [Quit: Outta here...]
cmisenas has joined #ruby
enedil has joined #ruby
<jaroslav> jhass: right... and that was what I had initially; however, I didn't like the fact that my gem name does not correspond to namespacing of my modules / classes.
<jaroslav> But maybe there's no other way
langland_ has quit [Ping timeout: 255 seconds]
mikecmpbll has joined #ruby
<jhass> what do you mean it didn't correspond?
<jaroslav> I wanted to have a gem called 'foo-client', where Foo is a module, Client is a class in it, that inherits from JIRA::Client
<jaroslav> I don't want to call the gem just 'foo'
<jhass> well, then you're even supposed to have Foo::Client
podman has joined #ruby
<jhass> oh, wait, I see what you mean
<jaroslav> jhass: yup, I have Foo::Client, but this client is a class ;)
jeanlinux has quit [Remote host closed the connection]
dfockler has joined #ruby
<jaroslav> I don't want to have a Foo::Client *module* with Foo::Client::Client class in it, that would be... weird ;)
<sbhatore> https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40#section-4.5. Does anyone know what an 'empty octet sequence' is in the 4th line of section 4.5 and how to create one ?
jeanlinux has joined #ruby
<jhass> jaroslav: mmh, I'd probably go for repeating the superclass then
drew0 has joined #ruby
rfv has quit []
<jhass> sbhatore: "", empty string, nothing
rawtext has quit [Quit: Textual IRC Client: www.textualapp.com]
rfv has joined #ruby
AlphaAtom has joined #ruby
djbender has quit []
<shevy> nothing!
cmisenas has quit [Client Quit]
djbender has joined #ruby
<sbhatore> jhass: thanks !!
Akagi201 has quit [Ping timeout: 244 seconds]
<xxneolithicxx> hello folks
The_Phoenix has joined #ruby
<havenwood> xxneolithicxx: hi
The_Phoenix has quit [Max SendQ exceeded]
<shevy> heya paleolithic!
dfockler has quit [Ping timeout: 256 seconds]
<xxneolithicxx> lol
m3_del has joined #ruby
The_Phoenix has joined #ruby
<xxneolithicxx> hi shevy bronco
<shevy> :)
IanV0rn2341 has quit []
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
The_Phoenix has quit [Max SendQ exceeded]
AlphaAtom has quit [Client Quit]
[H]unt3r has joined #ruby
<jaroslav> jhass: thanks, yeah, that's probably best option to specify the superclass in both places. I really don't like to change the namespacing.
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
brain_shim has quit [Ping timeout: 252 seconds]
The_Phoenix has quit [Max SendQ exceeded]
m3_del has quit [Ping timeout: 246 seconds]
Agoldfish378 has joined #ruby
The_Phoenix has joined #ruby
s00pcan has joined #ruby
postmodern has joined #ruby
serivich has quit [Ping timeout: 265 seconds]
bmurt has quit []
Agoldfish has quit [Ping timeout: 256 seconds]
rapha has joined #ruby
<rapha> Hi!
<rapha> With ".sort_by {|x, y| [y, x]}" (x being a string and y being an integer), how do I reverse the sorting direction of x, but not of y?
gambl0re has quit [Ping timeout: 246 seconds]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros> [y, -x]
<apeiros> or use the sorting gem: [asc(y), desc(x)]
<rapha> apeiros: tried that first ... undefined method `-@' for "ال":String
gambl0re has joined #ruby
<rapha> oh, that sounds nice!
<apeiros> oh, x being a *string*
<apeiros> I read both were integers, sorry
<rapha> yes
<apeiros> sorting gem then :)
<rapha> apeiros: do you mean the gem by the exact name of "sorting"? because that exists, but is version 0.0.2 only...
<apeiros> yes
<rapha> okay
<apeiros> I didn't receive any bug tickets. maybe I should just rerelease as 1.0 :o)
blackmesa has quit [Ping timeout: 244 seconds]
<apeiros> or take a page from passenger and release a 1.0.2
<rapha> lol
<rapha> hmm
<rapha> undefined method `asc' for main:Object
<rapha> just "require 'sorting'", correct?
s00pcan has quit [Read error: Connection reset by peer]
<apeiros> that doesn't add monkey patches
findaway has joined #ruby
msnyon_ has joined #ruby
CatMartyn has quit [Quit: Textual IRC Client: www.textualapp.com]
northfurr has quit [Quit: northfurr]
<apeiros> if you want toplevel asc/desc you need to require "sorting/convenience"
CatMartyn has joined #ruby
<apeiros> otherwise: Sorting.asc/Sorting.desc, and your toplevel remains untouched :)
<apeiros> (or Kernel, actually)
<rapha> this is a teeny, tiny script, convenience sounds good.
bruno- has joined #ruby
<apeiros> If I ever get around, I'll add refinements, so `using Sorting` works too :)
EnergyCoffee has quit [Quit: No Ping reply in 180 seconds.]
<apeiros> the readme covers most important parts: https://github.com/apeiros/sorting
bruno- has quit [Client Quit]
<jhass> apeiros: would be a good reason to 1.0 it :P
<apeiros> you can also use asc/desc to handle nils f.ex.
<apeiros> jhass: true, true
<apeiros> you mean 1.0.2 it?
<rapha> nice, best word frequency analysis script ever! :-P
<jhass> apeiros: 1.1.0. I started to use 0.1.0 as initial version^^
<rapha> apeiros: starred and watched!
bruno- has joined #ruby
bmurt has joined #ruby
CatMartyn has quit [Client Quit]
msnyon has quit [Ping timeout: 276 seconds]
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
mrmargolis has joined #ruby
bruno- is now known as Guest85019
<apeiros> rapha: top :) if you find an issue, let me know!
sharpmachine has quit [Ping timeout: 265 seconds]
iateadonut has quit [Quit: Leaving.]
Lucky___ has joined #ruby
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
findaway has quit [Ping timeout: 244 seconds]
baweaver has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
adamski2600 has quit [Remote host closed the connection]
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
iateadonut has joined #ruby
OrbitalKitten has joined #ruby
sharpmachine has joined #ruby
bmurt has quit [Client Quit]
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
skmp has quit []
Guest85019 has quit [Client Quit]
skmp has joined #ruby
mrmargolis has quit [Ping timeout: 248 seconds]
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
bruno-_ has joined #ruby
SCHAAP137 has joined #ruby
niemcu has quit [Ping timeout: 255 seconds]
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
<slash_nick> apeiros: README, might could link to the file instead of telling the path to it ({file:documentation/examples.rb})... same for LICENSE?
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
<rapha> apeiros: will do, but for my current usecase it works ... well ... like a gem :)
_blizzy_ has quit [Ping timeout: 244 seconds]
abuzze has joined #ruby
nofxx has joined #ruby
rubynuby has joined #ruby
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
brain_shim has joined #ruby
platzhirsch has quit [Remote host closed the connection]
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
mandarinkin has quit [Ping timeout: 250 seconds]
cpruitt has quit [Quit: cpruitt]
msnyon_ is now known as msnyon
EnergyCoffee has joined #ruby
EnergyCoffee has quit [Max SendQ exceeded]
abuzze has quit [Ping timeout: 248 seconds]
EnergyCoffee has joined #ruby
millerti has joined #ruby
mandarinkin has joined #ruby
<shevy> hmm
<shevy> is it common to see modifications such as: class Gtk::TextIter
jeanlinux has quit [Remote host closed the connection]
<shevy> as in, directly, rather than do; class Gtk; class TextIter # or something like that
<jhass> yeah, feels like roughly 35% do that
yqt has joined #ruby
spider-mario has joined #ruby
rubynuby has quit []
rubynuby has joined #ruby
adamski2600 has joined #ruby
Kruppe has quit [Quit: ZNC - http://znc.in]
wallerdev has quit [Quit: wallerdev]
linocisco has joined #ruby
Kruppe has joined #ruby
rubynuby has left #ruby [#ruby]
yqt has quit [Ping timeout: 246 seconds]
iateadonut has quit [Quit: Leaving.]
krz has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
mister_solo has quit [Ping timeout: 264 seconds]
<slash_nick> if you try to adhere to a limit of 80 columns per line, it saves a couple of spaces (2*Nmodules spaces)
<rapha> apeiros: if you have a minute, here's the word frequency analysis script ... it does what I want, but I'd be happy about general criticism! https://gist.github.com/sixtyfive/c03bc1bbb91a8e61b849
Salehi has joined #ruby
<Salehi> Hey guys, please vote ruby in
<Salehi> Ruby needs you! right now
<jhass> ?guys Salehi
<ruboto> Salehi, 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?
<adaedra> I'm not your guy, pal
Muhannad has quit [Ping timeout: 246 seconds]
saadq has joined #ruby
<Salehi> :D OK folks !
thelastinuit has quit [Quit: Textual IRC Client: www.textualapp.com]
<slash_nick> I'm partial to y'all
<mozzarella> there's a gender neutral "guys", look it up
dopie has joined #ruby
<shevy> adaedra is my french girl
<drew0> ruboto: That's a good point. I am guilty of using 'guys' in place of plural 'you', but I should make an effort to not. Thanks for pointing it out!
<adaedra> ?bot
<ruboto> I don't know anything about bot
<adaedra> -_-
<shevy> ?python
<ruboto> I don't know anything about python
<jhass> mozzarella: it's regionally different, hence better to avoid
<shevy> this bot needs to learn more
revath has quit [Ping timeout: 264 seconds]
linocisco has left #ruby ["Leaving"]
<adaedra> ?ruboto
<ruboto> I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
<bougyman> ?rules
<ruboto> Please respect the channel rules: http://ruby-community.com/pages/user_rules
<Salehi> jhass: ruboto, good starting point :D
<bougyman> i've never read 'em, heh.
<shevy> haha
<adaedra> :o
CatMartyn has joined #ruby
<shevy> damn
<shevy> the rules mention that you can get banned for "Trolling"
<bougyman> that could be a lot shorter if you just linked to http://www.catb.org/esr/faqs/smart-questions.html
<bougyman> a lot of DRY
jeramyRR has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy> are you saying that you don't believe in https://xkcd.com/927/ bougyman
<Salehi> Ruby is 10 and python is 20 in the voting right now! I like Ruby and I'm here to ask you folks to vote ruby in https://www.toptal.com/technology-battles/ruby-vs-python
<shevy> I voted!
<shevy> but it stayed at 11
<shevy> I mean 10
<bougyman> why are you advertising some crappy poll.
<Salehi> bougyman: Because I don't like python! and I wanna Ruby wins this voting!
<shevy> \o/
<shevy> Salehi,
mister_solo has joined #ruby
<shevy> oops
<shevy> sentence was not finished yet
bb010g has quit [Quit: Connection closed for inactivity]
<shevy> Salehi, #python has like 2000 people
<bougyman> Salehi: I'm pretty sure it doesn't matter to me.
<bougyman> I'm absolutely sure, in fact.
<shevy> yeah but it matters to him!
<Salehi> bougyman: Yeah, this is another perspective :D
<shevy> he wins a cookie if ruby wins
<Salehi> shevy: I don't join in #python ;) :D
<rapha> ruboto: "guys" has pretty much changed to mean "y'all" and is definitely inclusive of women nowadays.
<shevy> I would but for some reason I can not pick the nick "python" :(
<bougyman> my son codes python for a living.
<shevy> damn
CatMartyn has quit [Client Quit]
<bougyman> not by choice, he's 21 so he had to take what he could get.
<bougyman> he got some django gig.
<Salehi> rapha: I think so
<shevy> django looked more interesting than the rest of python
CatMartyn has joined #ruby
jeramyRR has joined #ruby
tomaz_b has joined #ruby
<shevy> and rails :)))
<bougyman> i've been spending 1.5 years on getting my current $dayjob off-rails
<shevy> but I dunno, does anyone actually use both ruby and python at the same time, in equal parity?
<bougyman> we're really close.
<Salehi> shevy: but seems to stopped development for a while :D
<bougyman> moving to roda and sinatra micro-apps.
<Salehi> shevy: Django is good, but Rails is awesome :D
<baweaver> shevy: /me raises hand
<drew0> rapha, I shared that opinion for a while, but I later realized that it's not just "how you intend it," but also "how it is received."
<bougyman> I prefer roda but a lot of the devs like barrister, which is sinatra-backed.
<shevy> baweaver wow
<bougyman> there's a clear path to replacing sinatra with roda behind barrister, though.
<shevy> you are one clever beaver
<bougyman> we just haven't taken the time to do so.
<baweaver> Saltstack as opposed to Chef
* baweaver has a seething hatred of Chef
<bougyman> if you hate chef, you'll hate salt, too
Scrofff has joined #ruby
<bougyman> salt, puppet, ansible, chef, others.
<bougyman> i've used probably a dozen.
<baweaver> All CMs are junk honestly.
<Salehi> shevy: & me ( raising hand )
<bougyman> they all have hatable factors.
<shevy> wow
<bougyman> baweaver: exactly.
<baweaver> First one to incite stockholme syndrome wins
<bougyman> you just have to make the most of them and workaround the individuaal weaknesses.
<rapha> drew0: that's true for any and all communication and imo not solved by picking out a word here or a word there.
<baweaver> Indeed.
<bougyman> confluence is a meta-meta-cm
scripore has quit [Quit: This computer has gone to sleep]
<bougyman> it has some hope.
<baweaver> The entire metaphor game is cute and all, but really should be kept out of design
<shevy> Salehi you really use both ruby and python?
<bougyman> I use both.
atom3 has quit [Ping timeout: 276 seconds]
<baweaver> especially if you can't even keep to your own metaphor (Chef / cooking)
mister_solo has quit [Ping timeout: 276 seconds]
<bougyman> we're heavily dependent on buildbot, which is all python.
<Salehi> shevy: Yes, but I'm new to Rails
Scroff has quit [Ping timeout: 246 seconds]
<apeiros> slash_nick: it does. github doesn't process the links that way. i.e. if you open the docs locally it's linked
<Salehi> shevy: I found the rails awful :D
<apeiros> rapha: sorry, I'm off for today. if you ping me tomorrow, I'll have a look :)
<bougyman> i prefer buildbot to all of the other ci implementations i've tried.
<baweaver> Admittedly working on getting more into Scala and Spark at the moment. DevOps is getting a bit tedious.
atom3 has joined #ruby
<drew0> rapha: agreed, but it's a very easy courtesy, imho.
yqt has joined #ruby
Akagi201 has joined #ruby
<Salehi> shevy: /msg ?
<drew0> @shevy we use both ruby and python daily.
<rapha> apeiros: okay, have a nice day! :)
<baweaver> As of now I'm about equal parts Javascript, Ruby, Python, and Scala if you average the days of the week.
radialneon has joined #ruby
shevy has quit [Ping timeout: 252 seconds]
<rapha> drew0: i guess i have become defensive about these matters... the city in which i live has a lot of left-wing political people in it and for a while now there've been posters and flyers saying things like "make feminism a threat" everywhere. and while i'm 100% for equal rights, equal chances, equal pay, equal whatnot, this sort of aggressive and antipacifistic rhethoric appals me.
<bougyman> 70/20/10 ruby, pg/plsql, python.
<jhass> rapha: drew0 if you want to discuss this extensively, please head over to #ruby-offtopic ;)
PaulCapestany has quit [Read error: Connection reset by peer]
tenseiten has quit [Read error: Connection reset by peer]
<baweaver> then again I'm still a young pup myself at 25, so a ways to go yet.
m3_del has joined #ruby
PaulCapestany has joined #ruby
el3k0n has joined #ruby
seitensei has joined #ruby
seitensei has joined #ruby
Channel6 has joined #ruby
wallerdev has joined #ruby
s00pcan has joined #ruby
Akagi201 has quit [Ping timeout: 244 seconds]
chris2 has quit [Ping timeout: 256 seconds]
adamski2600 has quit [Remote host closed the connection]
scripore has joined #ruby
davedev2_ has quit [Ping timeout: 248 seconds]
m3_del has quit [Ping timeout: 265 seconds]
davedev24_ has joined #ruby
rmoriz has quit [Ping timeout: 252 seconds]
sharpmachine has quit [Read error: Connection reset by peer]
artmann has quit [Quit: No Ping reply in 180 seconds.]
sharpmachine has joined #ruby
balazs_ has joined #ruby
cstrahan has quit []
cstrahan has joined #ruby
nwhirschfeld has quit [Quit: No Ping reply in 210 seconds.]
Mekkis has quit [Quit: ZNC - http://znc.in]
Scroff has joined #ruby
artmann has joined #ruby
duper` has quit [Ping timeout: 250 seconds]
jenksy has quit [Ping timeout: 246 seconds]
gkra has quit [Ping timeout: 256 seconds]
troulouliou_dev has quit [Remote host closed the connection]
shevy has joined #ruby
chris2 has joined #ruby
Scrofff has quit [Ping timeout: 246 seconds]
nwhirschfeld has joined #ruby
jenksy has joined #ruby
Scrofff has joined #ruby
kirun has joined #ruby
Scroff_ has joined #ruby
rdark has quit [Quit: leaving]
Mekkis has joined #ruby
Scroff has quit [Ping timeout: 246 seconds]
super has joined #ruby
AlexRussia has quit [Ping timeout: 264 seconds]
crdpink has joined #ruby
timonv has quit [Ping timeout: 250 seconds]
crdpink2 has quit [Ping timeout: 248 seconds]
radialneon has quit [Remote host closed the connection]
Scrofff has quit [Ping timeout: 246 seconds]
Gnea has joined #ruby
findaway has joined #ruby
rmoriz has joined #ruby
abuzze has joined #ruby
gkra has joined #ruby
findaway has quit [Ping timeout: 244 seconds]
<baweaver> Ox0dea: http://keeprubyweird.com/ - I found a convention for ya
yfeldblum has joined #ruby
StephenOTT has joined #ruby
whippythellama has quit [Ping timeout: 252 seconds]
<slash_nick> baweaver: i like the sound of that
<baweaver> I might go over Clairvoyance and actually release part of it finally
<baweaver> Think TDD on steroids
<baweaver> RSPEC code is still just code, which means you can totally run it through another parser
codecop has joined #ruby
<baweaver> what if that parser, instead of testing the code, wrote the code it thought the test was referring to?
MiracleBlue has quit []
MiracleBlue has joined #ruby
tvw has joined #ruby
fmcgeough has joined #ruby
<baweaver> (psuedo) describe MyClass: describe '#function': it 'returns 5': expect(subject.function).to eq(5) -> class MyClass; def function; 5 end end
multi_io has quit [Ping timeout: 276 seconds]
perturbation has joined #ruby
<baweaver> contexts normally describe logic branches, describes normally reference functions, etc
multi_io has joined #ruby
<baweaver> then just ping pong it until it can get the tests to pass.
<baweaver> or give up and give you what its best guess is as to the code as it should be written.
<baweaver> Fair warning, this thing is a nightmare to make work properly.
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
abuzze has quit [Remote host closed the connection]
<baweaver> Submitting that as my talk.
abuzze has joined #ruby
OrbitalKitten has quit [Read error: Connection reset by peer]
maasha has joined #ruby
<baweaver> shevy: I need opinions on this madness of mine.
Scroff has joined #ruby
OrbitalKitten has joined #ruby
jaygen_ has joined #ruby
frem has joined #ruby
<shevy> ack
<shevy> the shevy shall bring order into the chaos of the mind!
<shevy> first - grab a cold beer. that's always a good start
DEA7TH_ has joined #ruby
<shevy> you'll be giving a talk?
<DEA7TH_> Is there any drawbacks to using a shell command (`mkfifo`) in my Ruby program, as opposed to a Ruby function? (I'm not concerned with portability)
<baweaver> Maybe
senayar has joined #ruby
senayar has joined #ruby
<baweaver> submitting it to Keep Ruby Weird
<shevy> cool
Scroff_ has quit [Ping timeout: 248 seconds]
<baweaver> DEA7TH_: cross system compatibility
<baweaver> Windows if it's a gem
<shevy> DEA7TH_ don't think there should be any drawbacks, after all that was a good use case for perl as well
jaygen has quit [Ping timeout: 265 seconds]
<baweaver> that's about it honestly.
erts has quit [Quit: erts]
m8 has joined #ruby
<DEA7TH_> oh nice
<shevy> let me find out how to do mkfifo in ruby
<DEA7TH_> shevy: it uses a gem :/
<shevy> oh damn I see
<shevy> require "mkfifo"; File.mkfifo('pipe_name')
<shevy> hmm
<wasamasa> I bet that wouldn't work on windows anyways
<maasha> Generic computer science question: Is there a described standard way of dealing with parantheses when evaluating expressions?
<shevy> yeah in this case, using `` is simpler because you won't need an external gem; ideally though, that could become part of File
<shevy> or FileUtils
<wasamasa> maasha: use a stack
<DEA7TH_> even if I installed the gem, it still probably won't work on Windows
<maasha> I am going to write a parser for some pattern matching logic involving regex type operators and modifiers including logical operators.
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fantazo has joined #ruby
<shevy> do you actually use windows? :)
eGGshke has joined #ruby
jfarmer has joined #ruby
<maasha> wasamasa: I was thinking of a clear system of reducing parans (or whatever it is called when you remove redundant parans)
<baweaver> on the talk, it's more of wondering if it's an interesting subject.
<maasha> paren
<baweaver> Clairvoyance is freaking ambitious to get made.
<shevy> baweaver add in some pictures of cats and beavers and it'll be alright
krzkrz has joined #ruby
<wasamasa> maasha: that should be a job for the optimizing part of a compiler
<shevy> matz did this as well during his talk
<shevy> he showed one duck that was typing
<wasamasa> maasha: not evaluation
bruno-_ has quit [Ping timeout: 252 seconds]
<maasha> wasamasa: ok, so what rules does the compiler follow and is there an easy read on that topic?
<wasamasa> maasha: well...
<wasamasa> maasha: the problem is that the most famous compilers out there are monolithic blobs of magic
krz has quit [Read error: Connection reset by peer]
<wasamasa> maasha: anyhow, if you want an easy read, I was reading emacs internals after finding out about a matz talk regarding ruby implementation choices
JoshL has joined #ruby
<wasamasa> maasha: and was surprised how understandable the peephole optimization parts of its bytecode optimizer were
<maasha> wasamasa: I guess to. I am just beginning researching this. I am going to look at compiler compilers - like YACC - but maybe that will just kill you :o)
<wasamasa> maasha: which could work out for your task
enedil has quit [Remote host closed the connection]
<wasamasa> maasha: it's basically about looking at a sufficiently simple form of your instructions and transforming known forms of it into more performant ones
<wasamasa> maasha: like, (+ x 1) into (1+ x)
jamesaxl has joined #ruby
Lucky___ has quit [Ping timeout: 255 seconds]
Scroff has quit [Ping timeout: 264 seconds]
lavros has quit [Quit: leaving]
Muhannad has joined #ruby
senayar has quit [Remote host closed the connection]
<maasha> wasamasa: right. I kinda dig reverse polish notation since it eliminates parens. I fear there are several ways parens can be dealt with and you end up with monolithic blobs of evil.
eGGshke has quit [Ping timeout: 256 seconds]
<eam> I wish method parens functioned as precedence parens
sharpmachine has quit [Read error: Connection reset by peer]
Muhannad has quit [Max SendQ exceeded]
havenwood has quit [Ping timeout: 265 seconds]
Muhannad has joined #ruby
eGGshke has joined #ruby
lkba has joined #ruby
Lucky_ has joined #ruby
<baweaver> >> def plus(*xs) xs.reduce(0, :+) end; (plus 1, 2, 3) # not quite lispy though
<ruboto> baweaver # => 6 (https://eval.in/392041)
Muhannad has quit [Max SendQ exceeded]
alex88 has joined #ruby
ryba has quit [Ping timeout: 256 seconds]
Muhannad has joined #ruby
Scroff has joined #ruby
Musashi007 has joined #ruby
sharpmachine has joined #ruby
phutchins1 has quit [Ping timeout: 256 seconds]
Muhannad has quit [Max SendQ exceeded]
Muhannad has joined #ruby
Scrofff has joined #ruby
jenksy has quit [Remote host closed the connection]
jenksy has joined #ruby
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
platzhirsch has joined #ruby
msnyon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
m3_del has joined #ruby
micmus has quit [Ping timeout: 265 seconds]
Scroff has quit [Ping timeout: 246 seconds]
micmus has joined #ruby
jeramyRR has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gambl0re has quit [Remote host closed the connection]
dseitz has joined #ruby
gambl0re has joined #ruby
towski_ has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
maasha has quit [Quit: Page closed]
m3_del has quit [Ping timeout: 265 seconds]
platzhirsch has quit [Ping timeout: 265 seconds]
nateberkopec has joined #ruby
abuzze has quit [Remote host closed the connection]
mrmargolis has joined #ruby
mwlang has joined #ruby
<mwlang> I’m working on a phone reg expr to extract the digits of a (XXX)-XXX-XXXX input where I don’t care what separates the digits, but I want area code to be optional.
<mwlang> I have this so far: /(\d{3})?[^\d]+?(\d{3})[^\d]+?(\d{4})/
<mwlang> and it works for the full number but not for when area code is absent…I thought the “?” specified the partial match as optionally appearing…
dgutierrez1287 has joined #ruby
s2013 has joined #ruby
jfarmer has quit []
chouhoulis has joined #ruby
mrmargolis has quit [Ping timeout: 252 seconds]
jpfuentes2 has quit [Ping timeout: 246 seconds]
jeramyRR has joined #ruby
mansel has quit [Max SendQ exceeded]
toretore has joined #ruby
mansel has joined #ruby
lala has joined #ruby
<mwlang> wow, ultra quiet room today
chouhoulis has quit [Ping timeout: 246 seconds]
findaway has joined #ruby
MatthewsFace has joined #ruby
balazs_ has quit [Remote host closed the connection]
Pupeno has joined #ruby
<shevy> mwlang it's too hot in europe :(
<mwlang> ah…meltdown
<shevy> it's almost 22:00, 10 pm that is I guess, and it's almost 29.0°C outside still; and my room isn't cooling down, it's getting hotter
gambl0re has quit [Remote host closed the connection]
nateberkopec has quit [Quit: Leaving...]
axsuul has joined #ruby
chendry has joined #ruby
GitGud has joined #ruby
chendry has left #ruby [#ruby]
<jhass> mwlang: are you sure? that should work. make a rubular with some examples?
bruno- has joined #ruby
MatthewsFace has quit [Ping timeout: 246 seconds]
casadei has joined #ruby
<mwlang> sure…one sec.
findaway has quit [Ping timeout: 252 seconds]
willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pupeno has quit [Ping timeout: 264 seconds]
rawtext has joined #ruby
rawtext has left #ruby [#ruby]
mleung has joined #ruby
sharpmachine has quit [Read error: Connection reset by peer]
mleung has quit [Client Quit]
drewo has quit [Ping timeout: 255 seconds]
<mwlang> jhass: sorry for delay, had to redact the actual numbers since they came from real customer inputs. https://gist.github.com/mwlang/24714c0fa90a713af221
platzhirsch has joined #ruby
platzhirsch has quit [Remote host closed the connection]
dagda1 has joined #ruby
<mwlang> all the specs pass except the one without area code.
_blizzy_ has joined #ruby
<mwlang> meh…just thought of another — nothing but numbers “4045551234” doesn’t pass that regexp
k3asd` has joined #ruby
<jhass> mwlang: http://rubular.com/r/BLplzA1B0F your examples pass, let's look at the logic (also note the slight cleanup by using \D)
<jhass> did you look at the spec failures? I bet you get output that starts with -
hahuang65 has joined #ruby
sharpmachine has joined #ruby
<jhass> since an optional capture group still gets an empty capture
<jhass> >> "foo".match(/(b)?(foo)/).captures
<ruboto> jhass # => [nil, "foo"] (https://eval.in/392054)
Joufflu_ has joined #ruby
<mwlang> the failures: got: nil
Joufflu has quit [Ping timeout: 248 seconds]
<jhass> you can also avoid doing the match twice, just check whether .match returned nil
jeramyRR has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mwlang> jhass: but good to be aware of that situation…I can compact before joining to resolve that.
_blizzy_ has quit [Read error: Connection reset by peer]
<mwlang> jhass: good catch on double match call.
Joufflu_ has quit [Client Quit]
_blizzy_ has joined #ruby
niemcu has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mwlang> hmmm…your regexp leads to same spec failures.
hahuang65 has quit [Ping timeout: 256 seconds]
s2013 has joined #ruby
<jhass> well yeah, I said it's equivalent, just nicer way to write it
<mwlang> Ah! missed that bit.
<mwlang> but in rubular it’s matching the one w/o area code.
<jhass> yeah
saadq has quit []
hahuang65 has joined #ruby
michael_mbp has quit [Excess Flood]
shadoi has joined #ruby
jpfuentes2 has joined #ruby
blackmesa has joined #ruby
matp has quit [Ping timeout: 244 seconds]
<jhass> oh, we're stupid
<jhass> the issue is that the \D+ / [^\d]]
jgpawletko has joined #ruby
<jhass> * ]+ needs to consume something
jgpawletko has quit [Client Quit]
<jhass> in the rubular it consumes the newline beofre
michael_mbp has joined #ruby
last_staff has joined #ruby
<shevy> <jhass> oh, we're stupid
<shevy> AHA!
<jhass> not the first time I said it ;)
<jhass> mwlang: /(?:(\d{3})\D+?)?(\d{3})\D+?(\d{4})/, whether that's a good expression to match phone numbers... it matches your examples
krzkrz has quit [Quit: WeeChat 1.0.1]
alex88 has quit [Remote host closed the connection]
pen has quit [Remote host closed the connection]
Akagi201 has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
<mwlang> let me try…I was at: /((\d{3})\D*?){1,2}(\d{4})/ which almost worked, but the area code had the delimiter included.
JohnBat26 has quit [Ping timeout: 246 seconds]
JoshL has quit []
Musashi007 has quit [Quit: Musashi007]
msnyon has joined #ruby
niemcu has quit [Ping timeout: 264 seconds]
houhoulis has joined #ruby
<mwlang> jhass: bam! There we go. one slight change to handle nothing but digits: /(?:(\d{3})\D*?)?(\d{3})\D*?(\d{4})/
eggoez has quit [Ping timeout: 246 seconds]
<toretore> why don't you just do (\d{3})?\D*(\d{3})\D*(\d{4}) ?
enebo has quit [Quit: enebo]
Scroff has joined #ruby
<jaroslav> what country phone numbers is this regex supposed to cover?
_ht has quit [Quit: Konversation terminated!]
<mwlang> jaroslav: just the state of georgia.
<mwlang> hence the 404, 770, 678 area codes.
<toretore> you want to match one \d{3} followed by \d{4}, optionally preceded by \d{3}, and any or no non-digits in between
<jaroslav> ah, ok
Akagi201 has quit [Ping timeout: 248 seconds]
tomphp has joined #ruby
msnyon has quit [Ping timeout: 246 seconds]
<mwlang> I just scanned 10 years of data and that spec covers all the exceptional cases encountered.
adamski2600 has joined #ruby
<mwlang> mysql with regexp query support is nice. :-)
<jaroslav> I don't think the "?" after second \D* is needed
<jaroslav> \D* is enough
msnyon has joined #ruby
Scrofff has quit [Ping timeout: 244 seconds]
<jhass> mwlang: if you're going to for optional delimiters I'd go with toretore's regex and http://paste.mrzyx.de/plz64hib9
<jhass> s/to //
acke has joined #ruby
<mwlang> add one more example to the examples: 4045551234
<mwlang> I had to change \D+ to \D* since delimiters were optional.
<shevy> <mwlang> I just scanned 10 years of data
<shevy> are you working for the agency!
phutchins1 has joined #ruby
sargas has joined #ruby
adamski2600 has quit [Ping timeout: 252 seconds]
niemcu has joined #ruby
Wolland has joined #ruby
Spami has joined #ruby
<mwlang> shevy: :-)
<toretore> number.scan(/\d+/).join[0,9]
zachk has joined #ruby
willharrison has joined #ruby
roolo has joined #ruby
<mwlang> toretore: I started to do that, but I’m about to extend the cases to extensions and that whole bit were somebody keeps entering area code and trailing with “or 678” was nuts.
<mwlang> so I just decided I wanted a definite XXX? XXX XXXX pattern
__butch__ has joined #ruby
scripore has joined #ruby
<mwlang> or that it can be turned into such where the delimiters are optional.
<wmoxam> mwlang: use Phonie
<mwlang> phonie? phony phones?
<wmoxam> then just filter on the area code ;)
m3_del has joined #ruby
jenrzzz has joined #ruby
Spami has quit [Client Quit]
niemcu has quit [Ping timeout: 248 seconds]
eggoez has joined #ruby
bruno- has quit [Ping timeout: 246 seconds]
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
<mwlang> wmoxam: hmmm….that’s an idea.
shadoi has quit [Quit: Leaving.]
niemcu has joined #ruby
<mwlang> only concern is performance needs to be fast since this is a data exchange server (sucking data from one pipeline and stuffing it into another)
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
k3asd` has quit [Ping timeout: 265 seconds]
tomaz_b has quit [Ping timeout: 264 seconds]
shadoi has joined #ruby
shadoi has quit [Client Quit]
brain_shim has quit [Ping timeout: 248 seconds]
<mwlang> not exactly pre-mature optimization here since they hired me specifically to fix performance issues as well as improve the sanity of the data going through the pipes.
Scroff has quit [Ping timeout: 246 seconds]
<mwlang> if I handle 99% of the phone numbers and kick back the non-valid stuff, we’re solid.
m3_del_ has joined #ruby
Lucky_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Salehi has left #ruby [#ruby]
jenrzzz has quit [Ping timeout: 250 seconds]
m3_del has quit [Read error: Connection reset by peer]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mwlang> anyway, jhass and toretore, I have a solid solution and all specs passing. Thanks for nudging me over the bump.
AlexRussia has joined #ruby
eggoez has quit [Ping timeout: 252 seconds]
drewo has joined #ruby
matp has joined #ruby
<mwlang> wmoxam: phonie’s nice. I know just the place I can use this gem (another client’s project)
niemcu has quit [Ping timeout: 256 seconds]
symm- has quit [Quit: Leaving...]
symm- has joined #ruby
armyriad has quit [Quit: Leaving]
<wmoxam> mwlang: :D
niemcu has joined #ruby
podman has quit [Quit: Connection closed for inactivity]
brain_shim has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
psy_ has quit [Remote host closed the connection]
niemcu has quit [Ping timeout: 256 seconds]
niemcu has joined #ruby
lessless has joined #ruby
blackmesa has joined #ruby
sharpmachine has quit [Read error: Connection reset by peer]
acke has quit [Remote host closed the connection]
millerti has joined #ruby
fgo has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
findaway has joined #ruby
MatthewsFace has joined #ruby
balazs_ has joined #ruby
Limix has joined #ruby
niemcu has quit [Ping timeout: 252 seconds]
jaygen has joined #ruby
benlieb has joined #ruby
MatthewsFace has quit [Ping timeout: 246 seconds]
niemcu has joined #ruby
jaygen_ has quit [Ping timeout: 256 seconds]
findaway has quit [Ping timeout: 264 seconds]
sharpmachine has joined #ruby
balazs_ has quit [Ping timeout: 244 seconds]
fgo has quit [Ping timeout: 276 seconds]
m8 has quit [Quit: Sto andando via]
dik_dak has joined #ruby
sankaber has joined #ruby
hanmac has quit [Ping timeout: 246 seconds]
Jackneill has quit [Remote host closed the connection]
m3_del_ has quit [Remote host closed the connection]
niemcu has quit [Ping timeout: 246 seconds]
blackmesa has quit [Ping timeout: 246 seconds]
niemcu has joined #ruby
JDiPierro has joined #ruby
nfk has joined #ruby
axsuul has quit [Ping timeout: 246 seconds]
_whitelogger has joined #ruby
<jhass> well, on OS X it's Cmd instead of Ctrl so you can feel special, yeah
<toretore> i'm getting a pc
drPoggs has joined #ruby
elektronaut has joined #ruby
<adaedra> jhass: yeah, not like the platform that has a key named after the system. :p
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
niemcu has quit [Ping timeout: 265 seconds]
<mwlang> What’s the proper way to handle a param passed in that may be an array of hashes or just a hash? Normally, when I know something can be either a single value or an array of values I just wrap with Array(some_param) and know I always have an array.
<mwlang> but when dealing with hashes, Array(some_hash) turns that entire hash into an array of tuples.
<jhass> mwlang: fix your API to always get an array
Aryasam has quit [Ping timeout: 276 seconds]
<jhass> or take a splat and don't accept an array
<mwlang> jhass: That’s what I’m doing
<jhass> have the caller splat it
<mwlang> jhass: it’s coming from the Nori gem.
niemcu has joined #ruby
bruno- has quit [Ping timeout: 248 seconds]
<jhass> so that has inconsistent returns? *sigh*
<toretore> "i have a great idea! if only one result is found, i'll not return an array"
<toretore> said the idiot
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mwlang> nori basically gives me either a hash when an XML section appears only once, or an Array of hashes when a section repeats.
<jhass> meh
<jhass> [foo].flatten(1)
<jhass> there's sadly no nicer way
scripore has joined #ruby
<toretore> v = [v] unless v.is_a?(Array)
<toretore> is what i do
<adaedra> a.is_a?(Array) ? a : [a]
<mwlang> jhass: that’s nice enough…At least I stop the perpetuation and always return an array. :-D
<adaedra> putting into an array and using flatten seems like a little much to me
<mwlang> I wonder which is more performant! I’ve done all three of the above, but just kinda sick of it, I suppose.
<jhass> well, the is_a? is certainly faster
<adaedra> you should also bug the library creator to fix his API and introduce consistency
micmus has quit [Quit: Leaving]
<adaedra> we've already .count to know if an array contains only one element, no need to unwrap it
niemcu has quit [Ping timeout: 246 seconds]
sargas has quit [Quit: This computer has gone to sleep]
<mwlang> adaedra: I’m actually bordering on forking and doing it myself…it’s a part of the Savonrb project, but entire thing is riddled with inconsistencies.
<adaedra> nuke them then
<mwlang> and kinda un-ruby-like.
<toretore> make everything return streams
niemcu has joined #ruby
<mwlang> toretore: heh…speaking to that…I’m considering building something similar to Savon but SAX parsing with Ox and making it return PORO
<mwlang> I find that although a hash representation of a SOAP message is somewhat nice, I end up wanting Ruby classes anyway.
<adaedra> Yeah, I know some of these words.
<mwlang> so why not figure out how to go to that (and I don’t mean Nokogiri’s whole Node style approach)
<toretore> what's wrong with e.g. nokogiri?
<adaedra> it's not written by yorickpeterse.
<mwlang> toretore: nothing. It’s good at what it does.
<toretore> or do you mean represent soap messages and not xml?
Musashi007 has joined #ruby
<zenspider> mwlang: you know another name for PORO? object
<mwlang> toretore: I want smart ruby classes that get their attributes automatically populated.
nolic has quit [Ping timeout: 252 seconds]
<toretore> right
Alayde has quit [Ping timeout: 246 seconds]
<mwlang> zenspider: Plain Ole Ruby Object?
<toretore> sounds reasonable; i don't know enough about soap to have an opinion
<zenspider> object
<jhass> toretore: feel lucky
<mwlang> zenspider: ah.
<zenspider> there's no real non-objects in ruby.
<toretore> as opposed to those fancy new ruby objects
<jhass> zenspider: fun fact. when they say PORO they usually mean a class
perturbation has quit []
niemcu has quit [Ping timeout: 244 seconds]
dopie has quit [Quit: This computer has gone to sleep]
<mwlang> zenspider: true…just too used to distinguishing “non Active Record” models to others in conversation. (do we create an Active Model class or a PORO class for this?)
<zenspider> jhass: sad, isn't it?
<zenspider> active record objects are ALSO objects.
<mwlang> yeah, we all know that, right?
<zenspider> sometimes I'm not so sure
niemcu has joined #ruby
<toretore> poro is a term taken from java that doesn't make sense to say in ruby
<toretore> i think is the point
<mwlang> I guess I’m usually telling devs “you don’t need all the bells and whistles of ActiveModel when a PORO will do"
<darix> I think AR objects are just PORO as well. calling them anything else would be discrimination.
findaway has joined #ruby
<zenspider> "The POJO phenomenon has most likely gained widespread acceptance because of the need for a common and easily understood term that contrasts with complicated object frameworks."
Pupeno has joined #ruby
<mwlang> well heck, I *am* discriminating in the conversations…but of course my use above should’ve just been “object” since AR wasn’t anywhere in sight other than in my project I’m not processing SOAP with ActiveRecord classes as the Rails 2.x version of the app I’m rewriting is.
JDiPierro has quit [Remote host closed the connection]
nettoweb has joined #ruby
<zenspider> other than the fact that AR hides a lot of their state in the attributes hash instead of ivars, I can't really say that AR is a "complicated object framework" with "special restriction"s
<zenspider> SOAP. there's an acronym I don't miss. :P
<toretore> i think it's more interesting to contrast pure data with objects that encapsulate and have behavior
<darix> zenspider: everyone needs a little SOAP each day ;)
<zenspider> toretore: what's "pure data" ?
<mwlang> yeah, SOAP can be a royal pain.
<toretore> not objects
<slash_nick> i think of a poro as something that depends only on stdlib...
<zenspider> darix: that's different! It's 90 here right now
<toretore> as in !object
<zenspider> toretore: and where do you do that?
<toretore> fp
JDiPierro has joined #ruby
niemcu has quit [Ping timeout: 256 seconds]
<slash_nick> if you implement your poro using a library that depends on stdlib alone, yeah... that flies
<zenspider> fun fact: everything in scheme is called an object
<darix> zenspider: so what? we will have 100-104 tomorrow and I will have a nice 10.5h train ride where i can only hope the AC holds
<mwlang> Well, I’m going back to my PORO reimplementation of a messy, cumbersome AR-oriented approach. :-D
<zenspider> "All objects created in the course of a Scheme computation, including procedures and continuations, have unlimited ex- tent."
<darix> mwlang: give us a call when you found out how much of AR you reimplemented in the process. ;)
findaway has quit [Ping timeout: 246 seconds]
<darix> or ActiveModel for that matter.
<zenspider> darix: yeah but I live in a place where this doesn't happen enough for ppl to buy AC
<zenspider> it SUCKS here right now
SCHAAP137 has quit [Ping timeout: 264 seconds]
cnngimenez has quit [Ping timeout: 264 seconds]
fmcgeough has quit [Quit: fmcgeough]
Pupeno has quit [Ping timeout: 246 seconds]
<mwlang> darix: heh…let’s just say the new solution is about a 70% reduction in code base since it’s actually domain model driven instead of tables in a database driven.
<zenspider> at least the desert (usually) gets cold at night.
rodfersou has quit [Quit: leaving]
<shevy> hehe
<darix> mwlang: and you persist into what?
<darix> just curious
<darix> 22°C here now^^
JDiPierro has quit [Remote host closed the connection]
<zenspider> I would love that
<baweaver> zenspider: SF is almost always between 55 and 75
<mwlang> darix: well, I’ll tie into the DB later, but at least it’ll be a very simple some_ar_model_instance.some_attribute = some_soap_model.some_attribute assignment straight down the entire method rather than a whole bunch if if/else/unless conditional. and I’ll probably do it with an iterator like “some_ar_model_instance.attributes.keys.each …”
<darix> so you actually just put in another layer :)
<mwlang> and not everything’s going into the db, either.
<darix> so
<mwlang> darix: yes, and on purpose.
<mwlang> I don’t need to write the same code to store addresses, phone numbers, people’s names over and over, yet the legacy database just has the same basic fields over and over.
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mwlang> and I don’t control the db.
acke has joined #ruby
casadei has joined #ruby
tomphp has joined #ruby
JoshL has joined #ruby
alem0lars has quit [Ping timeout: 252 seconds]
Guest77924 has quit [Ping timeout: 252 seconds]
silverdust has joined #ruby
alem0lars has joined #ruby
alem0lars has quit [Changing host]
alem0lars has joined #ruby
Alayde has joined #ruby
silverdust is now known as Guest59510
<mwlang> darix: another point is the SOAP classes are going to be used to push data from one stream to three separate databases which the schemas are different in each (it’s a data exchange service, after all)
Akagi201 has joined #ruby
<zenspider> baweaver: but then I have two problems
Alayde has quit [Read error: Connection reset by peer]
<baweaver> no pleasing you is there? :P
Alayde has joined #ruby
<zenspider> I loooove seattle, 9-10 months of the year
<mwlang> zenspider: move a little further south of SF to SD and deal with 65 - 75 temps. :-)
<zenspider> san diego?
<shevy> or move to canada 2 months per year, but the french speaking part
<zenspider> we were there for ... rubyconf? twice? not my people
<mwlang> zenspider: yup. just moved from Georgia — loving it so far.
<zenspider> mwlang: not a very high bar, is it? :P
<zenspider> shevy: I liked what little I've experienced of eastern canada
<mwlang> zenspider: heh…you referring to the rednecks or to the sweltering 100% humidity heat waves?
<zenspider> where was that? montreal or toronto ... sec
renderfu_ has joined #ruby
<prosodyContext> et sec map era
findaway has joined #ruby
<zenspider> must have been montreal
MatrixBridge has joined #ruby
blackmesa has joined #ruby
phutchins1 has quit [Ping timeout: 252 seconds]
yfeldblum has quit [Ping timeout: 248 seconds]
<zenspider> mwlang: yes?
Akagi201 has quit [Ping timeout: 256 seconds]
renderfu_ has quit [Ping timeout: 265 seconds]
adamski2600 has joined #ruby
phutchins1 has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
benlieb has quit [Quit: benlieb]
Alayde has quit [Ping timeout: 244 seconds]
senayar has joined #ruby
fantazo has quit [Ping timeout: 250 seconds]
Musashi007 has quit [Quit: Musashi007]
adamski2600 has quit [Ping timeout: 246 seconds]
decoponio has quit [Read error: Connection reset by peer]
decoponio has joined #ruby
Joufflu has joined #ruby
havenwood has joined #ruby
alextheman has joined #ruby
alextheman has left #ruby [#ruby]
Musashi007 has joined #ruby
<nofxx> just tryed working with objective C... I'm already depressed. Out of a handful of langs I've played I don't know any other so obfuscated.
DLSteve has joined #ruby
workmad3 has joined #ruby
<nofxx> jobs always bragged about who cares about soft makes he's own hardware... that's because he never coded for real
<shevy> lol
<shevy> didn't swift promise to make things better?
baweaver has quit [Remote host closed the connection]
<nofxx> shevy, nah... don't care about either. It's like 2 lines change, did in 10minutes in java which I never code, going to ask a ios friend ;)
<nofxx> ah, it's a phonegap plugin.. hence the objc/java thing...
Alayde has joined #ruby
Joufflu has quit [Read error: Connection reset by peer]
<nofxx> he would say: makes he's own DECENT language
last_staff has quit [Ping timeout: 246 seconds]
benlieb has joined #ruby
tomphp has joined #ruby
jhass has quit [Quit: Bye]
workmad3 has quit [Ping timeout: 248 seconds]
<nofxx> shevy, check out: `value = 1.0` objc version: NSNumber* value = [[NSNumber alloc] initWithFloat:1.0];
Nahra has joined #ruby
<shevy> I can see lisp in the [] !
NiVanc has joined #ruby
<nofxx> shevy, yeah... () looks better ;)
<shevy> could they transition into a ruby-like syntax, while retaining the speed of objc?
<nofxx> shevy, if you're coding only ios/osx there's that macruby thing, it's pretty neat
AlexAltea has quit [Ping timeout: 276 seconds]
<ljarvis> Swift is awesome..
<nofxx> someone was telling about it here the other day, can't remember now
<nofxx> a sec
<ljarvis> RubyMotion
<ljarvis> is what you're talking about
allomov has quit [Read error: Connection reset by peer]
jhass has joined #ruby
<nofxx> yes ;)
<nofxx> android too
thbar has joined #ruby
Alayde has quit [Ping timeout: 264 seconds]
Alayde has joined #ruby
allomov has joined #ruby
<zenspider> shevy: except that it is [noun verb] like god intended
spider-mario has quit [Remote host closed the connection]
victortyau has quit [Quit: Leaving]
seanstickle has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
<adaedra> nofxx: I thought macruby was dead
__butch__ has quit [Quit: Linkinus - http://linkinus.com]
<nofxx> adaedra, I meant rubymotion. the 'from macruby thing'
<havenwood> adaedra: It lives on through it's progeny, RubyMotion.
<adaedra> also, obj-c is made to try to keep language in the syntax. Parameters are all named, so you know which one is what, which can be ambigous otherwise.
bruno- has joined #ruby
<adaedra> Also, NSNumber* value = [[NSNumber alloc] initWithFloat:1.0] is not float value = 1.0
MatthewsFace has joined #ruby
<zenspider> <comic-book-guy-voice>Technically...</comic-book-guy-voice>
<shevy> :D
<adaedra> heh
nateberkopec has joined #ruby
<shevy> you can relate to the comic book guy I can see ;)
<shevy> He had a lot of domain-specific knowledge
bf4 has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
brain_shim has quit [Ping timeout: 252 seconds]
nateberkopec has quit [Client Quit]
EllisTAA has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Channel6 has quit [Quit: Leaving]
workmad3 has joined #ruby
seanstickle has quit [Quit: leaving]
ixti has joined #ruby
<Gnea> I'm having troubles installing the gem 'json' of a particular version (1.7.7) that's required for a specific application. It fails with the following errors: https://gist.github.com/anonymous/a9960dd457046d2b50c3 which I can fix manually, but if I try to re-run the installation, it pulls in fresh json code and overwrites the fix. How can I reliably fix the code and still obtain a compiled & installed gem?
djbkd has joined #ruby
blackmesa has joined #ruby
<havenwood> Gnea: JSON is in the stdlib in modern Ruby.
idiocrash has quit [Remote host closed the connection]
acke has quit [Remote host closed the connection]
<Gnea> havenwood: the application, snorby, requires version 1.7.7, not the currect version.
<havenwood> Gnea: Is this an app written for Ruby 1.8?
<crdpink> should core/stdlib documentation spelling and grammar errors be submitted to bugs.ruby-lang.org or as git pull requests?
[H]unt3r has quit []
<ljarvis> crdpink: either, the former has been more responsive imo
<Gnea> havenwood: no, 1.9
<Gnea> havenwood: (or newer)
<havenwood> crdpink: http://documenting-ruby.org/
<crdpink> ljarvis: thanks!
<ljarvis> crdpink: but, just ping zzak
<havenwood> ^
<ljarvis> he's a cool bro
m3_del has joined #ruby
<ljarvis> speaking of which
<ljarvis> zzak: YO
<zenspider> Gnea: 1.7.7 - February 11, 2013 java (85.5 KB) -- that's a while back...
<crdpink> that link looks like it has all the info, cheers
<zenspider> tho this is headius and flori... so I'd suspect it is pretty solid
fgo has joined #ruby
<Gnea> zenspider: I'm still pretty new to ruby, so learning as I go
Musashi007 has quit [Quit: Musashi007]
Akagi201 has joined #ruby
<zenspider> rb_str_new has always taken 2 args tho
<darix> zenspider: sadly i saw some apps not long ago where the gemfile still requested 1.7.7:|
<zenspider> that error looks really suspect.
balazs has joined #ruby
<darix> Gnea: you can try removing the version restriction for json
<zenspider> unless FBUFFER_PAIR is suppposed to macroize into 2 args
<darix> it will probably work
<zenspider> I don't see that code ever working
<zenspider> ok: #define FBUFFER_PAIR(fb) FBUFFER_PTR(fb), FBUFFER_LEN(fb)
<zenspider> Gnea: this means something is stupid about your compiler
<yxhuvud> <3 recursive macros
willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<zenspider> recursive?
<zenspider> ../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
<zenspider> VALUE result = rb_str_new(FBUFFER_PAIR(fb));
<zenspider> that's just wrong afaict
<yxhuvud> macros to another macro. they are not self-recursive
<darix> also snorby on a rasperry pi or so
<darix> that will go well ;)
<zenspider> you keep using that word. I don't think it means what you think it means
Indian has joined #ruby
fgo has quit [Ping timeout: 256 seconds]
<zenspider> if it did, all methods that did _anything_ would be recursive in your mind.
<EllisTAA> are sessions a form of chaching?
balazs has quit [Ping timeout: 248 seconds]
<darix> EllisTAA: you can abuse them as a cache
<darix> but generally speaking no
<EllisTAA> darix: thank you
<Gnea> zenspider: I agree, so when I found and implemented the fix, I was able to get generator.o to appear, but that was just one component, and the overall system wants fresh code already in place.
<darix> Gnea: your ruby 2.2 already comes with json
<Gnea> darix: but I'm back to square one.
<darix> you just need to allow it to use that version
guideX has joined #ruby
<darix> could even comment out the json line in the gemfile
<Gnea> I can edit the Gmakefile easily, but I don't know what command it's running since I'm just running "bundle install" overall
<darix> Gemfile
<zenspider> Gnea: you don't fix a broken complier by futzing with the source of its target
<Gnea> sorry, Gemfile
<zenspider> compiler, even.
<darix> that file is read by bundle install
bf4 has quit [Ping timeout: 265 seconds]
<Gnea> zenspider: yes, but the compiler isn't the problem
<zenspider> yes, it is
Papierkorb has joined #ruby
<Gnea> it doesn't matter
senayar has quit [Remote host closed the connection]
dopie has joined #ruby
MatthewsFace has quit [Ping timeout: 256 seconds]
<Gnea> I get that
guideX has left #ruby [#ruby]
<zenspider> it does matter. this isn't going to be the only problem you have. if it can't even preprocess a C file correctly and then compile it, you're going to be in a world of hurt
<darix> missing tons of security fixes
<darix> e.g. for rails
* Gnea sighs
<darix> good thing that isnt a security related project!
* Gnea drops a pin into an ocean
<zenspider> sigh all you want, but that isn't the only C dependency you're going to have with a gemfile that big
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Gnea> well it's gcc 5.1.0
<Gnea> I don't know why that makes a difference
Musashi007 has joined #ruby
<darix> Gnea: it is a big step for the gcc project
<darix> from the distros point of view i can tell you we had to fix a lot of things for gcc 5
<Gnea> look, you're talking about apples and oranges that I can even see
<Gnea> can't*
<Gnea> okay
<darix> Gnea: given the snorby website is down
<Gnea> and that's great, fixes are appreciated
<darix> one could argue the project is deadish
<Gnea> as is the amount of time put into them
<darix> Gnea: maybe hop into the snorby channel (same network) and ask them if they plan to update the dependencies in the gemfile to include security fixes
<darix> also ruby 2.2 needed some fixes in gems to work properly
<zenspider> still won't matter if you can't compile fairly straightforward c files correctly.
<Gnea> I don't think it's entirely dead, there was an update 2 days ago
<darix> json might be one of them
<darix> Gnea: a project which still pulls library versions from 2013
<Gnea> darix: I can surely ask that, it's not as dead as #sagan is
pgatt has joined #ruby
<zenspider> the FBUFFER_PAIR code is exactly the same as before in the latest version of json
<darix> nn
<Gnea> zenspider: so how was the issue addressed?
<zenspider> you're REALLY not listening
djbkd has quit [Quit: My people need me...]
<Gnea> oh I'm sorry, I didn't realize that it was against the rules to ask questions.
<zenspider> done
danielpclark has quit [Ping timeout: 246 seconds]
<Gnea> zenspider: perhaps you have a link to some documentation that I could read regarding the compiler fix?
thbar has quit [Quit: Textual IRC Client: www.textualapp.com]
bf4 has joined #ruby
allomov has quit [Remote host closed the connection]
willharrison has joined #ruby
AhabsBeard has joined #ruby
kb3ien has joined #ruby
sharpmachine has quit [Read error: Connection reset by peer]
bf4 has quit [Ping timeout: 250 seconds]
chouhoulis has joined #ruby
<Gnea> zenspider: I am sorry, this is very frustrating. I will try again later.
<kb3ien> I've had to make changes to a ruby gem, to add functionality that was missing in the original. I'd like to include the modified gem in the /vendors dir of my project, to keep my SVN copy more meaningful and because editing files that may be updated by bundler seems like the WRONG way to admin this project.
<Coraline> It would be better to wrap the gem than to work with a modified version of it.
<Coraline> You won't get any updates the way you're doing it.
MatthewsFace has joined #ruby
sharpmachine has joined #ruby
zotherstupidguy has joined #ruby
chouhoulis has quit [Ping timeout: 276 seconds]
<kb3ien> Okay. So I modified one file in the gem, basically forcing HTTPS connects to use a caching proxy server using HTTP. The gem contains multiple files, but I only changed one. What specifically do you suggest I read first?
findaway has quit [Ping timeout: 256 seconds]
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
danielpclark has joined #ruby
cnngimenez has joined #ruby
sharpmachine has quit [Remote host closed the connection]
<zenspider> kb3ien: consider sending the original a PR with your change?
MatthewsFace has quit [Remote host closed the connection]
dopie has quit [Quit: Leaving]
<zenspider> that way everyone benefits
wallerdev_ has joined #ruby
<kb3ien> I'm not sure if I want updates, until I know that the code is changed to allow HTTPS to be initiated by the proxy, not the ruby code.
wallerdev has quit [Ping timeout: 256 seconds]
wallerdev_ is now known as wallerdev
<kb3ien> I'm trying. These things take time.
Wolland has quit [Remote host closed the connection]
Channel6 has joined #ruby
ramfjord has joined #ruby
findaway has joined #ruby
<kb3ien> What's the best way to move it to vendor, even if I fall off the upgrade train.
JDiPierro has joined #ruby
gregf has quit [Quit: WeeChat 1.1.1]
<kb3ien> there is a repo, but it is SVN, not git, so git-centric concerns need not apply.
<zenspider> kb3ien: if you're using bundler, you can fork the project, put your change in there, and then point your gemfile at your repo/branch
baweaver has joined #ruby
stef204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<zenspider> what repo _your_ project is in shouldn't matter in this case
<kb3ien> i'm using bundler to install gems (projectBlacklight). I'd like to use the gemfile to spec a local copy, but I've not had any sucess.
Lucky_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
newbie has joined #ruby
yqt has quit [Read error: Connection reset by peer]
newbie has quit [Client Quit]
<kb3ien> gem 'gemname', :path "" seems to the solution. Never got it to work.
roolo_ has joined #ruby
roolo has quit [Read error: Connection reset by peer]
eggoez has quit [Ping timeout: 252 seconds]
redlegion has quit [Ping timeout: 264 seconds]
stoodfarback has joined #ruby
blackmesa has quit [Quit: WeeChat 1.2]
gregf has joined #ruby
iamninja has joined #ruby
<jhass> gem 'bar', path: "~/foo/bar" or gem 'bar', :path => "~/foo/bar"
pen has quit []
havenwood has quit [Ping timeout: 244 seconds]
<kb3ien> The original gem downloads to '/usr/local/lib/ruby/gems/2.0.0/gems/ebsco-discovery-service-api-1.0.4' which contains only one file 'lib/ebsco-discovery-service-api.rb'
scripore has quit [Quit: This computer has gone to sleep]
djbkd has joined #ruby
Musashi007 has quit [Quit: Musashi007]
claptor has joined #ruby
casadei has quit [Remote host closed the connection]
ixti has quit [Ping timeout: 255 seconds]
redlegion has joined #ruby
<kb3ien> should the path be '/usr/local/lib/ruby/gems/2.0.0/gems/' ?
<jhass> no
<kb3ien> or the equivilent depth in /var/www/site...
<kb3ien> okay. assuming /var/www/site/path/vendor/vendor/bundle/ruby/2.1.0/gems/ebsco-discovery-service-api-1.0.4/lib/ebsco-discovery-service-api.rb what should 'path' point to ?
scripore has joined #ruby
NiVanc has quit [Quit: Textual IRC Client: www.textualapp.com]
bruno- has quit [Ping timeout: 255 seconds]
<kb3ien> Or am I missing something?
<jhass> well, since it's apparently not on that guys github, we'll have to reconstruct a bit
<jhass> start with gem unpack ebsco-discovery-service-api
<jhass> to the resulting ebsco-discovery-service-api-1.0.4 directory, add a copy of /var/www/site/path/vendor/vendor/bundle/ruby/2.1.0/specifications/ebsco-discovery-service-api-1.0.4.gemspec
<jhass> try pointing path: at that directory then
solocshaw has joined #ruby
<yorickpeterse> 01:30: finally cooling down
<jhass> 26°C indoors here
<yorickpeterse> it's 25C-ish here
pen has joined #ruby
eggoez has joined #ruby
<kb3ien> I'm not looking at my temp. I'd rather NOT KNOW. Its been up to 30 here ( Southern .ny.us )
<yorickpeterse> 23,1C at 80% humidity :<
frem has quit [Quit: Connection closed for inactivity]
m3_del has quit [Remote host closed the connection]
<kb3ien> where do i run 'gem unpack' ?
MatrixBridge has quit [Ping timeout: 252 seconds]
rvchangue has quit [Ping timeout: 252 seconds]
<jhass> somewhere convenient
<kb3ien> okay. /tmp it is.
<jhass> well, you want it to persist since you want to point path: to the result after adding the gemspec
rvchangue has joined #ruby
idiocrash has joined #ruby
ubuntu_ has left #ruby [#ruby]
manveru has quit [Ping timeout: 252 seconds]
marcoamorales has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
marcoamorales has joined #ruby
daas has joined #ruby
zack6849 has quit [Ping timeout: 252 seconds]
<mwlang> why did TextMate go open source? (finally getting around to trying out TM2 today)
drPoggs has quit [Ping timeout: 252 seconds]
artmann has quit [Ping timeout: 252 seconds]
kalleth has quit [Ping timeout: 252 seconds]
pawz has quit [Ping timeout: 252 seconds]
5EXABLYGN has joined #ruby
1JTAAGLFW has joined #ruby
drPoggs has joined #ruby
idiocrash has joined #ruby
<ruboto> mwlang, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
The_Phoenix has quit [Quit: Leaving.]
<jhass> ?ot mwlang
manveru has joined #ruby
AhabsBeard has quit []
idiocrash has quit [Remote host closed the connection]
phrozen77 has quit [Ping timeout: 252 seconds]
willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
artmann has joined #ruby
kalleth has joined #ruby
<mwlang> didn’t even know that channel existed!
Pupeno has joined #ruby
fgo has joined #ruby
phrozen77 has joined #ruby
<yorickpeterse> mwlang: tl;dr because IIRC the author couldn't maintain/support it
findaway has quit [Ping timeout: 256 seconds]
msnyon has quit [Quit: Textual IRC Client: www.textualapp.com]
JDiPierro has quit [Remote host closed the connection]
<daas> would you guys mind looking at a simple function https://gist.github.com/anonymous/2eabc4b47d514decc10a
<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?
benlieb has quit [Quit: benlieb]
<daas> would y'all folks mind looking at a simple function https://gist.github.com/anonymous/2eabc4b47d514decc10a
<nofxx> daas, first... it should be named 'def even?'
<yorickpeterse> jhass: honestly at this point you might just want to set up an auto response
findaway has joined #ruby
findaway has quit [Client Quit]
<nofxx> daas, we are kinda against camel case
<kb3ien> guys is gender neutral in many dialects of US English. In UK English, my name isn't 'Guy'.
<daas> oh yeah just a habit lol
<kb3ien> ERROR: Gem 'ebsco-discovery-service-api-1.0.4' not installed nor fetchable.
<jhass> yorickpeterse: honestly, I'd forget that I did when apeiros finally deploys the bot :P
<nofxx> daas, here how it works... num in the case is a integer you mean right?
<yorickpeterse> jhass: heh
<daas> yeah
<al2o3-cr> don't meant (doesn't make sense)
<mwlang> yorickpeterse: he built it too good!
<nofxx> daas, it's class in ruby is 'Fixnum' , you just open fixnum and add your method
<jhass> >> 2.even?
<ruboto> jhass # => true (https://eval.in/392098)
<jhass> ^ just pointing out
<jhass> so we'll need my_even? or something
zack6849 has joined #ruby
zack6849 has joined #ruby
pawz has joined #ruby
<Mon_Ouie> And if you're going to define it in some class, you should define it in Integer, not Fixnum
<daas> oh Ruby already has an even function for Integers lol
<daas> but yeah I was just trying to figure out how to extend one of Ruby's existing class with methods, thanks
fgo has quit [Ping timeout: 256 seconds]
Pupeno has quit [Ping timeout: 256 seconds]
<nofxx> daas, that's what I imagined
<nofxx> Mon_Ouie, yeah, thanks...
workmad3 has quit [Ping timeout: 256 seconds]
<Mon_Ouie> >> class Integer; def hi; puts "I'm #{self}"; end; end; 3.hi
<ruboto> Mon_Ouie # => I'm 3 ...check link for more (https://eval.in/392099)
<nofxx> Mon_Ouie, a nice trick, end doesn't need line ending:
<kb3ien> jhass did that command work for you ?
<nofxx> >> class Integer; def hi; puts "I'm #{self}" end end; 3.hi
<ruboto> nofxx # => I'm 3 ...check link for more (https://eval.in/392100)
<nofxx> totally forgot the name of ';' hehe.... going to eat. til soon
<jhass> kb3ien: yeah
<jhass> kb3ien: does gem fetch ebsco-discovery-service-api work?
pen has quit []
nobitanobi has joined #ruby
idafyaid has quit [Ping timeout: 256 seconds]
el3k0n has quit [Ping timeout: 265 seconds]
<Tarkers34> Okay guys, now I'm learning about blocks and I've got a bit of a headscratcher. When you put put statements inside a block, why aren't those put statements outputted to the console when yield is called inside the method? Here is an example of what I mean https://gist.github.com/anonymous/18ab198308a7dfdf4668 See? I would expect us to get 'nil' reported to the console every time yield is called...
DLSteve has quit [Quit: Leaving]
<daas> ?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?
<Tarkers34> is console output surpressed inside the method or is something cleverer going on?
<kb3ien> sorry i used the version number too.
<kb3ien> both work.
EllisTAA has quit [Quit: EllisTAA]
adamski2600 has joined #ruby
5EXABLYGN has quit [Remote host closed the connection]
1JTAAGLFW has quit [Remote host closed the connection]
EllisTAA has joined #ruby
<Tarkers34> * okay guys, girls, transexuals, aliens w/e it takes to make the PC police stop :'(
MatrixBridge has joined #ruby
<zenspider> Tarkers34: you exp... nevermind
mfranzwa has quit [Quit: mfranzwa]
<Tarkers34> zenspider ??
michael_mbp has quit [Excess Flood]
<zenspider> cut out the jackassery and we'll talk
<Tarkers34> okay, go on
<Tarkers34> if you would
Musashi007 has joined #ruby
<kb3ien> jhass done, it deposited only one file again. /tmp/ebsco-discovery-service-api-1.0.4/lib/ebsco-discovery-service-api.rb
<jhass> kb3ien: yep, do you remember the second step I wrote?
adamski2600 has quit [Ping timeout: 246 seconds]
willharrison has joined #ruby
michael_mbp has joined #ruby
Lucky_ has joined #ruby
baweaver has quit [Remote host closed the connection]
JoshL has quit []
<kb3ien> found it. done.
<jhass> Tarkers34: I'm not sure why you expect the nil's
Rickmasta has joined #ruby
drew0 has quit [Remote host closed the connection]
drew0 has joined #ruby
<kb3ien> Should I be able to use path to point to that dir, now ?
<jhass> Tarkers34: and each_with_index returns the receiver, it's not .map_with_index
<jhass> kb3ien: yeah
zzor has quit [Ping timeout: 250 seconds]
<zenspider> kb3ien: ruby -I<path/to/lib> or modify the pathing in your code
<zenspider> (before require)
<Tarkers34> jhass Not necessarily nils...just some sort of error. I mean I don't actually expect it from a ruby native method but you see what I mean? We're executing puts 'index ' + i.inspect What is 'i'? in the context of the method? nil, right? Or, if it's not nil, it's the index. So it would be executed twice. If you were to create an interaor from scratch you'd see what I mean :P
chipotle has joined #ruby
JDiPierro has joined #ruby
<Tarkers34> *so it would be printed twice **iterator
Channel6 has quit [Quit: Leaving]
kkeuning has joined #ruby
<jhass> Tarkers34: no, I don't see what you mean. each_with_index is basically def each_with_index; i = 0; each do |e| yield e, i; i += 1; end; self; end;
<jhass> just implemented in C
<zenspider> what?
<zenspider> executed twice? why?
arooni-mobile has joined #ruby
<zenspider> nil?
<toretore> anyone happen to know where to find the "concurrent" gem source? i remember seeing it on github before
<Tarkers34> zenspider printed twice. ill make a gist
<toretore> (not "concurrent-ruby")
<zenspider> hey, that's one of our gems!
<zenspider> mentalguy wrote that
thalassa has quit [Ping timeout: 264 seconds]
<toretore> yeah, that's the one
<jhass> toretore: use the github search, either for repo name or the gemspec
<toretore> oh it's mental/concurrent
KrzaQ has quit [Read error: Connection reset by peer]
<toretore> i tried mentalguy
<toretore> yeah
<toretore> thanks
<kb3ien> sookay. Sound whre would the path point (the files are now in : /var/www/site/path/vendor/bundle/ruby/2.1.0/gems/ebsco-discovery-service-api-1.0.4/ebsco-discovery-service-api-1.0.4.gemspec and /var/www/site/path/vendor/bundle/ruby/2.1.0/gems/ebsco-discovery-service-api-1.0.4/lib/ebsco-discovery-service-api.rb ) ?