s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cdg_ has quit [Remote host closed the connection]
lytol_ has quit [Remote host closed the connection]
Dimik has quit [Ping timeout: 268 seconds]
AJA4350 has joined #ruby
AJA4350 has quit [Client Quit]
chocoelho has joined #ruby
chocoelho has quit [Remote host closed the connection]
zwliew has joined #ruby
nofxx has joined #ruby
gix has joined #ruby
gix- has quit [Ping timeout: 272 seconds]
scorpiosec has quit [Ping timeout: 248 seconds]
scorpiosec has joined #ruby
slash_nick has joined #ruby
romeoh has quit [Remote host closed the connection]
nso95- has joined #ruby
nso95 has quit [Disconnected by services]
nso95- is now known as nso95
nso95 has quit [Changing host]
nso95 has joined #ruby
slash_nick has quit [Ping timeout: 240 seconds]
Guest29 has joined #ruby
plexigras has quit [Ping timeout: 265 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
c0ncealed has quit [Remote host closed the connection]
plexigras has joined #ruby
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
c0ncealed has joined #ruby
halt has joined #ruby
halt is now known as Guest80953
ramfjord has joined #ruby
d_kam has joined #ruby
pastorinni has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 260 seconds]
Guest80953 has quit [Quit: ZNC 1.6.5 - http://znc.in]
bmurt has joined #ruby
slash_nick has joined #ruby
slash_nick has quit [Client Quit]
dviola has quit [Quit: WeeChat 2.0]
anisha has joined #ruby
konsolebox has quit [Ping timeout: 264 seconds]
konsolebox has joined #ruby
<Vashy>
I want to create a scaffold for the details of a game. Something like: `rails g scaffold MatchDetails`
<Vashy>
Is the pluralness of MatchDetails going to mess things up?
<Vashy>
I'm a rails beginner (also posted in #RubyOnRails)
jenrzzz has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
ur5us has quit [Remote host closed the connection]
iamarun has joined #ruby
halt has joined #ruby
halt is now known as Guest79992
garyserj has joined #ruby
jamesaxl has joined #ruby
<garyserj>
Hi, if I have a string representing a command i'd like to run such as mystr="dir c:\\windows\\system32\\calc.exe" How can I get the output of that command?
LocaMocha has joined #ruby
Guest29 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
what have you tried?
<garyserj>
a=`dir c:\\windows\\system32\\calc.exe` That gets the output but doesn't let me puts my string.
<garyserj>
i'd like to be able to convery mystr to something with backticks
<garyserj>
And i've tried system(mystr) that preserves mystr but it doesn't let me get the output
<mikecmpbll>
given they take the opposite view on arrays/hashes
shinnya has joined #ruby
<mikecmpbll>
i know it doesn't really matter, i don't need to care what someone else chooses as a guide, but i'm interested :D
milardovich has quit []
pdcawley has quit [Ping timeout: 256 seconds]
pikislabis has joined #ruby
Tempesta has quit [Quit: See ya!]
<mikecmpbll>
it becomes especially superficial when you have a method that takes a single hash argument, whereby it will tell you to remove the {}, then subsequently tell you to remove the comma
amatas_ has joined #ruby
Tempesta has joined #ruby
tcopeland has joined #ruby
qba73 has quit [Ping timeout: 255 seconds]
stoffus has joined #ruby
synthroid has joined #ruby
ta_ has quit [Ping timeout: 264 seconds]
_aeris_ has quit [Ping timeout: 248 seconds]
cadillac_ has quit [Ping timeout: 256 seconds]
_aeris_ has joined #ruby
ta_ has joined #ruby
alex`` has quit [Quit: WeeChat 2.0]
jameser has joined #ruby
cadillac_ has joined #ruby
cagomez has joined #ruby
chmuri has quit [Excess Flood]
cagomez has quit [Ping timeout: 240 seconds]
chmurifree has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
KeyJoo has joined #ruby
<apeiros>
syntax quiz: with `foo(<<-END_OF_STRING) {`, what comes first after the newline? the block body or the string literal? :)
cdg has joined #ruby
<ar>
apeiros: string
<apeiros>
ar: 💯
<apeiros>
it's impressively ugly :D
cdg has quit [Ping timeout: 252 seconds]
pikislabis has quit [Quit: pikislabis]
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
<dminuoso>
apeiros: Id guess the string literal.
<apeiros>
dminuoso: : 💯
<apeiros>
I had to try. I didn't know. in the actual case where it came up I solved it by avoiding the situation as it's so ugly to read.
<dminuoso>
apeiros: Did you see my findings in -ot?
<apeiros>
yupp
<marahin>
apeiros could you make a runnable example with the use of that syntax?
<marahin>
:O
<dminuoso>
It's so annoying. :(
<dminuoso>
From now on Ill just use `break` every time.
<dminuoso>
apeiros: It's come to my attention that heredocs are a code smell of a larger underlying problem.
<dminuoso>
It's the refusal to hide interpolation in an abstraction.
<apeiros>
strings in code?
<apeiros>
IMO strings largely don't belong into code.
<apeiros>
but we have no sane mechanics to have them outside of code.
<dminuoso>
Well there are valid use cases like SQL.
<apeiros>
I'm not sure they wouldn't be better outside of code too.
<apeiros>
but I've got bigger beefs with sql anyway.
<apeiros>
"lets talk from machine to machine through a language designed to be used by humans"
<apeiros>
awesome idea.
<dminuoso>
apeiros: SQL is a pretty decent declarative DSL.
<apeiros>
yes. it's still one for humans.
Cavallari has quit [Quit: Cavallari]
<apeiros>
bind variables make it slightly less painful. but only slightly.
cdg has quit [Ping timeout: 255 seconds]
Cavallari has joined #ruby
<apeiros>
the approach I take with my framework btw. is to move any non-trivial sql to the database. use views. use table valued functions.
<apeiros>
makes a couple of things also less painful. but it's still leaky.
<dminuoso>
views.
<dminuoso>
please dont.
<dminuoso>
Ive had enough of views.
Cavallari has quit [Client Quit]
<apeiros>
I'm sorry. but a view is a ton better than MyModel.joins("funny sql").joins("other funny sql").joins(:some_association).where(guess_the_table_name: {col: …})
<apeiros>
even more so if you have funny expressions like rownum over partition, grouped subselects etc.
<apeiros>
(yes, some people have more complex queries than `select * from foos`)
<dminuoso>
apeiros: I think the arel approach is in the right direction.
bhaak has quit [Ping timeout: 265 seconds]
<apeiros>
no. strong disagree.
<dminuoso>
Well it's just executed incorrectly.
<apeiros>
there's *literally* no point in learning a pure abstraction layer if it gains you absolutely *nothing*
<dminuoso>
But I do wonder whether there's a monadic combinator approach.
justicefries has joined #ruby
kedare has quit [Quit: kedare]
<apeiros>
arel is an amazing piece of code. but IMO it's entirely the wrong direction.
<dminuoso>
apeiros: Well the great flexibility of ARel comes from being able to merge nodes.
ur5us has joined #ruby
<dminuoso>
And that's the bit that allows you to think of arel nodes are monoids.
<apeiros>
great. you have a good theory which is destroyed by first contact with reality.
<dminuoso>
So far its been working great for us, but we dont have complexity in depth.
<dminuoso>
We have complexity in width, so in many cases arel does allow for code sharing.
swati_27 has joined #ruby
<apeiros>
look, the very moment you need a piece of sql to hold your arel together, the abstraction breaks and you need to know about complex interactions between two already complex systems
<apeiros>
-> nogo
<dminuoso>
A lot of our queries are structurally similar, they just target different levels of hierarchies.
shinnya has quit [Ping timeout: 264 seconds]
<apeiros>
and if arel wants to get rid of every piece of sql to use in it, it has to map *all* nuances the different sql implementations use
<apeiros>
good fucking luck with that
<dminuoso>
apeiros: Well I opt out and go to raw SQL for any non-trivial queries.
<dminuoso>
I dont pretend to do any joins.where.left_joins.merge.magic.shit.show
<dminuoso>
Because that gets you nowhere, I agree with that.
<dminuoso>
I think we're on the same page in a way.
<dminuoso>
It's just that our needs are mostly covered by arel.
<dminuoso>
Yours probably aren't.
<dminuoso>
(Though things quickly break when you start talking about things like ransack)
<apeiros>
also I'm quite sure I do not want to even learn the arel equivalent of e.g. `select rank over (partition by col) from foos`
<dminuoso>
apeiros: +1
<dminuoso>
Im absolutely with you.
<dminuoso>
Non-trivial queries, screw AR/arel
<ar>
dminuoso: hey!
ur5us has quit [Ping timeout: 265 seconds]
<dminuoso>
Heh.
<apeiros>
see, that's where views + table valued functions come into play
<apeiros>
you can write the sql as nice as possible and all you see from code is "another table"
<dminuoso>
Mmmm.
<apeiros>
that it is aggregated data from "elsewhere" is of no concern to the code anyway. it shouldn't be its concern.
alex`` has joined #ruby
<apeiros>
of course, this boundary also breaks due to e.g. write restrictions. some views you can write, some you can't.
alex`` is now known as alexherbo2
<apeiros>
where I'm with you is wrt building complex where clauses
<apeiros>
+e.g.
alexherbo2 is now known as alex``
DmitryBochkarev has quit [Quit: This computer has gone to sleep]
sameerynho has quit [Ping timeout: 248 seconds]
chocoelho has joined #ruby
<dminuoso>
apeiros: it's interesting, we have had some application that was built around that exact idea. The problem is that you end up baking business logic into views.
<apeiros>
that is a problem
<apeiros>
albeit IMO limited
<apeiros>
given that a view is almost always for read-only, the amount of "logic" in them is necessarily limited
<apeiros>
and usually related to how business logic and persistence logic interact. and persistence is the DBs concern, so it's not that far off IMO
<apeiros>
but yes, still a problem
<apeiros>
there's a list of "business logic" & "persistence logic" interactions I consider problematic and have no clear answer yet.
chocoelho has quit [Remote host closed the connection]
<apeiros>
f.ex. a couple of integrity checks at the db level require application level knowledge
nso95- has joined #ruby
chocoelho has joined #ruby
aupadhye has quit [Ping timeout: 256 seconds]
yeticry has joined #ruby
nso95 has quit [Ping timeout: 240 seconds]
<dminuoso>
apeiros: Well it's a fine line in the end. I have plenty of spots where I willingly bite the bullet and produce N+1 because the code has the right abstraction that way.
<dminuoso>
And its mostly fine, because in most of these cases I can take a 50-100ms hit.
<dminuoso>
(And I know about them, so if it gets out of hands I can refactor)
polishdub has joined #ruby
cdg has joined #ruby
bmurt has joined #ruby
<dminuoso>
apeiros: But at any rate! In my private project Im so glad to be dealing with expression trees. :-)
mjolnird has quit [Remote host closed the connection]
mostlybadfly has quit [Quit: Connection closed for inactivity]
bodgix has joined #ruby
chocoelho has quit [Remote host closed the connection]
<apeiros>
:-)
alfiemax has joined #ruby
oleo has joined #ruby
krawchyk has joined #ruby
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tvw has quit [Remote host closed the connection]
justicefries has joined #ruby
zwliew has quit [Quit: Connection closed for inactivity]
KeyJoo has joined #ruby
ramfjord has joined #ruby
krawchyk is now known as krawchyk[away]
romeoh has joined #ruby
krawchyk[away] has quit [Quit: krawchyk[away]]
JaccoP has joined #ruby
krawchyk has joined #ruby
selim has joined #ruby
vee__ has quit [Ping timeout: 264 seconds]
swati_27 has left #ruby [#ruby]
DmitryBochkarev has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
konsolebox has quit [Ping timeout: 240 seconds]
andikr has quit [Remote host closed the connection]
sameerynho has joined #ruby
konsolebox has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
vee__ has joined #ruby
scmlinux has quit [Ping timeout: 240 seconds]
sundhell is now known as sundhell_away
JaccoP has quit [Ping timeout: 248 seconds]
sotrhraven has joined #ruby
safetypin has joined #ruby
JaccoP has joined #ruby
cdolan has joined #ruby
Rapture has joined #ruby
mr_foto has joined #ruby
cdolan has quit [Quit: WeeChat 2.0]
krawchyk is now known as krawchyk[away]
selim has quit [Ping timeout: 272 seconds]
krawchyk[away] has quit [Quit: krawchyk[away]]
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
c0ncealed has quit [Remote host closed the connection]
<yeoman>
Capybara::Webkit::ConnectionError: /var/lib/gems/2.4.0/gems/capybara-webkit-1.14.0/bin/webkit_server failed to start.
<yeoman>
well not really clean :/
<yeoman>
but thanks for the link
<yeoman>
wasn't the first google result for me
<Papierkorb>
the author compares multiple gems it seems.
ur5us has quit [Ping timeout: 240 seconds]
<yeoman>
lawl.. it does install phantomjs as it's calling a method
<yeoman>
talking about dirty
<yeoman>
usually ruby gems are so tidy
<Papierkorb>
Did you bother scrolling on?
<Papierkorb>
the later ones take like 3 lines in total. Can't get much shorter than that.
<yeoman>
you mean the other gem? yeah trying the first one
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
synthroid has quit [Remote host closed the connection]
<yeoman>
sigh
<yeoman>
ArgumentError: The detector #<struct Cliver::Detector command_arg=nil, version_pattern=nil> failed to detect theversion of the executable at '/usr/bin/phantomjs'
qba73 has quit [Remote host closed the connection]
<yeoman>
QXcbConnection: Could not connect to display
<yeoman>
god i love this.
qba73 has joined #ruby
<Papierkorb>
Well, does phantomjs require a running X?
ramfjord has joined #ruby
<yeoman>
it doesn't but on ubuntu it does
<darix>
yeoman: you will probably need something like Xfvb
<darix>
yeoman: you will probably need something like Xvfb
<yeoman>
and i am using docker.
dmiller85 has joined #ruby
<yeoman>
darix: thanks and.. thanks.
<darix>
had to fix my typo
<yeoman>
didn't even see it, still don't
<yeoman>
oh i see.
<darix>
launching xvfb and then setting DISPLAY accordingly
<darix>
should probably make it work even in docker
Cavallari has joined #ruby
<Papierkorb>
Oh that may be a world of pain. You'll need to figure out how to run xvfb (or some other small X daemon) in docker
<yeoman>
well, no, it's pain because it's ugly
<yeoman>
i need to render html, better load kde.
<Papierkorb>
What has KDE to do with that?
<yeoman>
dafuq thats just bad craftsmanship
<Papierkorb>
Qt != KDE
<Papierkorb>
Like, really nothing to do with one another
<yeoman>
yeah okay, then qt with all the X stuff
<yeoman>
ugly af, still
<yeoman>
i am pretty sure i've run phantom without a running x before.. i am wondering
apeiros has quit [Ping timeout: 264 seconds]
<darix>
yeoman: well you can build your own Qt without the X bindings. then build your phantomjs against that ... and then you can use that stripped down binary
despai has joined #ruby
<darix>
i bet the phantomjs that someone stuffed into a gem
zapata has quit [Read error: Connection reset by peer]
chocoelho has joined #ruby
zapata has joined #ruby
pastorinni has joined #ruby
ta_ has quit [Remote host closed the connection]
<darix>
yeoman: see that link maybe ;)
ta_ has joined #ruby
Keltia_ is now known as Keltia
troys_ is now known as troys
meesles has joined #ruby
Cavallari has quit [Quit: Cavallari]
cagomez has joined #ruby
mr_foto has quit []
VeryBewitching has joined #ruby
metagod has joined #ruby
ruschlem_ has joined #ruby
ramfjord has quit [Ping timeout: 265 seconds]
ruschlem_ has quit [Read error: Connection reset by peer]
romeoh has quit [Remote host closed the connection]
mtkd has quit [Ping timeout: 260 seconds]
jottr has joined #ruby
krawchyk has quit [Quit: krawchyk]
ledestin has joined #ruby
FrostCandy has joined #ruby
mtkd has joined #ruby
krawchyk has joined #ruby
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
MurphyOne has joined #ruby
Serpent7776 has quit [Quit: Leaving]
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
ta_ has quit [Remote host closed the connection]
<metagod>
I wanted to learn more about Classes Modules Inheritance vs Composition any good guide?
mtkd has quit [Ping timeout: 256 seconds]
ta_ has joined #ruby
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
ta_ has quit [Remote host closed the connection]
mikecmpb_ has joined #ruby
krawchyk has quit [Quit: krawchyk]
cdg has quit [Remote host closed the connection]
mikecmpbll has quit [Ping timeout: 240 seconds]
<dminuoso>
metagod: About how it works, or how to utilize it?
<metagod>
how to utilize it
<metagod>
practical part
mtkd has joined #ruby
<metagod>
also is there a way to delete an instance of class ?
<metagod>
def die(victim)
<metagod>
puts "Dying .. . . . . .. . "
<metagod>
#want to delete the object
<metagod>
puts "Dead"
<metagod>
end
<metagod>
I want to kill the victim(object)
<dminuoso>
metagod: It's just like when you were a kid.
<dminuoso>
You leave it on the ground, mommy will vacuum it away when she has time.
<metagod>
?
<metagod>
i want to explicitly delete it i know ruby uses GC
<dminuoso>
You dont.
<metagod>
def kill(victim)
<metagod>
#if victim exists then kill it
<metagod>
die(victim)
<metagod>
if victim.character_name
<metagod>
puts "Killer Joke"
<metagod>
else
<metagod>
puts "Dead already RIP"
<metagod>
end
<metagod>
end
<dminuoso>
Please do not paste in this channel.
<metagod>
sorry
<dminuoso>
You do not want to delete items.
<metagod>
do i paste in Pastebin?
DmitryBochkarev has quit [Quit: This computer has gone to sleep]
<dminuoso>
?gist
<ruby[bot]>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<metagod>
@dminuoso I am making a prototype game form exercise 45 from learn ruby the hard way i am just beginner so in this game i want to make a player kill other player thus deleting the object
<dminuoso>
metagod: So don't focus on deleting objects. That's not the model you need to care about.
<dminuoso>
metagod: You could either track his health status, or keep it in a container and just remove it from the container.
anisha has quit [Quit: This computer has gone to sleep]
alfiemax has quit [Remote host closed the connection]
despai has quit [Quit: ...]
mikecmpbll has joined #ruby
alfiemax has joined #ruby
guille-moe has joined #ruby
despai has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
ruschlem_ has quit [Quit: -a- IRC for Android 2.1.38]
chocoelho1 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chocoelho has quit [Ping timeout: 240 seconds]
chocoelho1 is now known as chocoelho
ta_ has quit [Ping timeout: 240 seconds]
cdolan has joined #ruby
lytol_ has joined #ruby
chocoelho has quit [Client Quit]
ta_ has joined #ruby
guille-moe has quit [Ping timeout: 260 seconds]
jaruga has quit [Quit: jaruga]
mtkd has quit [Ping timeout: 240 seconds]
guille-moe has joined #ruby
ur5us has joined #ruby
mtkd has joined #ruby
amelliaa has quit [Quit: -]
wald0 has quit [Quit: Lost terminal]
guille-moe has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
vee__ has quit [Ping timeout: 264 seconds]
unreal has quit [Read error: Connection reset by peer]
amatas_ has quit [Quit: amatas_]
falaafel has joined #ruby
<falaafel>
Hihi. how can I debug my ruby script if I'm using bundler when I've install my dependant gems into vendor/bundle?
claudiuinberlin has joined #ruby
<falaafel>
Apologies, if this is a newbie question, but I couldn't find anyone else having similar problems - and 'bundle exec ruby -rdebug ./foo.rb' loses bundler's context
Psybur__ has joined #ruby
Ltem has joined #ruby
vee__ has joined #ruby
<dminuoso>
falaafel: What does "loses bundler's context" mean?
clemens3 has joined #ruby
apeiros has joined #ruby
Psybur_ has quit [Ping timeout: 240 seconds]
Psybur__ is now known as Psybur
pastorinni has joined #ruby
<falaafel>
well, I get a LoadError, so I assume it cannot find it in the same manner
<raynold>
ahh it's a wonderful day
tvw has joined #ruby
jnollette has quit [Ping timeout: 248 seconds]
cdg has joined #ruby
romeoh has quit [Remote host closed the connection]
romeoh has joined #ruby
workmad3 has quit [Ping timeout: 272 seconds]
tvw has quit []
tvw has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
<falaafel>
okay well, if anyone ever has that ever again, you can use pry and require bundle in it's preamble to keep the bundler context of where it stored everything
falaafel has quit [Quit: WeeChat 1.6]
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
jnollette has joined #ruby
ramfjord has quit [Quit: Lost terminal]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
milardov_ has joined #ruby
milardov_ has quit [Remote host closed the connection]
cdg has quit [Remote host closed the connection]
tvw has quit []
tvw has joined #ruby
vee__ has quit [Ping timeout: 248 seconds]
RougeT430 has joined #ruby
milardovich has quit [Ping timeout: 272 seconds]
pastorinni has quit [Remote host closed the connection]
voker57 has quit [Quit: No Ping reply in 180 seconds.]
voker57 has joined #ruby
tvw has quit []
tvw has joined #ruby
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
tvw has quit [Client Quit]
jottr has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nogic has quit [Ping timeout: 255 seconds]
jud has quit [Ping timeout: 246 seconds]
vee__ has joined #ruby
schfkt has joined #ruby
riotjones has joined #ruby
schfkt has left #ruby [#ruby]
orbyt_ has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
the_f0ster has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
ldnunes has quit [Quit: Leaving]
chiggins has joined #ruby
my123 has quit [Ping timeout: 240 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<chiggins>
When deploying a ruby application to production in passenger, is it appropriate to use RVM?
chocoelho has joined #ruby
FrostCandy has quit []
jottr has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
cdolan has quit [Quit: WeeChat 2.0]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 272 seconds]
alfiemax has joined #ruby
my123 has joined #ruby
my123 has joined #ruby
my123 has quit [Changing host]
Psybur_ has joined #ruby
danielpclark has quit [Quit: Leaving]
cagomez has quit [Remote host closed the connection]
<baweaver>
you can use indexing as al2o3-cr mentioned
<davidcsi>
i iterate through an xml document, getting all elements and printing them out, but i need to add a comma (,) to each one, but the last (converting to json, there's probably one out there, but i'm embedding this in logstash)