jmdade has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rollabunna has joined #ruby
shadoi has joined #ruby
shadoi has quit [Client Quit]
gord0 has joined #ruby
Xeago has joined #ruby
shadoi has joined #ruby
shadoi has quit [Client Quit]
<gord0>
sorry new to ruby. best way to install local gems. i saw the option --local as well as --user-install. which one to use?
Giordano has joined #ruby
RegulationD has quit [Remote host closed the connection]
aibot has quit [Ping timeout: 240 seconds]
shadoi has joined #ruby
shadoi has quit [Client Quit]
ebbflowgo has joined #ruby
beauby has quit [Ping timeout: 244 seconds]
<jhass>
--local is about network connections, not install location
InvGhost has quit [Ping timeout: 272 seconds]
roshanavand has quit [Remote host closed the connection]
shadoi has joined #ruby
shadoi has quit [Client Quit]
<Giordano>
Hey guys, I wanna try TDD with ruby and was wondering if there is a nice open source project that follows TDD and that I could contribute. I would appreciate if anyone could give me some suggestions
shadoi has joined #ruby
shadoi has quit [Client Quit]
aibot has joined #ruby
sanjayu has quit [Ping timeout: 276 seconds]
shadoi has joined #ruby
shadoi has quit [Client Quit]
IrishGringo has joined #ruby
shadoi has joined #ruby
shadoi has quit [Client Quit]
Eising has quit [Ping timeout: 255 seconds]
shadoi has joined #ruby
shadoi has quit [Client Quit]
Eising has joined #ruby
shadoi has joined #ruby
shadoi has quit [Client Quit]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
howdoicomputer has quit [Ping timeout: 260 seconds]
<DoctorWedgeworth>
sorry for newbie question. How can I make this work in one line? I think the problem is that both arguments are in an array instead of being two separate numbers: Range.new("45000-46000".split(/[^\d]+/, 2).map { |s| s.to_i })
rubie has quit [Remote host closed the connection]
gatman_ has quit []
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 276 seconds]
millerti has joined #ruby
failshell has quit []
mistermocha has quit [Remote host closed the connection]
Some-body_ has joined #ruby
RTG` has quit [Ping timeout: 255 seconds]
DarthGandalf has quit [Read error: Connection reset by peer]
Some-body_ is now known as DarthGandalf
RTG` has joined #ruby
bb010g has joined #ruby
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nso95- has joined #ruby
dome22xl has joined #ruby
waka has joined #ruby
greister has quit [Quit: WeeChat 1.3]
devyn has joined #ruby
auzty has joined #ruby
vdamewood has quit [Ping timeout: 240 seconds]
nso95- has quit [Ping timeout: 244 seconds]
JoshGlzBrk has joined #ruby
nigget has joined #ruby
<nigget>
Hi
greister has joined #ruby
aspiers_ has quit [Ping timeout: 264 seconds]
s2013 has joined #ruby
badon has left #ruby ["Leaving"]
gusTester has quit [Quit: Leaving.]
haraoka has joined #ruby
greister has quit [Client Quit]
greister has joined #ruby
<Coraline>
nigget: change your nick
yoongkang has joined #ruby
<Coraline>
!kick nigget Offensive nick
nigget was kicked from #ruby by ruboto [Offensive nick]
roshanavand has joined #ruby
The_Phoenix has joined #ruby
nigget has joined #ruby
gusTester has joined #ruby
<nigget>
How is my Nick offensive? I can name at least 10 people with extremely offensive nicks in here
<jhass>
!ban nigget !T 1w offensive nick
nigget was kicked from #ruby by ChanServ [Banned: offensive nick]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pedahzur has joined #ruby
yoongkang has quit [Ping timeout: 250 seconds]
roshanavand has quit [Ping timeout: 240 seconds]
<pedahzur>
Slightly silly question, with an easy answer, I hope. I am trying to debug a failing rspec test. The failure message, in part is, expected "<blah>" to have parameters: <big data structure here>. It does not print out, however, what it actually got when the test failed. If I had that, I might be able to figure out what went wrong. How do I obtain that information? :)
<Coraline>
puts?
<jhass>
are you sure? it's sometimes hard to spot in a big structured
gusTester has quit [Quit: Leaving.]
nofxx has quit [Remote host closed the connection]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has quit [Ping timeout: 240 seconds]
nso95- has joined #ruby
nso95- has joined #ruby
skcin7 has joined #ruby
<pedahzur>
Coraline: Where do I put the puts? I just have an is_expect.to block.
Ox0dea has quit [Quit: WeeChat 1.4-dev]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
confounds has quit []
s2013 has joined #ruby
confounds has joined #ruby
<pedahzur>
jhass: Not sure what you mean. There is a line that says it expected it to have parameters: <prints data structure here> then nothing after saying what it actually got.
<jhass>
pedahzur: there's not always a newline, the "got: " can be "inside" the big structure and may be hard to spot
<pedahzur>
BLARGH....buried was down in that text is a 'was'
<driftig>
jhass: Why is nigget offensive exactly?
<jhass>
driftig: use urbandictionary.com
shadoi has quit [Quit: Leaving.]
nso95- has quit [Remote host closed the connection]
jetpackjoe has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<driftig>
I find it a bit petty. It may not be racially motivated to discriminate anyone at all.
jetpackjoe has quit [Max SendQ exceeded]
<jhass>
driftig: we have a regular who's "creative"
<driftig>
I hope they find some closure in their creativity.
<setient>
hmm
<setient>
you know a ruby plugin to a bot that checks urban dictionary for words could be useful.
<setient>
when someone joins
<setient>
i can see problems though
beauby has joined #ruby
nofxxx has joined #ruby
Bellthoven has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest24441 is now known as Tristan-Speccy
jgorak has joined #ruby
nso95 has joined #ruby
<jgorak>
Hey all. Noob question I've not been able to find the right google terms for: I got used to setting a default like 'dst = src || "empty"'. Works great for strings, but not so hot with booleans where I really mean to check nil but false gets caught up in there. Is there a shorthand trick like this that works for any type meaning "the first one if it is defined, otherwise the second one"?
nso95 has quit [Client Quit]
<jhass>
not really, no, dst = src.nil? ? "empty" : src is as good as you get
freerobby has quit [Quit: Leaving.]
pedahzur has quit []
<jgorak>
That's the best I found, too. Just hoped to make everything real pretty and same. Oh well. Thanks for confirming
rubie has joined #ruby
_seanc_ has joined #ruby
<Giordano>
jgorak: personally I like to do src.present? i think is more idiomatic
<jhass>
Giordano: read the question though, present? would have even more "false positives" than ||
<jhass>
besides, it's activesupport
nateberkopec has quit [Quit: Leaving...]
towski__ has quit [Remote host closed the connection]
baweaver has joined #ruby
deadlock has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
replay has quit []
diegoaguilar has quit [Ping timeout: 276 seconds]
haraoka has quit [Ping timeout: 246 seconds]
baweaver has quit [Ping timeout: 272 seconds]
ledestin has joined #ruby
jetpackjoe has joined #ruby
diegoaguilar has joined #ruby
nofxxx has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nofxx_ has joined #ruby
nofxx_ has joined #ruby
dimasg has quit [Ping timeout: 250 seconds]
frem has quit [Quit: Connection closed for inactivity]
nofxxx has quit [Ping timeout: 240 seconds]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
centrx has quit [Quit: If you meet the Buddha on the road, kill him.]
nofxx_ has quit [Remote host closed the connection]
nofxxx has joined #ruby
Rickmasta has joined #ruby
nofxx_ has joined #ruby
nofxx_ has joined #ruby
nofxxx has quit [Read error: Connection reset by peer]
dlitvak has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
goodcodeguy has joined #ruby
yqt has quit [Ping timeout: 250 seconds]
CrazyEddy has quit [Remote host closed the connection]
asas has quit [Ping timeout: 240 seconds]
mary5030 has joined #ruby
Darmani has joined #ruby
axsuul has joined #ruby
goodcodeguy has quit [Client Quit]
shadoi has joined #ruby
goodcodeguy has joined #ruby
weemsledeux has joined #ruby
Darmani has left #ruby [#ruby]
gambl0re has joined #ruby
Zaphon has joined #ruby
<Zaphon>
Hello?
sankaber has joined #ruby
<blubjr>
hi zaphon
yoongkang has joined #ruby
solocshaw has quit [Read error: Connection reset by peer]
<Zaphon>
Hey man, is it cool to ask questions about Ruby here?
solocshaw has joined #ruby
patrick2 has quit [Ping timeout: 240 seconds]
CrazyEddy has joined #ruby
patrick2 has joined #ruby
roshanavand has joined #ruby
yoongkang has quit [Ping timeout: 255 seconds]
nofxx_ has quit [Ping timeout: 264 seconds]
roshanavand has quit [Ping timeout: 240 seconds]
rawheadon has quit [Quit: Leaving...]
_stu_ has quit [Quit: _stu_]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rubie has joined #ruby
Bellthoven has quit []
jameswatling has joined #ruby
nso95- has joined #ruby
pawnbox has joined #ruby
ascarter has joined #ruby
cdg has joined #ruby
<havenwood>
Zaphon: Ruby questions are welcome!
<zenspider>
Zaphon: no. we hate questions
<zenspider>
wait. I think I got that backwards again
akira has joined #ruby
<Zaphon>
Lol...
akira is now known as Guest75108
roshanavand has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
<Zaphon>
So I'm still a beginner, I haven't really had a programming background before trying Ruby. I'm still trying to wrap my head around tying blocks with methods on arrays and strings and stuff.
<Zaphon>
So anyway... Is there a simple way to understand this stuff?
akira__ has quit [Ping timeout: 244 seconds]
rubie has quit [Remote host closed the connection]
User458764 has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
<Radar>
Zaphon: Do you have some code in particular that you're struggling with?
<Zaphon>
Well I'm on Codewars, it's a website where you practice solving problems in Ruby, c#, etc.
dlitvak has quit [Remote host closed the connection]
spt0 has joined #ruby
<Zaphon>
One of the problems in particular is to find the longest word within a string and print it to the console.
spt0 has left #ruby [#ruby]
<Zaphon>
But I'm not exactly sure where to start...
dimasg has joined #ruby
<zenspider>
"tying blocks w/ methods on arrays and strings and stuff" is... vague
yes`r has joined #ruby
yeshacker has quit [Ping timeout: 272 seconds]
<driftig>
zenspider has been away a while.
<Zaphon>
haha yeah I guess it is... Well let me see if I can find a specific example.
rdavila has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
nchambers is now known as dtscode
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
linuxboytoo has quit [Remote host closed the connection]
linuxboytoo has joined #ruby
shock_one has quit [Ping timeout: 272 seconds]
<wwalker>
so, if I execute(sql) (in Rails) I get back an array of arrays. I would like to be able to do : rows.each{|row| puts row.fname, row.lname...} rows may have 250,000 arrays in it, so the overhead of creating OpenStructs out of each one seems too expensive.
s00pcan has quit [Remote host closed the connection]
<wwalker>
Anyone know a module that does something along this line?
ascarter has joined #ruby
yoongkang has joined #ruby
rakm has joined #ruby
<baweaver>
wwalker: !rails
<baweaver>
!rails
* baweaver
sighs
<baweaver>
#RubyOnRails is where you should ask
linuxboytoo has quit [Ping timeout: 272 seconds]
hahuang65_ has joined #ruby
<wwalker>
baweaver: I'm not looking for a rails solution. I think this is the standard results of a database call (array of arrays)
<baweaver>
ActiveRecord
<wwalker>
I do very little with rails. I'm trying to find an efficient solution
<ruboto>
mallu, To properly use gist, please enable syntax highlighting, either by choosing the language manually or by entering a proper filename. If you post multiple things, separate them into multiple files. If you have a Github account, please update your gist with new information instead of posting a new one.
ur5us has joined #ruby
<Radar>
Seems a lot like homework to me.
<Radar>
Or consulting
<Radar>
Homework I don't do
<Radar>
Consulting I do do. I can send through my normal contract if you'd like?
<havenwood>
Pling, Plang, Plong as a Service.
d0nn1e has joined #ruby
Rollabunna has quit [Ping timeout: 272 seconds]
tubulife- has joined #ruby
houhoulis has quit [Remote host closed the connection]
<Radar>
mallu: Why are you soliciting feedback here? It is what exercism.io is good for
iateadonut has joined #ruby
<mallu>
Radar: I am not getting any response from exrcism. seems like nobody is reviewing codes there
<havenwood>
mallu: Drop the explicit return from your last line.
iateadonut has quit [Client Quit]
<havenwood>
mallu: (It'll return anyways if it make it there.)
<mallu>
havenwood: correct.. thank you
parantapVikram has joined #ruby
parantapVikram has quit [Remote host closed the connection]
Vivekananda has joined #ruby
<havenwood>
mallu: Since you're not instantiating your class use a module instead.
<havenwood>
mallu: module Raindrops
<Radar>
I wonder if this even needs to be implemented as a module
<Radar>
it could just be a function
<Radar>
method, whatever
<mallu>
havenwood: exercism's test is calling Raindrops.convert(105)
<mallu>
thats why I was creating the class
pawnbox has quit [Ping timeout: 260 seconds]
<havenwood>
mallu: What I was suggesting was changing `class` to `module` in your code.
<havenwood>
mallu: On line 3.
<mallu>
havenwood: ok
yfeldblum has quit [Ping timeout: 246 seconds]
Mia has joined #ruby
Mia has joined #ruby
<Radar>
mallu: ok, that makes sense then
<mallu>
thanks guys
greenbigfrog has joined #ruby
devyn has quit [Read error: Connection reset by peer]
<havenwood>
mallu: Happy coding!
devyn has joined #ruby
trosborn has quit [Quit: trosborn]
<mallu>
havenwood: thanks.. I'll be bugging you guys later :)
DurstBurger has joined #ruby
Oog has joined #ruby
mary5030 has quit [Ping timeout: 246 seconds]
<ldrancer>
everything about atoms is made up. are their atomic bombs? was hiroshima a fire bomb
<havenwood>
?ot ldrancer
<ruboto>
ldrancer, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<ldrancer>
whats all this bulllll
<ldrancer>
quantum discussion was brought up
lxsameer has joined #ruby
lxsameer has joined #ruby
<ldrancer>
off of which topic..
<ldrancer>
oh wait wrong room
<ldrancer>
maybei should leave
<ldrancer>
coding 2 rooms
ldrancer has left #ruby [#ruby]
skcin7_ has joined #ruby
cwong_on_irc has joined #ruby
pawnbox has joined #ruby
rubie has quit [Remote host closed the connection]
skcin7 has quit [Ping timeout: 255 seconds]
_seanc_ has quit [Quit: _seanc_]
_seanc_ has joined #ruby
davedev24 has quit []
dimasg has joined #ruby
dlitvak has joined #ruby
krz has joined #ruby
Oog has quit [Read error: Connection reset by peer]
VeryBewitching has quit [Quit: Konversation terminated!]
mallu has quit [Ping timeout: 246 seconds]
_seanc_ has quit [Client Quit]
lurch_ has joined #ruby
dlitvak has quit [Ping timeout: 264 seconds]
Bugboy1028 has quit [Ping timeout: 272 seconds]
krz has quit [Read error: Connection reset by peer]
axsuul has quit [Read error: Connection reset by peer]
amclain has quit [Quit: Leaving]
axsuul has joined #ruby
confounds has joined #ruby
rubie has joined #ruby
dionysus69 has joined #ruby
Bugboy1028 has joined #ruby
trosborn has joined #ruby
pawnbox has quit [Remote host closed the connection]
jameswatling has quit []
pawnbox has joined #ruby
moeabdol has quit [Ping timeout: 255 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
trosborn has quit [Quit: trosborn]
dimasg has quit [Ping timeout: 240 seconds]
solocshaw has quit [Ping timeout: 240 seconds]
naftilos76 has joined #ruby
Gnut has joined #ruby
xcesariox has joined #ruby
SOLDIERz has joined #ruby
SOLDIERz has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 240 seconds]
deadlock has joined #ruby
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DoubleMalt has joined #ruby
aganov has joined #ruby
patdohere has joined #ruby
dhjondoh has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
howdoicomputer has joined #ruby
grill has joined #ruby
patdohere has quit [Ping timeout: 264 seconds]
jetpackjoe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
deadlock has quit [Quit: Leaving]
trosborn has joined #ruby
camilasan has quit [Remote host closed the connection]
trosborn has left #ruby [#ruby]
camilasan has joined #ruby
Oog has joined #ruby
d0lph1n98 has joined #ruby
ta has quit [Remote host closed the connection]
hahuang65_ has quit [Quit: Connection closed for inactivity]
ur5us has quit [Remote host closed the connection]
d0lph1n98 has quit [Read error: Connection reset by peer]
hahuang61 has joined #ruby
spt0 has quit [Quit: Leaving]
Oog has quit []
tagrudev has joined #ruby
hahuang61 has quit [Ping timeout: 246 seconds]
Pupp3tm4st3r has joined #ruby
roshanavand has joined #ruby
certainty|mobile has joined #ruby
<certainty|mobile>
moin
jondot has joined #ruby
maloik has joined #ruby
Pupp3tm4st3r has quit [Ping timeout: 252 seconds]
roshanavand has quit [Ping timeout: 260 seconds]
skade has joined #ruby
aufi has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 has joined #ruby
maloik has quit [Ping timeout: 244 seconds]
psy_ has quit [Remote host closed the connection]
agent_white has quit [Read error: Connection reset by peer]
rubie has quit [Remote host closed the connection]
dionysus70 is now known as dionysus69
ur5us has joined #ruby
cyberfawkes has joined #ruby
codecop has joined #ruby
<cyberfawkes>
is there a way to simplify this? guess = gets.chomp guess = guess.to_i!
Xeago has joined #ruby
Xeago has quit [Remote host closed the connection]
zast has left #ruby [#ruby]
Xeago has joined #ruby
Xeago has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 244 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
moeabdol has joined #ruby
<pontiki>
other than `guess = gets.chomp.to_i` ? i'm not aware of a `.to_i!` method
favadi has joined #ruby
<cyberfawkes>
derp
<cyberfawkes>
*headdesk*
<cyberfawkes>
thank you
<pontiki>
cow-erker asked if there was a way to determine with a regular expression *only* if a string of numbers represents a number less than 750. any clues? i have *none* at all
karapetyan has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
Pupp3tm4st3r has joined #ruby
lubekpl has joined #ruby
lubekpl has quit [Client Quit]
moeabdol has quit [Ping timeout: 244 seconds]
alzig has joined #ruby
User458764 has joined #ruby
jetpackjoe has joined #ruby
nso95- has quit [Remote host closed the connection]
htmldrum has quit [Ping timeout: 246 seconds]
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
<cyberfawkes>
how do I "do nothing" in an if statement?
<blubjr>
why do you want to
dionysus69 has quit [Ping timeout: 276 seconds]
<ja>
cyberfawkes: are you sure you don't simply want `unless`?
naftilos76 has quit [Quit: Αποχώρησε]
pawnbox has quit [Remote host closed the connection]
skcin7_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
leat has joined #ruby
pawnbox has joined #ruby
Rickmasta has joined #ruby
roshanavand has joined #ruby
troys has joined #ruby
agent_white has joined #ruby
confounds has quit []
<cyberfawkes>
nevermind, got it.
<cyberfawkes>
I was doing it wrong. *headdesk*
<cyberfawkes>
not sure why the tabbing(four spaces) is showing up this way, but oh well.
pawnbox has quit [Remote host closed the connection]
yoongkang has joined #ruby
<hxegon>
Is there a clean way to test if x.nil? or x.empty? without erroring for trying nil.empty?
<hxegon>
I'm feeling a ternary, but wanted to check
<ja>
cyberfawkes: maybe, just for shits 'n' giggles, use `until guess_count == 3` instead
<blubjr>
x.nil? || x.empty?
<certainty|mobile>
hxegon x.nil? || x.empty?
<cyberfawkes>
ja: instead of the while loop?
<blubjr>
or is short circuiting, it stops evaluating once it gets its first true value
<hxegon>
blubjr, certainty|mobile thanks, didn't know you could do that.
<ja>
cyberfawkes: and definitely use two spaces for indentation instead of four, but that's absolutely the only thing near to “bad” I can see! :D
<certainty|mobile>
|| short-circuits
<ja>
cyberfawkes: yes, instead of the while
<cyberfawkes>
lol why two spaces?
<ja>
it’s The Ruby Way™
<ja>
because ruby is so tight
<ja>
it only needs two spaces
<cyberfawkes>
lol there is a lot of ruby qwerks.
<cyberfawkes>
Like 0 for example...
<cyberfawkes>
0 == nil
<cyberfawkes>
False
<cyberfawkes>
IT'S TRUE DAMMIT
<cyberfawkes>
xD
<ja>
indeed, good sir
<ja>
OF COURSE IT'S NOT!
<cyberfawkes>
I'm so use to C, and Python.
Meow-J has quit [Quit: Connection closed for inactivity]
<ja>
ah :D
<cyberfawkes>
Whereas 0 is null.
troys has quit [Quit: Bye]
<ja>
… at least not PHP ^_^
<cyberfawkes>
heh
<ja>
wait, 0 is null in Python‽
<cyberfawkes>
yes
<cyberfawkes>
well zero, is zero.
emilkarl has joined #ruby
<cyberfawkes>
it doesn't exist.
<cyberfawkes>
it's not a value.
<ja>
but comparing it to null yields true‽
<blubjr>
haha the other day i made the dumbest mistake, i forgot to initialize an array, and then i was seeing that it was nil when i wanted it to be [], but i do a lot of lisp so that didnt register as a problem to me
<ja>
lol, blubjr
<ja>
almost makes me wish some kind of Lisp-Ruby hybrid existed
<cyberfawkes>
hmm, I am wrong.
<cyberfawkes>
0 == None
<cyberfawkes>
Yields False
yoongkang has quit [Ping timeout: 244 seconds]
<ja>
Good! :X
nso95- has quit [Remote host closed the connection]
diegoaguilar has quit [Ping timeout: 272 seconds]
<ja>
cyberfawkes: `guess_count = guess_count + 1` could be shortened to `guess_count += 1`
<cyberfawkes>
hmm, I've only seen people using Textual making faces like that. heh
<ja>
yes! why did you think I was using Textual? :o
<ja>
oh
<ja>
haha
<shevy>
aha
<shevy>
I don't see it, it must be unicode :)
shock_one has quit [Ping timeout: 276 seconds]
<cyberfawkes>
I'm using irssi on my fedora server :)
<ja>
welcome to the twenty-first century, shevy! :3
rcerny has joined #ruby
TomyWork has joined #ruby
<cyberfawkes>
ssh + tmux + irssi = life
<shevy>
geek + geek + geek = triple geek
<ja>
oh man, i really need to get off screen and onto tmux
<cyberfawkes>
ja: I made the switch yesterday.
<cyberfawkes>
it's a pain at first.
<ja>
cyberfawkes: if you're ever annoyed about timed out ssh sessions when reopening your laptop, or if you're often on crappy cell connections: give mosh a try — it's incredibly great!
roshanavand has quit [Remote host closed the connection]
<shevy>
mosh? is that a shell?
<ja>
what's painful about it, cyberfawkes? remembering to hit ^b instead of ^a? :D
<cyberfawkes>
my suggestion is to change the bind key from C-b to C-a
<cyberfawkes>
fucking emacs-like modifiers...
<ja>
shevy: it's a layer on top of ssh that adds roaming and latency compensation
<cyberfawkes>
ja: I fixed that lol
<cyberfawkes>
now it's a+d :)
hxegon has quit [Quit: leaving]
jmdade has joined #ruby
<rcerny>
hi, could anyone give me a hand? Trying to learn ruby by completing a small project. I have a hash and am trying to fill erb template. Can’t find correct syntax to render the value instead of key /shy
<ja>
lol one of the main reasons I wanna move to tmux is so I can use ^a/^e as “Home”/“End”
<cyberfawkes>
^?
jondot has joined #ruby
<ja>
sorry, C-a/C-e
<cyberfawkes>
ah
<ja>
or not “home” and “end”, maybe. more like “go to beginning of line” and “go to end of line”
<cyberfawkes>
I wish tmux used vi like commands/keys
<cyberfawkes>
instead of emacs
<cyberfawkes>
who the heck uses emacs anyway?
<ja>
like with the modes vi has?
<cyberfawkes>
s/vi/vim
* ja
is pretty sure richard stallman uses emacs
<ja>
so that's one person…
<cyberfawkes>
well Richard Stallman is a pretentious douche. lol
<ja>
hahaha, yeah, well… you know what they say…
<cyberfawkes>
ermagherd it's GNU/Linux!!!!!
skade has quit [Quit: Computer has gone to sleep.]
<cyberfawkes>
Stop trying to make GNU/Linux happen... it's not going to happen.
roshanavand has joined #ruby
emilkarl has quit [Quit: emilkarl]
jondot has quit [Client Quit]
agit0 has joined #ruby
<ja>
Yeah, they should focus on GNU Hurd instead
<baweaver>
that's quite enough of that
<ja>
“Latest release: 0.7 / 31 October 2015; 15 days ago” — wow, seems like they are!
<baweaver>
no need to rant about
<cyberfawkes>
baweaver: who's ranting?
rcerny has quit [Quit: rcerny]
<cyberfawkes>
In retrospect I probably should've installed OpenBSD, or CentOS on my server instead of Fedora. :/
<ja>
why not RubyOS? :>
<cyberfawkes>
So I don't have to upgrade versions every 6 months.
<shevy>
ja we don't have enough ruby code yet
scripore has joined #ruby
<ja>
dang it :<
scripore has quit [Client Quit]
<ja>
but we have the technology!
<baweaver>
tmux has vi keybindings anyways
<cyberfawkes>
Although OpenBSD would've pissed off a few of my friends. XD
<baweaver>
bindkey -v
vire has quit [Ping timeout: 240 seconds]
<baweaver>
probably want to rebind ctrl-r for backsearch though
<cyberfawkes>
My PDF reader, and Chrome allow me to scroll with hjkl. It's amazing.
leat has quit [Ping timeout: 265 seconds]
<baweaver>
you scroll a line / char at a time?
pawnbox has joined #ruby
emilkarl has joined #ruby
pawnbox_ has joined #ruby
<cyberfawkes>
heh, no.
pawnbox has quit [Read error: Connection reset by peer]
<cyberfawkes>
it's similar to use a scroll pad on a laptop in a way.
<cyberfawkes>
Vimium for Chrome <3
<cyberfawkes>
s/use/using
<cyberfawkes>
ja: personally I don't see any real differences in tmux from screen. At least for irssi anyway.
<cyberfawkes>
the status bar is quite annoying, but I got rid of that.
blaxter has joined #ruby
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sandstrom has quit [Quit: My computer has gone to sleep.]
<shevy>
awwww python
<shevy>
def greeting(name: str) -> str:
pawnbox_ has quit [Ping timeout: 255 seconds]
akem has quit [Ping timeout: 246 seconds]
SCHAAP137 has joined #ruby
rdavila has joined #ruby
scripore has joined #ruby
vire has joined #ruby
yfeldblum has joined #ruby
<cyberfawkes>
dammit!!!!
<cyberfawkes>
agent_white: -_-
joonty has joined #ruby
<cyberfawkes>
ja: this was in the .vimrc file agent_white sent me "Set TAB to be turned into spaces - "2" becuz... Ruby! But can be turned into 4 for Python, etc."
mooe has joined #ruby
vire has quit [Client Quit]
rdavila has quit [Client Quit]
roshanavand has quit [Remote host closed the connection]
InvGhost has joined #ruby
moeabdol has joined #ruby
Hounddog has joined #ruby
ledestin has quit [Ping timeout: 265 seconds]
maloik has joined #ruby
roshanavand has joined #ruby
yoongkang has joined #ruby
moeabdol has quit [Ping timeout: 260 seconds]
<cyberfawkes>
what's with all of the joins/quits in this channel?
<ja>
cyberfawkes: so you weren't a totally poweruser of screen before?
KensoDev has quit [Remote host closed the connection]
leat has quit [Quit: leat]
leat has joined #ruby
bersimoes has joined #ruby
leat has quit [Client Quit]
UtkarshRay has joined #ruby
leat has joined #ruby
myztic has joined #ruby
leat has quit [Client Quit]
leat has joined #ruby
<leat>
uit
Rollabunna has quit [Ping timeout: 250 seconds]
leat has quit [Client Quit]
Spami has joined #ruby
TvL2386 has joined #ruby
Mon_Ouie has quit [Ping timeout: 244 seconds]
leat has joined #ruby
leat has quit [Client Quit]
nfk|laptop has joined #ruby
skcin7 has joined #ruby
<shevy>
a question
<shevy>
on linux, for GNU configure based projects... if I do:
poguez_ has quit [Quit: Connection closed for inactivity]
<shevy>
result = `./configure` # eg run a configure script
<shevy>
will this use a specific PID (process id)?
<shevy>
(The above code is then run in ruby of course)
lkba has quit [Ping timeout: 260 seconds]
InvGhostt has quit [Ping timeout: 240 seconds]
baweaver has joined #ruby
Rollabunna has joined #ruby
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leat has joined #ruby
leat has quit [Client Quit]
leat has joined #ruby
CodingWolf has quit [Ping timeout: 246 seconds]
moeabdol has quit [Ping timeout: 244 seconds]
baweaver has quit [Ping timeout: 272 seconds]
<shevy>
hmmm
tubulife- has joined #ruby
<shevy>
running configure like that seems to spawn one instance of "gcc" which probably also spawns up "cc1"
<shevy>
at least ps ax says that
Trynemjoel has quit [Ping timeout: 264 seconds]
Gadgetoid has quit [Ping timeout: 272 seconds]
kimegede has quit [Excess Flood]
kimegede has joined #ruby
tubuliferous_ has quit [Ping timeout: 272 seconds]
unreal has quit [Ping timeout: 272 seconds]
freedrull has quit [Ping timeout: 272 seconds]
Pumukel has joined #ruby
freedrull has joined #ruby
unreal has joined #ruby
Gadgetoid has joined #ruby
kerunaru has joined #ruby
<BLuEGoD>
AR/Arel related. I have a STI model which has a many to many relationship through a mapping table, such as Stis <-> Things. I want to do Sti.joins(:things) but is complaining about the parent model parent.thing_id does not exist... Any idea how to achieve this?
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Nahra has quit [Ping timeout: 246 seconds]
<apeiros>
?rails BLuEGoD
<ruboto>
BLuEGoD, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<yorickpeterse>
morning
rodfersou has joined #ruby
loechel has joined #ruby
Pumukel has quit [Ping timeout: 240 seconds]
bersimoes has quit [Read error: Connection reset by peer]
<BLuEGoD>
technically it's related to AR/Arel gems and not to Rails, but fair enough.
loechel is now known as Pumukel
nettoweb has joined #ruby
certainty|mobile has quit [Ping timeout: 240 seconds]
<apeiros>
!fact add ?ar For activerecord/arel questions , please join #RubyOnRails, since they're maintained as a part of it. Note: you need to be identified with NickServ, see /msg NickServ HELP
* apeiros
grumbles
<apeiros>
!fact add ar For activerecord/arel questions , please join #RubyOnRails, since they're maintained as a part of it. Note: you need to be identified with NickServ, see /msg NickServ HELP
<ruboto>
apeiros, I will remember that ar is For activerecord/arel questions , please join #RubyOnRails, since they're maintained as a part of it. Note: you need to be identified with NickServ, see /msg NickServ HELP
* apeiros
was silly
* apeiros
hopes this gets rid of the repeat "but this is only AR/arel, not rails" :)
<apeiros>
!fact ed ar For activerecord/arel questions, please join #RubyOnRails, since they're maintained as a part of it. Note: you need to be identified with NickServ, see /msg NickServ HELP
<ruboto>
apeiros, I stand corrected that ar is For activerecord/arel questions, please join #RubyOnRails, since they're maintained as a part of it. Note: you need to be identified with NickServ, see /msg NickServ HELP
bersimoes has joined #ruby
KnownSyntax has quit [Quit: Connection closed for inactivity]
doddok has joined #ruby
ych has joined #ruby
ych is now known as Guest58727
pawnbox has quit [Remote host closed the connection]
doddok has left #ruby [#ruby]
pawnbox has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
dmolina has joined #ruby
<Guest55224>
i am getting utc date conversion error
<Guest55224>
here is code processedtime.in_time_zone(TZInfo::Timezone.get('UTC'))
doddok has joined #ruby
<apeiros>
in_time_zone - that sounds like rails?
dionysus69 has joined #ruby
prolink has quit [Quit: Page closed]
subscope has joined #ruby
arup_r has joined #ruby
rizli has joined #ruby
rizli has left #ruby [#ruby]
rizli has joined #ruby
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
doddok has quit [Quit: Leaving]
<Guest55224>
<apeiros> yes
rizli has left #ruby [#ruby]
rizli has joined #ruby
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rizli has left #ruby [#ruby]
rizli has joined #ruby
roshanav_ has joined #ruby
roshanav_ has quit [Remote host closed the connection]
cwong_on_irc has quit [Quit: Leaving.]
roshanavand has joined #ruby
exadeci has quit [Quit: Connection closed for inactivity]
roshanavand has quit [Remote host closed the connection]
<apeiros>
?rails Guest55224
<ruboto>
Guest55224, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dimasg has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
Guest55224 has left #ruby [#ruby]
will_wielder has joined #ruby
TPBallbag has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
bersimoes has quit [Read error: Connection reset by peer]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brt has joined #ruby
bersimoes has joined #ruby
gustav_ has joined #ruby
Nahra has joined #ruby
karapetyan has quit [Remote host closed the connection]
platzhirsch has joined #ruby
roshanavand has joined #ruby
axsuul has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
<Bish>
hi fans, i want to parse a hash with JSON.parse and get notified about every change on that resulting hash, is there a way i can accomplish this
rizli has quit [Quit: Leaving.]
<Bish>
i overloaded []=, but that doesn't catch the case of obj[][]=, any ideas?
howdoicomputer has quit [Ping timeout: 260 seconds]
<Bish>
Ox0dea, yes
codecop has joined #ruby
favadi has joined #ruby
<Ox0dea>
It's not the worst approach to syncing a Hash with disk, but that's hardly the best idea. :P
InvGhostt has quit [Ping timeout: 260 seconds]
jondot has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Bish>
>> module T class X def Hash.whopidu true end p Hash.instance_methods(:whopidu) end
<ruboto>
Bish # => /tmp/execpad-f3ce9e860e70/source-f3ce9e860e70:2: syntax error, unexpected keyword_def, expecting '<' ...check link for more (https://eval.in/475736)
<Bish>
>> module T; class X; def Hash.whopidu; true; end; p Hash.instance_methods(:whopidu); end
<ruboto>
Bish # => /tmp/execpad-793d859332eb/source-793d859332eb:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/475737)
<Ox0dea>
So much confusion in that snippet.
<Ox0dea>
Bish: Please stop. That won't do at all what you seem to think it will.
<ljarvis>
what's with the argument to instance_methods
<Ox0dea>
A fundamental misunderstanding.
<ljarvis>
I see
<ljarvis>
Bish: see docs on instance_methods, it doesn't take a symbol
<Bish>
well, either way, you can see it, i might get something wrong
<Bish>
but to me it looks right, and cool :P
<ljarvis>
what looks cool?
<Bish>
being able to overload basic functions just for one class
<Bish>
but Ox0dea tell sme im wrong, so i probably am
<ljarvis>
it's not overloading
<ljarvis>
just fyi
Xeago has quit [Remote host closed the connection]
<Ox0dea>
Bish: You're just adding a method to Hash itself, not instances thereof.
<Ox0dea>
I was showing you how to override one of those instances on any given Hash.
Gnut has joined #ruby
<huyderman>
Actually, he's defining a new class T::X::Hash...
<ljarvis>
tehe
<ljarvis>
Ruby, not even hash
Guest75108 has quit [Remote host closed the connection]
curses has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Bish>
but the original Hash stuff gets copied?
<huyderman>
Bish: No
<ljarvis>
you can confirm it quite easily in your code
<Bish>
oh i see... that's why i think it's awesome
<Bish>
yeah ofcourse, just didn't think of it
<Ox0dea>
Bish: `Hash` refers to two different things on Lines 9 and 11 in your most recent snippet.
<ljarvis>
anyway monkey patching is like kicking babies
<ljarvis>
fun but unkind
<ljarvis>
wait
<huyderman>
lol
ta has joined #ruby
atomical_ has joined #ruby
Xeago has joined #ruby
arup_r has joined #ruby
Jardayn has joined #ruby
<huyderman>
Bish: Just save yourself the trouble and make a new class, rather than funky monkey-patching. It's much easier and cleaner, and you'll save yourself alot of trouble debugging later...
lurch_ has quit [Quit: lurch_]
<Ox0dea>
I think providing a custom definition of #[]= on some Hash makes perfect sense in some cases.
Torrieri has joined #ruby
lurch_ has joined #ruby
<Ox0dea>
What's the harm?
<ljarvis>
I couldn't even tell that that was the goal
troulouliou_div2 has joined #ruby
<ljarvis>
or is that just a rebutal
davedev24 has joined #ruby
<ljarvis>
rebuttal*
<Ox0dea>
It's unclear exactly what Bish is going for, to be frank.
tomaz_b has joined #ruby
<ljarvis>
I agree, to be Bill.
atomical has quit [Ping timeout: 255 seconds]
<huyderman>
I *think* ha want's to read from a JSON to a hash, and have that hash automagically persist itself when you change the values
gustav_ has joined #ruby
jondot has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ljarvis>
seems reasonable
araujo has quit [Ping timeout: 250 seconds]
<Ox0dea>
Seems like a perfect use case for defining #[]= on some Hash's singleton class, yeah?
B1n4r10 has joined #ruby
dhjondoh has joined #ruby
araujo has joined #ruby
<ljarvis>
sure, I mean.. I'd prolly create a wrapper but i like rappers
<Ox0dea>
`HashWithPersistedUpdate`?
<tomaz_b>
hi guys .. i have one newbie question... i would like to use Dir.mktmpdir for some process... to create a temp dir and some stuff around this. The problem is that i would like to specify in which directory I would like this temp dir. But the system... or code is creating this temp folder in a /var/something/bla/bla and if i want to specify my directory for this temp folder i get errors around /moj/path/var/tempfolder...
<ljarvis>
`ActivePersistedActionHash`
<Ox0dea>
Ha.
RobertBirnie has joined #ruby
<tomaz_b>
can somebody plese suggest how to specify a directory for tempfolders...
Kendos-Kenlen has joined #ruby
dwithers has joined #ruby
<Ox0dea>
tomaz_b: You want a self-destructing temporary directory, yes?
araujo has quit [Max SendQ exceeded]
<tomaz_b>
yes
<Ox0dea>
tomaz_b: And you don't want the convenience of it living in /tmp for just that purpose?
<tomaz_b>
yes
<Ox0dea>
Why
<ljarvis>
then specifying your own directory won't allow this
varunwachaspati has joined #ruby
<ljarvis>
what if the program crashes? use /tmp
<Ox0dea>
!next
<ljarvis>
!prev
<varunwachaspati>
just curious, Is subtyping supported in ruby?
araujo has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yorickpeterse>
varunwachaspati: there's class inheritence
<ljarvis>
that's a bucket of worms. Lunch time bbiab
<tomaz_b>
ok... problem solved...
<yorickpeterse>
and modules that can be included
<ljarvis>
tomaz_b: horray
tomaz_b has quit [Quit: Leaving]
<ljarvis>
hooray
<ljarvis>
or something
araujo has quit [Max SendQ exceeded]
bersimoes has joined #ruby
<varunwachaspati>
I know subclassing/inheritance is a way through which subtyping is implemented
araujo has joined #ruby
<varunwachaspati>
can someone show me simple code which exhibhits subtyping
<Ox0dea>
varunwachaspati: Do you mean subclassing?
User458764 has joined #ruby
_stu_ has joined #ruby
<yorickpeterse>
varunwachaspati: class A < B; end
<Bish>
huyderman, ofc im saving myself the trouble, but i want to understand how it works
<varunwachaspati>
nope subtyping
<apeiros>
varunwachaspati: classes aren't types.
<Bish>
why does overloading hash in main work?
<Ox0dea>
Bish: Because at the top level, `Hash` refers to the Hash we all know and love.
<varunwachaspati>
apeiros: so then ruby doesn't support subtyping
Gnut has quit [Ping timeout: 240 seconds]
<Ox0dea>
varunwachaspati: Ruby doesn't even have types in the general sense of the word.
<apeiros>
ruby doesn't have types, and consequently no subtyping.
<Bish>
but i can make an instance of "Hash we all know and love" in any module/class
<Ox0dea>
Bish: Yes, because constant resolution.
<Bish>
sounds like a song name to me
<Ox0dea>
Sounds like a way to resolve the names of constants to me.
<yorickpeterse>
ugh, the hardest thing in programming: asserting thread-safety
kobain has joined #ruby
<Ox0dea>
>> module M; Hash = Class.new; Hash == ::Hash; end # Bish
Rollabunna has quit [Remote host closed the connection]
<Ox0dea>
Bish: There, `Hash` alone refers to `M::Hash`, whereas `::Hash` circumvents constant resolution to explicitly refer to the one available at the top level.
<shevy>
long live ruby \o/
<Ox0dea>
Living is dead! Long live long living!
<shevy>
yorickpeterse I thought the hardest thing is finding a good name
moeabdol has quit [Quit: WeeChat 1.3]
bersimoes has quit [Remote host closed the connection]
<yorickpeterse>
that and off by one errors
joonty has joined #ruby
Xeago has quit [Remote host closed the connection]
Gnut has joined #ruby
<Ox0dea>
The hardest thing in computer science is my REDACTED.
moeabdol has joined #ruby
gambl0re has quit [Ping timeout: 264 seconds]
<Bish>
Ox0dea, would you rather A) overwrite []= for each instance of Hash B) create my own class, and copy the contentsw
howdoi has quit [Quit: Connection closed for inactivity]
dwithers1 has joined #ruby
<Ox0dea>
Bish: Oh, I hadn't caught that you've got more than one.
<Ox0dea>
If that's the case, the latter certainly makes more sense.
<Bish>
well, basicially it is one, but they're nested
dwithers has quit [Read error: Connection reset by peer]
yoongkang has joined #ruby
pawnbox has joined #ruby
<Bish>
does that man i could do
<Bish>
class Hash < Hash :D
failshell has joined #ruby
InvGhostt has joined #ruby
<Ox0dea>
Bish: That does thicken the plot a little, but you're probably still better off creating a class for the sake of clarifying intent.
Gnut has quit [Ping timeout: 260 seconds]
tomaz_b has joined #ruby
<Bish>
i just want to understand!
<shevy>
cool Bish
<shevy>
class String < String
<shevy>
I don't think I have seen this before
tomaz_b has quit [Remote host closed the connection]
* Bish
is a clever boy
<Ox0dea>
Bish: When wouldn't that work? :P
<shevy>
>> class Hash < Hash; end
<ruboto>
shevy # => superclass mismatch for class Hash (TypeError) ...check link for more (https://eval.in/475771)
<shevy>
haha! it is its own wrong superclass!!!
<Ox0dea>
That's right, shevy. At the top level.
andikr has quit [Remote host closed the connection]
<havenwood>
JSON::GeneratorError: 839: NaN not allowed in JSON
RegulationD has joined #ruby
<Ox0dea>
Diabolik: More or less.
certainty|mobile has joined #ruby
<profsimm>
Diabolik: check out TypeScript
<Ox0dea>
profsimm: Diabolik is not likely to be at liberty to do so.
avril14th has quit [Remote host closed the connection]
<profsimm>
Ox0dea: if he simply presumed he's not at liberty to do so before he even asks, the one restricting their freedom is themself.
RobertBirnie has quit [Read error: Connection reset by peer]
<profsimm>
The grammar in my previous sentence is criminal.
<profsimm>
But you get the point.
howdoicomputer has quit [Ping timeout: 260 seconds]
* havenwood
waits on Perl6Script transpiler
RegulationD has quit [Ping timeout: 255 seconds]
freerobby has quit [Ping timeout: 276 seconds]
<Ox0dea>
profsimm: Our "at liberty to do so"s lined up.
blaxter has quit [Quit: foo]
yes`r has quit [Ping timeout: 240 seconds]
aganov has quit [Quit: Leaving]
<Ox0dea>
In any case, I was only facetiously harkening back to their having picked up JS for work.
sanjayu has quit [Ping timeout: 240 seconds]
tk__ has quit [Quit: ばいばい]
RobertBirnie has joined #ruby
<Ox0dea>
Om Next is React + immutable data structures and it's faster. I think Uncle Bob wasn't far off the mark in calling Clojure the "hundred-year language".
akem has quit [Ping timeout: 250 seconds]
<profsimm>
Ox0dea: I'm not sure we can talk about "faster" because one runs in browsers and the other isn't available for browsers
<Ox0dea>
s/faster/more performant/ in the interest of technical accuracy.
tagrudev has quit [Remote host closed the connection]
<Ox0dea>
profsimm: ClojureScript is very much a thing.
<havenwood>
profsimm: ClojureScript is quite nice!
<profsimm>
Ox0dea: yes but it's not "faster" is it. It's compiled to JS
<Ox0dea>
profsimm: David Nolen's benchmarks speak quite for themselves.
<apeiros>
javascript runs just fine outside of browsers too
freerobby has joined #ruby
<profsimm>
apeiros: we're discussing React, where you can use parts of it outside a browser, but it largely makes no sense.
<Ox0dea>
profsimm: That's the beauty of it! ClojureScript *does* transpile to JS, and yet Om Next's use of immutable data structures permits it to outperform "native", so to speak.
<profsimm>
Ox0dea: that makes no sense.
<Ox0dea>
profsimm: Are you asking me to do your research for you?
maikowblue has joined #ruby
<profsimm>
Ox0dea: no I'm just asking you back up your statements I guess.
norc has joined #ruby
dhollinger has joined #ruby
<profsimm>
Ox0dea: React is also based on immutable data structures internally. Whether they do it well is another thing.
stannard has joined #ruby
nfk|laptop has quit [Ping timeout: 252 seconds]
<profsimm>
Ox0dea: but when it hits the V8, it's V8 opcodes, and no language can "outperform native" as that language doesn't even exist at the point it's compiled to opcodes.
elaptics`away is now known as elaptics
<Bish>
why is ClojureScript so cool?
<Diabolik>
^
<Bish>
i mean i love lisp, but what's so great about it
<Bish>
inb4 it's not lisp, that's not what i mean
<profsimm>
Bish: it's not popular as a mainstream language therefore it' cool. Don't you know your Hipster 101
<profsimm>
You can cut the dramatic suspense with a knife in 'ere
Shizus has joined #ruby
ych has joined #ruby
<apeiros>
I suggest to drink it. suspense is tasty and very refreshing.
<profsimm>
Soon we'll know how ClojureScript outperforms the platform it runs on by doing what React already does
<Ox0dea>
profsimm: You have implied that you wish to be treated like an infant, and so I shall refrain from overloading your delicate circuitry until such time as you have indicated that you are ready for the next step in this phase of your enlightenment.
ych is now known as Guest92956
<apeiros>
Ox0dea: moderate your tone please.
podman has joined #ruby
<profsimm>
Ox0dea: I wish to be treated like an infant, because you want to state bold claims and then tell me "prove my point for yourself"
<profsimm>
Ox0dea: that's not how logic works my friend
<Ox0dea>
profsimm: Ctrl-F is not a terribly difficult chord to execute.
<Ox0dea>
Nor is "benchmark" a particularly troublesome word to type.
<Ox0dea>
You can do this.
<Ox0dea>
I have faith in you.
<profsimm>
Ox0dea: there's no such word in the page you linked me to
<profsimm>
Ox0dea: also your troll is weak, and so... see ya
<Ox0dea>
apeiros: Help! I'm being trolled!
nfk|laptop has joined #ruby
ItSANgo__ has quit [Quit: Leaving...]
<Shizus>
Hello, if I define a constant in a class, is this constant allocated everytime I instantiate an object of the given class?
<Bish>
so does uranium. don't want it near me, tho
colegatron has joined #ruby
<Shizus>
Good, thank you Ox0dea
sankaber has joined #ruby
<Ox0dea>
Shizus: Happy to help.
<profsimm>
apeiros, Ox0dea those benchmarks compare Om and React on *one side* and Backbone on the *other*, suggesting Om and React operate in a similar way with similar performance.
<apeiros>
Ox0dea: I don't see that as trolling. I concur with profsimm that if you claim A is faster than B and there's benchmarks to prove it, it's your duty to supply/link them.
<profsimm>
apeiros, Ox0dea: the point under debate was that Om is faster than React.
e7d has quit [Read error: Connection reset by peer]
<profsimm>
apeiros, Ox0dea so I guess there was no point.
<apeiros>
profsimm: I've actually only seen Om vs. Backbone in that last link. so yeah…
<Bish>
but my question is not about clojure :/ it's about languages itself
ItSANgo has joined #ruby
<Bish>
but i am not getting what's cool about react either, so maybe i shouldn't bother
<Ox0dea>
Bish: It doesn't take much of a theoretical leap to realize that we could write a data structure with, say, better cache locality than Ruby's Hash in Ruby itself.
<gregf_>
Bish: Ox0dea is google *ducks*
<havenwood>
Bish: Want to read up on data structures like Clojure is using but not Clojure itself?
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
colegatron has joined #ruby
<norc>
Ah, are we having one of these intense drumstick discussions at the moment?
kerunaru has quit [Ping timeout: 265 seconds]
<havenwood>
norc: Turkey drumsticks?!
Shizus has quit [Ping timeout: 246 seconds]
tulak has quit [Ping timeout: 272 seconds]
Tempesta has quit [Read error: Connection reset by peer]
<Bish>
but since it compiles to js, a programmer could write those things in js, just not that easy, right?
<Ox0dea>
Bish: Just so. :)
Tempesta has joined #ruby
<Bish>
im aware of the fact, that i am asking question i know the answers to, i just want to know
User458764 has joined #ruby
Torrieri has quit [Quit: Be back later ...]
<Ox0dea>
Public validation is good for... something, I guess.
_blizzy_ has joined #ruby
<Bish>
so you're claiming clojurescript compiles good which gets run faster in js because of effects the generated code has on cache/jit or whatever
aeontech has joined #ruby
<Bish>
s/good/good code/
InvGhostt has quit [Ping timeout: 272 seconds]
<Bish>
#ruby-way-offtopic
NeverDie has joined #ruby
gustav_ has quit [Remote host closed the connection]
Torrieri has joined #ruby
Torrieri has quit [Changing host]
Torrieri has joined #ruby
ItSANgo has quit [Quit: Leaving...]
Xeago has quit [Remote host closed the connection]
<havenwood>
Matz said he's not against persistent data structures in Ruby 3.0 it just needs more research.
pawnbox_ has quit [Remote host closed the connection]
Kartikay has joined #ruby
mistermocha has joined #ruby
<Kartikay>
Hi everyone!!
<Kartikay>
What is the analog of the python dir() in ruby?
<gregf_>
.methods?
<Kartikay>
gregf_: Thanks a lot!
mistermocha has quit [Remote host closed the connection]
snockerton has joined #ruby
<Ox0dea>
Kartikay: Are you making the sacred switch? :)
<havenwood>
Kartikay: Or in Pry maybe a: ls
<Kartikay>
Ox0dea: What's that?
<havenwood>
?pry Kartikay
<ruboto>
Kartikay, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting `binding.pry` directly in your source code. Visit https://pryrepl.org/ or get it now with: gem install pry pry-doc
bersimoes has joined #ruby
<Kartikay>
havenwood: Oh thanks, I was just going to ask about analogs of ipython next. How did you read my mind?
<ljarvis>
analogs
<ljarvis>
tehe
<gregf_>
i've never ever used a repl(only a debugger). Kartikay, similar to python -c '', you can do a ruby -le ''
dwithers2 has joined #ruby
gustav_ has joined #ruby
pawnbox has joined #ruby
<gregf_>
s/analogs/something along the lines of/g; # only weak people make fun of others. low on self esteem
beauby has quit [Ping timeout: 252 seconds]
Spami has joined #ruby
codecop has quit [Remote host closed the connection]
<Ox0dea>
Kartikay: Your configuration files should be in `~/.config/sublime-text-3`.
yardenbar has quit [Ping timeout: 265 seconds]
<Ox0dea>
But, well, are you sure you can't change the interpreter from within the GUI?
<Kartikay>
Ox0dea: Ok thanks I found it
<Kartikay>
There is no GUI in sublime
frem has joined #ruby
<Kartikay>
for the setting
beauby has joined #ruby
<Ox0dea>
Are you sure?
djstorm has joined #ruby
antgel has quit [Ping timeout: 265 seconds]
<Kartikay>
Ox0dea: Yes, we have to do all the configuration through text files.
grill has joined #ruby
zotherstupidguy has joined #ruby
antgel has joined #ruby
<Ox0dea>
Kartikay: Ah, right. You want `~/.config/sublime-text-3/Packages/Ruby/Ruby.sublime-build`.
rdark has quit [Read error: Connection reset by peer]
huyderman has quit [Remote host closed the connection]
<Ox0dea>
Something very much like that, at any rate.
<Kartikay>
Ox0dea: Yes, I did it
<Ox0dea>
Nice.
<Kartikay>
SOlved the problem, thanks
jas02 has left #ruby [#ruby]
e7d has joined #ruby
<Ox0dea>
Sure thing.
howdoicomputer has joined #ruby
atomical_ has quit [Max SendQ exceeded]
<Kartikay>
Ok, now a ruby question. I have the following code: file = open(filename); puts file.read; close(file);
<Kartikay>
But close(file) gives me an error
<Ox0dea>
Kartikay: Alas, `open` being available at the top level is an anomaly.
roger_rabbit has quit [Ping timeout: 260 seconds]
<Ox0dea>
It's actually Kernel#open, which is for more than just files. You probably shouldn't use it without a good reason.
<Kartikay>
Ohkk, thanks
<havenwood>
Kartikay: It's common to see the block form of File.open, which self-closes. In this case the simplest might be: file = File.read file
<gregf_>
Kartikay: are you trying to map python to ruby 'literally'?
<havenwood>
(Ignoring my use of `file` twice.)
<Kartikay>
gregf_: No, I'm trying to learn ruby from the book "Learn ruby the hard way"
<Ox0dea>
Somebody stop them!
howdoicomputer has quit [Ping timeout: 252 seconds]
sankaber has joined #ruby
rdark has joined #ruby
platzhirsch has joined #ruby
<havenwood>
Kartikay: The Hard Way is known for not being particularly idiomatic Ruby. But it might be good for a quick introduction coming from Python since it seems like a Pythonista's take on Ruby.
wpp has joined #ruby
<havenwood>
Kartikay: Just keep in mind there might be a nice idiomatic Ruby way to do it! Good to ask here. :)
shinnya has joined #ruby
atomical has joined #ruby
<Kartikay>
Ok, but what is "idiomatic"?
<havenwood>
Kartikay: The way a Rubyist would do it.
s2013 has joined #ruby
<Kartikay>
Nice definition, but if you already dont know Ruby, then how will you explain it?
mmitchell has joined #ruby
nfk|laptop has quit [Quit: yawn]
unreal has quit [Read error: Connection reset by peer]
<Bish>
if im returning an instance of an inner class
<havenwood>
Kartikay: Code that avoids known pitfalls, embraces known advantages, and looks pretty.
<Bish>
will the outside world know about this object?
baweaver has joined #ruby
<Kartikay>
ok, thanks
<Papierkorb>
Bish: yes of course
unreal has joined #ruby
tulak has joined #ruby
Xeago has quit [Remote host closed the connection]
weemsledeux has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rubie has joined #ruby
kerunaru has joined #ruby
RobertBirnie has quit [Ping timeout: 244 seconds]
<Kartikay>
Which book would you recommend for learning ruby if I already know Python, C and Java?
bersimoes has joined #ruby
Xeago has joined #ruby
blueOxigen has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
<havenwood>
Kartikay: Hem, maybe the Well-Grounded Rubyist, Second Edition.
s2013 has quit [Read error: Connection reset by peer]
<Ox0dea>
Bish: You can't hide anything from ObjectSpace. :)
RobertBirnie has joined #ruby
<Ox0dea>
Not without dropping to C, anyway.
JoshGlzBrk has joined #ruby
JoshGlzBrk has quit [Client Quit]
bluOxigen has quit [Ping timeout: 240 seconds]
User458764 has joined #ruby
pdoherty has joined #ruby
<Bish>
ready or not, here i come, you can't hide
<Bish>
nz nz nz
dionysus69 has quit [Ping timeout: 260 seconds]
dorei has joined #ruby
cornerma1 has joined #ruby
davedev2_ has joined #ruby
<Kartikay>
havenwood: Any free ebook?
<Ox0dea>
Kartikay: Are you quite fluent in those other languages?
<Ox0dea>
It's about as far as I've seen Ruby pushed without outside help.
<pipework>
Ah the set_trace_fun method. :D
<Ox0dea>
Bolted-on immutability?! Only in Ruby.
yoongkang has joined #ruby
<pipework>
Oh my god those.
<pipework>
though*
<pipework>
Ox0dea: I thought this was a different article. This is good shtuff for lulz.
scripore has joined #ruby
iateadonut has joined #ruby
rippa has joined #ruby
neonalpine has quit []
cwong_on_irc has joined #ruby
cwong_on_irc has quit [Max SendQ exceeded]
cwong_on_irc has joined #ruby
rubie has quit []
hxegon has joined #ruby
yoongkang has quit [Ping timeout: 252 seconds]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Xeago has joined #ruby
alexherbo2 has joined #ruby
alexherbo2 has quit [Client Quit]
synthroid has quit [Remote host closed the connection]
radgeRayden has joined #ruby
Guest92956 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dviola>
is it possible to use capybara from the CLI? like similar to a phantomjs script
timonv has quit [Quit: WeeChat 1.3]
will_wielder has joined #ruby
<dviola>
or should I just write JS and use phantomjs for that?
CloCkWeRX has joined #ruby
<dviola>
I need to simulate a login and measure the time it takes for the login and write the results in my db, perhaps run that from curl every 15 minutes
<dviola>
err, cron, not curl
s2013_ has joined #ruby
s2013 has quit [Read error: Connection reset by peer]
maloik has joined #ruby
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dviola>
or capybara is actually meant to be used with rspec/minitest?
timonv has joined #ruby
barhum2013 has joined #ruby
<Bish>
geez this shit is not working!
blackmesa has quit [Ping timeout: 260 seconds]
patrick3 has quit [Quit: Leaving]
s00pcan has joined #ruby
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
SCHAAP137 has quit [Remote host closed the connection]
<jhass>
dviola: I don't see a strict requirement of it being used inside a test framework
maloik has quit [Ping timeout: 244 seconds]
sepp2k has joined #ruby
dfinninger has joined #ruby
bersimoes has quit [Read error: Connection reset by peer]
axsuul has joined #ruby
fedexo has joined #ruby
solars has quit [Ping timeout: 240 seconds]
thejamespinto has joined #ruby
will_wielder has left #ruby [#ruby]
codecop has joined #ruby
bersimoes has joined #ruby
s2013_ has quit [Ping timeout: 272 seconds]
Nahra has quit [Ping timeout: 244 seconds]
RobertBirnie has joined #ruby
senayar has joined #ruby
howdoicomputer has joined #ruby
s2013 has joined #ruby
azgil has joined #ruby
howdoicomputer has quit [Ping timeout: 246 seconds]
jbrhbr has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
arup___ has joined #ruby
agent_white has joined #ruby
millerti has joined #ruby
_blizzy_ has quit [Quit: Leaving]
mistermocha has quit [Ping timeout: 240 seconds]
Nahra has joined #ruby
millerti has quit [Max SendQ exceeded]
gregf has quit [Quit: WeeChat 1.3]
Kartikay has left #ruby [#ruby]
tulak has quit [Remote host closed the connection]
mrfoto has quit []
JoshGlzBrk has joined #ruby
arup_r has quit [Ping timeout: 272 seconds]
goodcodeguy has joined #ruby
baweaver has joined #ruby
kies has joined #ruby
TomyWork has quit [Ping timeout: 260 seconds]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JoshGlzBrk has quit [Client Quit]
kerunaru has quit [Ping timeout: 246 seconds]
weemsledeux has joined #ruby
will_wielder has joined #ruby
asas has joined #ruby
symm- has joined #ruby
dfinninger has quit []
baweaver has quit [Ping timeout: 264 seconds]
allcentury has quit [Ping timeout: 240 seconds]
avril14th has joined #ruby
mary5030 has joined #ruby
uber has quit [Quit: bye]
slick has quit [Quit: bye]
mary5030 has quit [Remote host closed the connection]
purplexed- has joined #ruby
purplexed- has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
Xiti has quit [Quit: Xiti]
uber has joined #ruby
Xiti has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
<purplexed->
Hey all. I'm having terrible trouble getting aws-sdk to work properly. I've searched high and low on google with no resolution. I've installed the gems: aws-sdk-core, aws-sdk-resources , and use require 'aws-sdk' .. but it says i can't find the file.
Wsewolod has joined #ruby
wpp has quit [Quit: ZZZzzz…]
towski_ has joined #ruby
synthroid has joined #ruby
s2013 has quit [Ping timeout: 240 seconds]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JoshGlzBrk has joined #ruby
Kendos-Kenlen has quit [Quit: Konversation terminated!]
<jhass>
purplexed-: anything for gem which aws-sdk? how exactly did you install the gems, eg as root while running ruby with another user?
<purplexed->
jhass: sudo gem install ... is how I installed them .. and yes, I'm running ruby as my standard user on ubuntu
amclain has joined #ruby
* purplexed-
facepalms
<purplexed->
thanks jhass
beatboxchad has quit [Remote host closed the connection]
<jhass>
yw
baweaver has joined #ruby
will_wielder has quit [Quit: leaving]
asas has quit [Ping timeout: 272 seconds]
nofxx has joined #ruby
agit0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
allcentury has joined #ruby
TomPeed is now known as pdev_autism
barhum2013 has quit [Quit: barhum2013]
bersimoes has quit [Read error: Connection reset by peer]
gregf has joined #ruby
barhum2013 has joined #ruby
zomgbie has joined #ruby
skweek has quit [Ping timeout: 255 seconds]
shinnya has quit [Ping timeout: 240 seconds]
barhum2013 has quit [Client Quit]
timonv has quit [Ping timeout: 260 seconds]
linuxboytoo has quit [Remote host closed the connection]
<shevy>
hmm... would you rather go with ... class Postinstall ... or ... class PostInstall - it will do some post-install (post-installation) stuff, such as symlinking into some target positions
linuxboytoo has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
senayar has quit []
scripore has quit [Quit: This computer has gone to sleep]
joonty has quit [Quit: joonty]
bersimoes has joined #ruby
<havenwood>
shevy: Two words!
linuxboytoo has quit [Ping timeout: 255 seconds]
<shevy>
hmm
<shevy>
ok
<havenwood>
shevy: It hasn't yet gotten caught in it's own gravity to become hyphenated then eventually joined.
yoongkang has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
<Ox0dea>
shevy: What sort of argument(s) does PostInstall.new take?
<havenwood>
Speaking of Freedom Patching I heard Larry Wall calling it Monkey Typing and kinda like that.
<havenwood>
Duck Typing. Monkey Typing.
certainty|mobile has quit [Remote host closed the connection]
linuxboytoo has joined #ruby
<shevy>
Ox0dea currently only the dataset that describes the given program at hand
allcentury has quit [Ping timeout: 264 seconds]
RobertBirnie has joined #ruby
<shevy>
it now carries its proud new name class PostInstall
<Ox0dea>
I think it's either a bad name or a bad abstraction. :<
lsmola has quit [Ping timeout: 260 seconds]
<shevy>
it's beautiful
jbrhbr has quit [Quit: Leaving.]
<baweaver>
PostInstall refers to an action
<baweaver>
What unit is it working with?
<baweaver>
a task
alexherbo2 has joined #ruby
yoongkang has quit [Ping timeout: 264 seconds]
skade has quit [Quit: Computer has gone to sleep.]
<baweaver>
as the post install, I want to run n tasks to finish
RobertBi_ has joined #ruby
<baweaver>
heck, you could get away with an array of tasks in there even
<shevy>
Ox0dea let me grab a good example similar to LFS
linuxboytoo has quit [Remote host closed the connection]
<dviola>
lots of people have told me to just write JS if I need to simulate some browser usage but I always used capybara just fine for that from ruby, the thing is I need to write some standalone script that will run from cron
<dviola>
will capybara be fine for that
<dviola>
JS is painful for me at this point
jackjackdripper1 has joined #ruby
gregor3005 has joined #ruby
<gregor3005>
hi, short tip. whats the best way to create desktop gui's with ruby?
zacstewart has quit [Remote host closed the connection]
<nofxx>
dviola, you can use phantomjs under the hood -> poltergeist
<gregor3005>
havenwood: i used ruby only to build shell applications
<dviola>
shevy: lol
<havenwood>
gregor3005: aye
<dviola>
nofxx: trying that now, ty
tvw has quit [Remote host closed the connection]
Ox0dea has quit [Quit: WeeChat 1.4-dev]
<gregor3005>
havenwood: thx, i try it
<[spoiler]>
gregor3005: I'd recommend Qt bindings too (not sure how good the bindings are, but I like working with Qt)
casadei has quit [Remote host closed the connection]
<grill>
what exactly does this do? (@results ||= "") << "run"
<havenwood>
gregor3005: Give the samples/ a run, they're some fun ones.
axsuul has quit [Ping timeout: 240 seconds]
<[spoiler]>
grill: creates an empty string if @results is nil, and then appends "run" to that string, if @results wasn't nil, the it tries to append "run" to an existing string (assuming @results is a string)
dancer_ has joined #ruby
<havenwood>
grill: Which parts are confusing? Know what `||=` does?
akem has joined #ruby
<gregor3005>
[spoiler]: is qt recommended for multiple platforms? i try to build a open source solution to the new austrian law about cash systems :-D
<grill>
i do not know what ||= does. It sounds like it's a logical or + and = though
<dviola>
I think Qt itself ships bindings for ruby?
<dviola>
I'm not sure
<[spoiler]>
gregor3005: yes I use Qt for multiple platforms (I need to support Linux and Windows only, though, but I assume it works on Mac, too)
<nofxx>
gregor3005, that's old school... make a web/SaaS thing
<jhass>
x || x = y is the best approximation, yeah
myztic has quit [Ping timeout: 240 seconds]
dancer_ has quit [Disconnected by services]
dancer_ has joined #ruby
<nofxx>
havenwood, ah, ok, don't set it again
<dviola>
nofxx: rack-test requires a rack application, but none was given
<dviola>
I get this for some reason
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
fantazo has joined #ruby
alexherbo2 has quit [Quit: WeeChat 1.3]
<nofxx>
dviola, hm, you need to fool it to think it's on test.... what about mechanize?
howdoicomputer has quit [Ping timeout: 252 seconds]
<nofxx>
not sure it can use phantom but, worth a try
azul has quit [Read error: Connection reset by peer]
<ljarvis>
it cant
<ljarvis>
well, not without hacking
bersimoes has quit [Read error: Connection reset by peer]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dviola>
ljarvis: are you referring to my use case
<nofxx>
ljarvis, any other js enabled solution?
c0m0 has quit [Ping timeout: 240 seconds]
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
darkf has quit [Quit: Leaving]
<ljarvis>
no it's headless, there have been many hack attempts
dionysus69 has quit [Read error: Connection reset by peer]
bersimoes has joined #ruby
dionysus69 has joined #ruby
<ljarvis>
I generally tell people to avoid doing that kind of stuff, mech just isn't built for it
myztic has joined #ruby
grill has quit [Ping timeout: 240 seconds]
<dviola>
nofxx: I got it to work like this but I get that annoying browser window when it runs: http://ix.io/mtT/rb
<dviola>
using the selenium backend
failshell has quit [Remote host closed the connection]
lemur has joined #ruby
maletor has joined #ruby
dancer_ has quit [Disconnected by services]
Nahra has quit [Ping timeout: 272 seconds]
dmolina has quit [Read error: Connection reset by peer]
dancer_ has joined #ruby
dmolina has joined #ruby
dancer_ has quit [Disconnected by services]
<purplexed->
Hi all. I'm having trouble with the Amazon SDK, https://gist.github.com/sonicjolt/a3a4d5f80e9b079cce1f --- for some reason the S3 reference is not working, eventhough I'm writing exactly whats in the example. Can anyone see something blatantly incorrect ?
jackjackdripper1 has quit [Quit: Leaving.]
<dviola>
ljarvis: so it sounds like I'll have to go write js and use phantomjs for this? bah
<joe-998877>
How do I get rid of the [ and ]? Tried results2 = results['tx']; p results2[2..-2]and got nil. New to ruby. Thanks for any insight
blackmesa has joined #ruby
<[spoiler]>
joe-998877: results['tx'][0]
<jhass>
joe-998877: you use p, which calls .inspect on the passed object
<jhass>
joe-998877: the [ ] signal an array
<jhass>
the " " signal a string
<[spoiler]>
what he said ^
<jhass>
joe-998877: so puts results["txt"].first
<joe-998877>
thanks back in a few
jackjackdripper has joined #ruby
B1n4r10 has quit [Ping timeout: 250 seconds]
eyes_not has quit [Quit: Leaving...]
Rollabunna has joined #ruby
nso95- has joined #ruby
nso95- has joined #ruby
skade has quit [Read error: Connection reset by peer]
mostlybadfly has quit [Quit: Connection closed for inactivity]
s2013 has quit [Read error: Connection reset by peer]
<gregor3005>
[spoiler]: when i will use qt you have some good starting points?
<[spoiler]>
gregor3005: I only used C++ Qt, not the Ruby bindings
<[spoiler]>
they seem to be slightly outdated, too (there's Qt 5 now)
AlphaAtom has joined #ruby
<[spoiler]>
gregor3005: you might be better off with a webapp or even using shoes4
off is now known as gremax
blackmesa has quit [Ping timeout: 250 seconds]
nso95- has quit [Remote host closed the connection]
tubuliferous_ has quit [Ping timeout: 260 seconds]
<[spoiler]>
gregor3005: a webapp will be more maintainable anyway (in terms of updates). You won't need to harass your clients to install an update or have some update system in place, not to mention you will have less issues with cross-platform bullshit (that's outside of the framework's scope)
<gregor3005>
[spoiler]: normally i build applications with jsf (java) but today i get the idea to build a fast application which will be used also offline on multiple operation systems. because i like ruby i give it a shot
Rollabunna has quit [Ping timeout: 260 seconds]
B1n4r10 has joined #ruby
lurch_ has quit [Quit: lurch_]
jackjackdripper has quit [Quit: Leaving.]
mistermocha has joined #ruby
dionysus69 has quit [Quit: dionysus69]
shadoi has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
towski_ has quit [Remote host closed the connection]
<gregor3005>
[spoiler]: i played with qtbindings. i think this will to the job in combination with sqlite to solve it. you have some advices to print to a receipt printer, helful gem's?
yeticry has quit [Read error: Connection reset by peer]
roshanavand has quit [Remote host closed the connection]
<apeiros>
[spoiler]: iirc it's relatively new (2.1 or so)
roshanavand has joined #ruby
yeticry has joined #ruby
koba has joined #ruby
roshanavand has quit [Remote host closed the connection]
zapata has joined #ruby
bascht has joined #ruby
ht__ has joined #ruby
ht__ has quit [Client Quit]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<purplexed->
finally got it to work. Seems I was mixing up V1 and V2 of the amazon sdk
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<purplexed->
all it needs now is a require 'aws-sdk' and it works
AndyBotwin has joined #ruby
mistermocha has quit [Ping timeout: 276 seconds]
BillSussman has quit [Ping timeout: 265 seconds]
ht__ has joined #ruby
tulak has joined #ruby
s2013 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
maloik has joined #ruby
lemur has joined #ruby
tulak has quit [Ping timeout: 252 seconds]
s2013 has quit [Ping timeout: 255 seconds]
bersimoes has quit [Remote host closed the connection]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ht__ has quit [Quit: Konversation terminated!]
ht__ has joined #ruby
lemur has quit [Ping timeout: 272 seconds]
<[spoiler]>
apeiros: I had a weird nostalgic moment when you said "relatively new" because 2.1 isn't really that new, but then I remembered using 1.8.6 and when 1.8.7 came out (I think that's around the time I first started using Ruby and joined this channel)
luca768 has quit [Read error: Connection reset by peer]
<[spoiler]>
Which was probably 2 years ago, or so
<[spoiler]>
endofrandom
diegoaguilar_ has quit [Ping timeout: 264 seconds]
troulouliou_div2 has quit [Ping timeout: 252 seconds]
stannard has quit [Ping timeout: 265 seconds]
kerunaru has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
dimasg has joined #ruby
zacstewart has joined #ruby
kirun has joined #ruby
tubuliferous_ has joined #ruby
<[spoiler]>
wat 2008? No way
<[spoiler]>
No. Way.
<[spoiler]>
Actually it kinda makes sense, now that I think about what I was doing in 2008
based_pdev_ has quit [Read error: Connection reset by peer]
baweaver has quit [Read error: Connection reset by peer]
<eam>
as much as the ruby community groans about 1.8 being old you'd think it was cut in the early 90s
ochkoffein has quit [Quit: -----------------------------------------------]
baweaver has joined #ruby
<shevy>
I loved 1.8.x!
<shevy>
I wish I would have started with ruby 1.0
<drbrain>
I think 1.6.6 was my first ruby
<drbrain>
#humblebrag
<[spoiler]>
haha
<eam>
drbrain: around the same for me too
<[spoiler]>
I don't think I actually got serious with Ruby until at least 1.9.3 or so
baweaver has quit [Remote host closed the connection]
<shevy>
you are a late bloomer
B1n4r10 has joined #ruby
<eam>
I only played around with it until 2004 or so, when I tried to port a bunch of nontrivial perl infra to it -- and failed because Socket had some dumb limitations because of how the green threads worked
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
<eam>
iirc the specific issue is that the socket construtor would block until connect() finished
<[spoiler]>
1.9.3 was in 2011, that sounds about right. I probably had like a first contact with Ruby in 2008 or so (I was 15 back then) and then around 2011 started working on a project in Ruby (which had more C than Ruby probably, since it was mostly wrappers around a C project I was working on then)
based_pdev has joined #ruby
cdg has quit [Remote host closed the connection]
<eam>
I didn't work anywhere that seriously used it until 2012
<jbrhbr>
convention question: assuming one understands the precedence rules around &&,||,and,or, is there a consensus about which one is considered more Rubyish in cases where there's no logical difference?
<eam>
jbrhbr: and/or is kinda buggy, best avoided
<[spoiler]>
and and or have weird precedence
<eam>
>> [true or false]
<ruboto>
eam # => /tmp/execpad-b48cc4413b44/source-b48cc4413b44:2: syntax error, unexpected keyword_or, expecting ']' ...check link for more (https://eval.in/475959)
kerunaru has quit [Ping timeout: 244 seconds]
<eam>
[spoiler]: the precedence isn't weird - lower is better in a lot of cases
<jbrhbr>
but you can just learn the precedence.
<jbrhbr>
if it's buggy, that's a much bigger problem :o
<eam>
in perl I strongly prefer and/or for flow control because of it
m8 has joined #ruby
<jbrhbr>
eam: i'm asking for the same reason (perl history)
<eam>
jbrhbr: it'll blow up the parser in a bunch of cases that should work (like the above)
<jbrhbr>
wow
strgbrew has joined #ruby
dimasg has quit [Ping timeout: 255 seconds]
<[spoiler]>
eam: Well, it's not "weird," but I expected it to be the same as && and || when I first tried it
B1n4r10 has quit [Ping timeout: 240 seconds]
<[spoiler]>
although wrapping it () should work (in eam's example)
<eam>
>> def f x; x; end; f(true or false)
<ruboto>
eam # => /tmp/execpad-d5d932ab6d58/source-d5d932ab6d58:2: syntax error, unexpected keyword_or, expecting ')' ...check link for more (https://eval.in/475960)
<[spoiler]>
>>[(tue or false)]
<ruboto>
[spoiler] # => undefined local variable or method `tue' for main:Object (NameError) ...check link for more (https://eval.in/475961)
<jbrhbr>
[spoiler]: a reasonable assumption, but those of us whose innocence has been corrupted by Perl beforehand may see this as less disturbing :p
Archyme has quit [Ping timeout: 240 seconds]
<[spoiler]>
jbrhbr: I admit that I never wrote a line of perl in my life :P
<jbrhbr>
eam: i really appreciate those examples, thanks
<drbrain>
I added NewRelic to our perl app at work, that's the most perl I've written ever
<drbrain>
it was very confusing
<eam>
jbrhbr: otherwise it works just like perl, and I do use and/or for flow control sometimes
<drbrain>
even though it was only 50 lines or so
<eam>
thing() or other_thing()
<eam>
drbrain: what's most confusing about it?
<drbrain>
mostly the debugging side
mices has left #ruby ["Leaving"]
<drbrain>
since I don't know perl I couldn't figure out how to `p some_obj` without much flailing
<[spoiler]>
LOL
<eam>
I like the enforced hungarian notation of basic Hash/Array/Scalar types
<eam>
drbrain: print Dumper $obj :)
<drbrain>
fortunately the app looks something like a rails app, so finding out where to add the instrumentation wasn't hard
rdark has quit [Ping timeout: 260 seconds]
<drbrain>
yeah, but Dumper wasn't available everywhere so there was more flailing getting it to load
<eam>
it ... oughta be. It's core
<jbrhbr>
sorry if i started a language war
<eam>
maybe a rhel system where they screw around and lift core stuff out
<eam>
jbrhbr: hopefully not a war, I'm just curious :)
aryaching has quit [Ping timeout: 244 seconds]
<jbrhbr>
hehe
brt has quit [Ping timeout: 260 seconds]
<jbrhbr>
ok
<[spoiler]>
jbrhbr: we're rubysts. There's no language wars here, unless you mention python or php
<[spoiler]>
(just kidding!)
<mg^^>
I almost always use and/or in a perlish fashion where I want something like x.do_something or abort("it didn't do it")
<mg^^>
and && / || for conditionals
<eam>
perl does not constitute a threat in 2015, I don't think
rodfersou|lunch is now known as rodfersou
<drbrain>
eam: well, I don't know perl, so adjust appropriately
<jbrhbr>
eam: good point :p
<eam>
the history and heritage is super interesting though - I think
roshanavand has joined #ruby
<eam>
drbrain: yeah, I'm just always curious for the hot take of someone who's skilled in a scripting language but doesn't know perl
<[spoiler]>
eam: no threat because ruby is the ultimate supreme language of the universe. You ruby, or you die
<drbrain>
that this app was written by responsible perlers helped a ton
<[spoiler]>
#RubyOrDie!
yoongkang has joined #ruby
<eam>
one thing I wish ruby did that's perlish is to just use def to create a lambda
<mg^^>
as a person who formerly used perl for most things, ruby was a confortable transition
<mg^^>
of course my boss accused me of writing the most readable perl code he's ever seen so...
Peg-leg has quit [Quit: Leaving.]
<[spoiler]>
mg^^: ...so when you switched to ruby, you became a poet?
<jbrhbr>
i'm still trying to understand the scoping rules around ruby lambdas
<[spoiler]>
nobody knows what you meant, but it gets the point across in the end? :P
<jbrhbr>
there's some kind of local scope free variable binding that happens which blew my mind, need to read up on it
<mg^^>
hahaha
<eam>
sub foo {} -> $cb = sub {} -- in ruby this would be like sb = def(a,b); end
<eam>
jbrhbr: the scoping changed *drastically* between 1.8 and newer btw
<jbrhbr>
ok
<jbrhbr>
good times :D
<mg^^>
The big thing about transitioning to Ruby was learning to effectively use blocks to get things done
<[spoiler]>
This reminds me, someone from work asked me to implement something for them (he's a PHP developer). So I implemented in in Ruby in under 2 minutes, but he was like "I don't understand anything that's happening..." and then I spent like an hour copying it to PHP because... not sure if it was PHP's fault or if I'm just overestimating my knowledge of PHP and am actually shit at PHP
alexherbo2 has joined #ruby
<jbrhbr>
so far they seem like an effective way to obfuscate things to me
<mg^^>
now it just seems so natural it's hard to go back
<jbrhbr>
at least the convention of how they are used
<[spoiler]>
it was basically an idea we were talking about (on how to handle something)
cdg has joined #ruby
<eam>
php is a hell of a lot more confusing than perl imo
roshanavand has quit [Ping timeout: 240 seconds]
<drbrain>
I think blocks, enumerable and enumerators are ruby's most powerful features
<cyberfawkes>
I always thought php was quite easy.
<cyberfawkes>
but that was years ago.
bersimoes has joined #ruby
<mg^^>
yeah php takes the worst of Perl and BASIC and mashes them together
<cyberfawkes>
if I had a string, how would I print it multiple times?
<[spoiler]>
drbrain: there was lots of blocks and usage of Enumerable methods in my code lol
<drbrain>
it's a weirdly pleasant merger of functional and OO styles
cdg has quit [Remote host closed the connection]
<eam>
drbrain: coming from perl it was welcome to find 'em -- but they're kinda odd in ruby
<[spoiler]>
that's what confused him probably (and what took me a lot of time to find equivalents in PHP, which didn't exists, so I had to implement them myself)
<[spoiler]>
cyberfawkes: in php?
<mg^^>
I should reimplement my JAPH in Ruby
<jbrhbr>
eam: the penalty on self-documenting code seems hardly worth the weak level of encapsulation that is ostensibly the reason for using blocks during configuration, for example
<cyberfawkes>
no, in ruby.
<cyberfawkes>
lol
Archyme has joined #ruby
<jbrhbr>
but what do i know
<[spoiler]>
n.times { puts "string" }
yoongkang has quit [Ping timeout: 276 seconds]
<jbrhbr>
just trying to make sense of this stuff
<cyberfawkes>
[spoiler]: thank you
lbj_ has joined #ruby
<[spoiler]>
cyberfawkes: there's also `"string " * 5`
<[spoiler]>
but that won't print it 5 times, it will generate a string of `"string string string string string "`
<eam>
jbrhbr: one big reason to use blocks is it allows a destructor to run after the operation
<mg^^>
puts ['string'] * 5
<[spoiler]>
that will also work ^
yqt has joined #ruby
<eam>
jbrhbr: if you're coming from perl, you might be familiar with something like: sub thing { $fh = open(); ....; }
<cyberfawkes>
thanks guys
<[spoiler]>
cyberfawkes: mg^^'s example generates an array of five "string" strings
<eam>
jbrhbr: In perl, the descriptor would be destroyed after thing() runs. In ruby, that will cause a descriptor leak
<[spoiler]>
so ["string, "string", "string, "string, "sting"]
bersimoes has quit [Ping timeout: 260 seconds]
brt has joined #ruby
<[spoiler]>
s/sting/string/
<eam>
the File.open {} syntax lets File do cleanup after the block runs, closing the descriptor
<mg^^>
yeah my example is not efficient
<mg^^>
but it works
fantazo has quit [Ping timeout: 250 seconds]
<[spoiler]>
and when you give `puts` an arry, it will print each element on a new line
<eam>
IMO that's a big part of why the block syntax is so popular in ruby
<mg^^>
you wouldn't want to do it with a large N
<eam>
it lets you fake destructor-style patterns
Archyme has quit [Ping timeout: 250 seconds]
dimasg has joined #ruby
axsuul has joined #ruby
<jbrhbr>
eam: interesting, thanks
lbj_ has quit [Ping timeout: 246 seconds]
arup_r has joined #ruby
akem has quit [Ping timeout: 260 seconds]
palms has joined #ruby
<mg^^>
I've used those destructor type patterns quite a few times myself
palms has left #ruby [#ruby]
ItSANgo has joined #ruby
<mg^^>
set up your resources, yield them to the block, clean them up... very clean way to get things done
yfeldblum has joined #ruby
<[spoiler]>
Yep, agreed
<[spoiler]>
they are really convenient
kadoppe has quit [Ping timeout: 276 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
podman has quit [Quit: Connection closed for inactivity]
DotKite has joined #ruby
linuxboytoo has joined #ruby
prestorium has quit [Quit: Leaving]
kadoppe has joined #ruby
pawnbox has quit [Remote host closed the connection]
BlackCoyote has joined #ruby
toretore has joined #ruby
zacstewart has quit [Remote host closed the connection]
zacstewart has joined #ruby
cdg has joined #ruby
imperator has joined #ruby
juddey has joined #ruby
roshanavand has joined #ruby
fantazo has joined #ruby
<DotKite>
Got a question about procs. Say I have a function called f1 that has a variable a. Now suppose I declare a proc outside of f1 that is meant to maniputlate the data contained in a. If I call the proc with in f1 is the variable a out of scope for the proc?
<cyberfawkes>
Note to self: #!/usr/bin/env ruby fork while fork is probably something I shouldn't have ran... Derp
scripore has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
<mg^^>
hahah
<drbrain>
DotKite: oh, no, a would be out of scope there
<DotKite>
hmmm
<mg^^>
yeah I read that as given proc @my_proc, something like def f1; a = 5; @my_proc.call; end... @my_proc cannot see a
pawnbox has joined #ruby
karapetyan has joined #ruby
<cyberfawkes>
well now that my computer is rebooted...
AlphaAtom has quit [Read error: Connection reset by peer]
<DotKite>
so say i Have a block of code that is just kinda messy and i want to wrap it just so the the function it is "in" just looks nicer, and possilby easier to maintain in the future
<DotKite>
how would i go about doin that?
linuxboytoo has quit [Remote host closed the connection]
<jbrhbr>
just move it to another function?
arthurnn_ has quit [Ping timeout: 240 seconds]
s2013 has quit [Ping timeout: 255 seconds]
linuxboytoo has joined #ruby
<DotKite>
sure, but then wouldnt i have to pass the variables in the original function as arguments?
arthurnn has joined #ruby
Hounddog has quit [Remote host closed the connection]
<DotKite>
wanted to know if there was a way to not have to do that
AlphaAtom has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
<jbrhbr>
if you want to make the enclosing function look nicer by moving the stuff somewhere else with all of its state and things, just making another function seems like the simple way to my ruby noob mind
<jbrhbr>
editors often have an 'extract method' feature which will set up the correct arguments and parameters for you
sigurding has joined #ruby
baweaver has joined #ruby
<[spoiler]>
cyberfawkes: I had to reboot too! Our PCs are reboot buddies because they had a reboot party
elaptics is now known as elaptics`away
Guest73056 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[spoiler]>
but I had to reboot for different reasons :P
AndyBotwin has quit [Quit: Leaving]
diegoaguilar__ has joined #ruby
linuxboytoo has quit [Ping timeout: 272 seconds]
diegoaguilar_ has quit [Ping timeout: 264 seconds]
diegoaguilar__ has quit [Max SendQ exceeded]
diegoaguilar__ has joined #ruby
skweek has joined #ruby
DoubleMalt has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlphaAtom has quit [Remote host closed the connection]
ur5us has joined #ruby
ItSANgo has quit [Quit: Leaving...]
towski_ has quit [Remote host closed the connection]
WillAmes has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
<VeryBewitching>
havenwood: How's the day treatin' ya?
timonv has quit [Ping timeout: 240 seconds]
scripore has quit [Quit: This computer has gone to sleep]
<havenwood>
VeryBewitching: Not too shabby.
AlphaAtom has quit [Ping timeout: 252 seconds]
<VeryBewitching>
Excellent.
Guest5057 has quit [Read error: Connection reset by peer]
Jardayn_two has joined #ruby
based_pdev has quit [Ping timeout: 260 seconds]
Jardayn has quit [Disconnected by services]
Jardayn_two is now known as Jardayn
baweaver has joined #ruby
Rollabunna has quit [Ping timeout: 255 seconds]
ldnunes has quit [Quit: Leaving]
jessemcgilallen has joined #ruby
jessemcgilallen has quit [Client Quit]
axsuul has quit [Ping timeout: 272 seconds]
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
yoongkang has joined #ruby
atomical has joined #ruby
iateadonut has left #ruby [#ruby]
grill_ has joined #ruby
<grill_>
what's the best way to append one array to another
s2013 has quit [Ping timeout: 244 seconds]
<grill_>
and why the asterisk in this example: a1.push(*a2)
minimalism has joined #ruby
jackjackdripper has joined #ruby
lemur has joined #ruby
<canton7>
it's called the "splat operator"
<apeiros>
that's bad
<apeiros>
use concat
<apeiros>
ary1.concat(ary2)
lemur has quit [Read error: Connection reset by peer]
<grill_>
why's it bad?
roshanavand has joined #ruby
<apeiros>
because ruby has to do a lot more than with concat.
lemur has joined #ruby
baweaver has quit [Read error: Connection reset by peer]
<apeiros>
you can bench. with largeish arrays, push(*ary) will be quite a bit slower
braincrash has quit [Ping timeout: 246 seconds]
<grill_>
what does push do and what does concat do
AlphaAtom has joined #ruby
<apeiros>
?ri
<ruboto>
I don't know anything about ri
<apeiros>
aaaah!
<apeiros>
grill_: you know how to use documentation, yes'
<apeiros>
?
<grill_>
i mean, sure. or you could just answer. that's what i'd do if the situation were reversed. or, if i didn't know, i'd say so and then direct them to the documentation
platzhirsch has left #ruby [#ruby]
<apeiros>
hm, but it seems they've optimized that a lot in recent versions
roshanavand has quit [Ping timeout: 240 seconds]
jbrhbr has quit [Quit: Leaving.]
dhollinger has quit [Quit: WeeChat 1.3]
lenwood has joined #ruby
AlphaAtom has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 246 seconds]
AlphaAtom has joined #ruby
lemur has quit [Remote host closed the connection]
<VeryBewitching>
push does what << does
<VeryBewitching>
It adds the array as an element of the array.
<adaedra>
Put parenthesis around #delete argument.
<droptone>
It appears to not like the .delete() call.
lenwood has joined #ruby
<droptone>
Ahh
<droptone>
That did it, awesome adaedra, thank you.
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
malconis has joined #ruby
<adaedra>
Parenthesis can be omitted in number of cases; it doesn't mean that 1/ they're forbidden and 2/ you should remove every single one you can remove.
tomphp has joined #ruby
<havenwood>
Don't remove them when it breaks the interpreter.
dikaio has joined #ruby
<havenwood>
We can agree on that. :)
<pipework>
adaedra: Unless you're from Seattle, then 2 is not correct.
barhum2013 has quit [Quit: barhum2013]
<adaedra>
pf.
law has joined #ruby
ta has joined #ruby
azgil has quit [Ping timeout: 255 seconds]
<law>
hey all, I'm messing around with the IniFile gem, and I notice that I can't use relative paths like '~/'
<law>
instead I have to use '/Users/myuser/.some/path', which is... a PITA
<law>
is there an easy way I can punch that functionality into the gem?
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<droptone>
Sure, I understand, I've just always utilized .delete that way.
<droptone>
Sans-parens
bubbys has joined #ruby
malconis has quit [Client Quit]
azgil has joined #ruby
roshanavand has joined #ruby
pawnbox has joined #ruby
spaceman__ has quit []
deadpoet has joined #ruby
<law>
or am I stuck using File.expand() and friends?
<droptone>
Question: I have an array of hashes, and the hashes contain several values, including "updated_at", which is a string but can be turned into a DateTime object via DateTime.parse().
<droptone>
I want to search the array for the hash entry with the most recent updated_at value.
<droptone>
Any thoughts as to how to approach this?
tomphp_ has joined #ruby
<jhass>
law: File.expand_path
tomphp has quit [Ping timeout: 250 seconds]
<jhass>
law: so yes, you gonna need to call it
uri_ has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
<havenwood>
droptone: How about?: max_by { |h| DateTime.parse h['updated_at'] }
roshanavand has quit [Ping timeout: 240 seconds]
<droptone>
Interesting.
scripore has joined #ruby
<droptone>
so if the array is myarr
uri has quit [Ping timeout: 240 seconds]
<droptone>
The syntax would be myarr.max_by { |h| DateTime.parse h["updated_at"] }
<law>
maybe I should add them as Object: IniFiles instead of converting to hash first
Guest33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
<xybre>
law: are these two configuration files like a /etc/conf.ini and a ~/conf.ini where one may overwrite the values of the other?
Guest33 has joined #ruby
m3_del has joined #ruby
baweaver has joined #ruby
<xybre>
If so then `hash1.merge(hash2)`
<law>
in theory, yes. basically, I'm trying to load AWS credentials into a hash
InvGhost has joined #ruby
<law>
but I have to parse two .ini files (at least) - .aws/config and .aws/credentials. Both have 'default' sections, and may have additional profiles
zacstewart has quit [Remote host closed the connection]
<Radar>
Why are they .ini fiels
<Radar>
files*
<Radar>
Why aren't they .yaml files?
bubbys has joined #ruby
Torrieri has quit [Quit: Be back later ...]
maloik has quit [Ping timeout: 252 seconds]
<law>
I dunno, ask amazon
<Radar>
Convert them to yaml?
baweaver has quit [Ping timeout: 240 seconds]
Marsuper_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Radar>
Then YAML.load_file(file)
<law>
I need this little scriptlet to be interoperable with a pre-existing AWS CLI config
<law>
so a user can have their pre-existing AWS config, my script reads it in, and Does Stuff(tm) with the information
pawnbox has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dionysus69 has quit [Quit: dionysus69]
synthroid has quit []
dionysus69 has joined #ruby
shadoi has quit [Quit: Leaving.]
<Radar>
Ok.
dan3 has joined #ruby
<hxegon>
is there a way to say: if x.nil? or x.empty? or x.something? without referencing x a bunch of times?
<Diabolik>
is there an ELI5 explanation of the actor model anywhere?
cwong_on_irc has quit [Quit: Leaving.]
alvaro_o has joined #ruby
<Radar>
hxegon: are you checking to see if it's blank?
pawnbox has quit [Ping timeout: 260 seconds]
marahin has joined #ruby
<hxegon>
Radar: yes, but more so wondering if there is a clean way to run a bunch of boolean methods like that for an if/whatever statement
<Radar>
hxegon: that's the cleanest way that I know of
<Radar>
ActiveSupport (the gem) has a .blank? method which will condense your `.nil?` and `.blank?` checks.
babblebre has quit [Quit: Connection closed for inactivity]
<hxegon>
Radar: thanks, I already have AS required for other stuff.
<marahin>
Hello! If I want to get a certain interwebs page title - how do I do that? I'm using Mechanize.new(...).title, however it won't work for .pdfs hosted online (and they still have a title, or at least the title = page's host / address). Is there any way around it?
* Radar
sees a question about parsing PDFs to get the titles, runs the other way
Billroot has joined #ruby
<marahin>
hahaha
<hxegon>
Radar: sane choice
baweaver has joined #ruby
<xybre>
marahin: you could use a headless browser..
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<marahin>
Radar, I really would like to avoid that! I guess the **easiest** workaround would be: checking if object has .title method (mechanize runs undefined method if title is missing [e.g. when it's a .pdf]), and if it doesn't, then setting title to nil / address string
TomPeed has joined #ruby
<marahin>
but then, is there any way to check / run a method on an object and see if it returns any value?
<Radar>
marahin: Yeah glhf with getting the titles off PDFs
<Radar>
marahin: object.title.length == 0
Marsupermammal has joined #ruby
<marahin>
Radar, as I've said, NoMethodError: undefined method `title'
<Radar>
marahin: oh that
<marahin>
yeah
lemur has joined #ruby
<Radar>
marahin: object.respond_to?(:title)
dan3 has quit [Remote host closed the connection]
<marahin>
easiest workaround would be to check if method exists
<marahin>
ah!
<marahin>
Radar, thank you very much.
<Radar>
np
mjuszczak has joined #ruby
Billroot has quit [Client Quit]
m3_del has quit [Remote host closed the connection]
diegoaguilar has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
_djbkd has joined #ruby
m3_del has joined #ruby
skade has quit [Read error: Connection reset by peer]
_djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
mistermocha has joined #ruby
skade has joined #ruby
dkam_ has joined #ruby
dkam_ has quit [Remote host closed the connection]
<xybre>
law: oh yeah, some people use awesome_print which does a better job with output, but also trashes the object heirachty with monkey patches.
pawnbox has joined #ruby
axsuul has quit [Ping timeout: 276 seconds]
Trynemjoel has quit [Ping timeout: 250 seconds]
dkam has quit [Ping timeout: 265 seconds]
jessemcgilallen has joined #ruby
pawnbox has quit [Ping timeout: 252 seconds]
Trynemjoel has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sepp2k has quit [Read error: Connection reset by peer]
rodfersou has quit [Quit: leaving]
beauby has quit [Ping timeout: 276 seconds]
roshanavand has joined #ruby
nso95- has quit [Remote host closed the connection]
ebbflowgo has quit [Read error: Connection reset by peer]
lemur is now known as baweaver
ebbflowgo has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
pdoherty has quit [Ping timeout: 240 seconds]
Tempesta has joined #ruby
mary5030 has quit [Remote host closed the connection]
mjuszczak has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
linuxboytoo has quit [Remote host closed the connection]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banister has joined #ruby
nso95- has joined #ruby
nso95- has joined #ruby
ledestin has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
Oatmeal has quit [Ping timeout: 240 seconds]
Gadgetoid has quit [Read error: No route to host]
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Gadgetoid has joined #ruby
nso95- has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
waka has quit [Read error: Connection reset by peer]
JazzyVariable227 has joined #ruby
nso95- has joined #ruby
nso95- has quit [Client Quit]
nso95- has joined #ruby
nso95- has quit [Changing host]
nso95- has joined #ruby
<law>
don't suppose anyone here plays around with the Fog libraries and AWS, do they?
<jhass>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
weemsledeux has joined #ruby
kirun has quit [Remote host closed the connection]
Guest80980 has quit [Read error: Connection reset by peer]
bersimoes has joined #ruby
nso95- has quit [Remote host closed the connection]
<law>
heh, fair enough. I'm familiar with using Fog to connect to Openstack and 'do stuff', but now I'm tasked with making it connect to AWS. Naturally, it's "different", and I can't seem to find much in the way of documentation regarding making Fog play nice with security groups (listing, creating, updating, deleting, etc)
_blizzy_ has quit [Quit: Leaving]
<droptone>
Question: so I'm successfully using max_by to find the entry within my array of hashes that has the most recent updated_at value, but I need to add a seach param for see if "user"=>{"links"=>{"self" == a certain value.