<Nilium>
Hm, I need to not mistake ?s at the end of sentences for questions
<Nilium>
.. Ruby makes this hard.
kanobt61 has quit [Remote host closed the connection]
braincra- has quit [Quit: bye bye]
kanobt61 has joined #ruby
Rodya_ has joined #ruby
CaptainSplash has quit [Remote host closed the connection]
kanobt61 has quit [Remote host closed the connection]
CloCkWeRX has left #ruby [#ruby]
kanobt61 has joined #ruby
dminuoso has joined #ruby
shazaum has quit [Quit: Leaving]
Sou|cutter has joined #ruby
kanobt61 has quit [Remote host closed the connection]
kanobt61 has joined #ruby
gix has quit [Ping timeout: 258 seconds]
kanobt61 has quit [Remote host closed the connection]
kanobt61 has joined #ruby
araujo__ has joined #ruby
dminuoso has quit [Ping timeout: 260 seconds]
Spami has quit [Quit: This computer has gone to sleep]
pawnbox has joined #ruby
gix has joined #ruby
CaptainSplash has joined #ruby
kanobt61 has quit [Remote host closed the connection]
araujo_ has quit [Ping timeout: 240 seconds]
wuyin has quit [Ping timeout: 250 seconds]
dviola has quit [Quit: WeeChat 1.5]
kanobt61 has joined #ruby
Puffball has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 244 seconds]
k3rn31 has joined #ruby
brent__ has joined #ruby
braincras has joined #ruby
kanobt61 has quit [Ping timeout: 250 seconds]
moneylotion has quit [Quit: ZNC 1.6.3 - http://znc.in]
JoshS has joined #ruby
moneylotion has joined #ruby
craigp_ has quit [Ping timeout: 265 seconds]
gizmore has joined #ruby
sleepee has quit [Ping timeout: 276 seconds]
skweek has quit [Ping timeout: 265 seconds]
Blackpajamas has quit [Quit: ZZZzzz…]
blackwind_123 has quit [Ping timeout: 244 seconds]
blackwind_123 has joined #ruby
cdg has quit [Remote host closed the connection]
boshhead has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 240 seconds]
war_pigs has quit [Quit: laters.. I'm out.]
boshhead has joined #ruby
GriffinHeart has joined #ruby
hk238 has joined #ruby
soLucien has joined #ruby
flashpoint9 has joined #ruby
kyle has joined #ruby
<soLucien>
hello guys ! I need some advice in writing an erb file
kyle is now known as Guest96620
<soLucien>
i have this:
<soLucien>
<% @ignore.each do |val| -%>
<soLucien>
<% end -%>
<soLucien>
ignore = Path <%= val %>
Guest96620 is now known as kyle__
<soLucien>
what i want is to check whether ignore exists
<soLucien>
before doing the .each
<soLucien>
because for inexistent ignore, it fails
<soLucien>
how can i write this in erb ?
<kyle__>
I'm experiencing some odd, I think new, behavior from the json library....
<kyle__>
When I parse the file, it's echoing to the terminal. Even if it's run in a script and not in irb.
<kyle__>
It didn't, used to do that, right?
<kyle__>
f=JSON.parse(File.read('somefile.json')) shouldn't print anything to the screen iirc....
boshhead has quit [Read error: Connection reset by peer]
boshhead has joined #ruby
hahuang65 has joined #ruby
<alem0lars>
is there a way to prevent ERB from adding newlines automatically, without having to add minus sign every time?
bob434 has quit [Quit: Leaving]
wuyin has joined #ruby
<kyle__>
alem0lars: errr, context? I've alsmot never used ERB outside of chef, but I don't recall it litering my files with newlines
Channel6 has joined #ruby
kavanagh has quit [Quit: That's all folks!]
<alem0lars>
kyle__: for example if I add <% if .... %>bar<% end %>, when the condition evaluates to false, I'd like that the file isn't touched.. Instead it adds a newline.
<alem0lars>
I was wondering if there is a way to prevent adding newlines by default
Rodya_ has quit [Remote host closed the connection]
<alem0lars>
Because it'
<alem0lars>
Because it's really annoying having to put <% end -%> every time IMHO
<kyle__>
alem0lars: Hu. I guess I never ran into that, but I was generally using it to create config files.
<kyle__>
Sorry, I'm no good there.
pwnd_nsfw` has joined #ruby
pwnd_nsfw has quit [Ping timeout: 250 seconds]
nando293921 has quit [Ping timeout: 244 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
solocshaw has quit [Ping timeout: 260 seconds]
quazimodo has joined #ruby
rsampaio_ has quit [Ping timeout: 265 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
pawnbox has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
dionysus69 has joined #ruby
hotpanca_ has quit []
tens0r has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
bb010g has joined #ruby
JoshS has joined #ruby
eizua has quit [Quit: Leaving]
flying has joined #ruby
loechel has joined #ruby
conta has quit [Read error: Connection reset by peer]
Es0teric has quit [Quit: Computer has gone to sleep.]
domgetter has quit [Ping timeout: 244 seconds]
CaptainSplash has quit [Quit: Leaving]
conta has joined #ruby
k3rn31 has joined #ruby
jgt has quit [Ping timeout: 260 seconds]
tdy has quit [Quit: tdy]
DoubleMalt has joined #ruby
fivmo has joined #ruby
ReK2 has quit [Quit: Konversation terminated!]
ReK2 has joined #ruby
ReK2 has joined #ruby
ReK2 has quit [Changing host]
gingray has joined #ruby
tens0r has quit [Ping timeout: 250 seconds]
tens0r has joined #ruby
ikbenhet has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
conta has quit [Read error: Connection reset by peer]
AhToyMaker has joined #ruby
<AhToyMaker>
new to ruby, i'm in irb and when i make a function i can't seem to indent...?
ikbenhet has joined #ruby
tdy has joined #ruby
<bungoman>
You mean with tab?
<AhToyMaker>
alt+tab
<AhToyMaker>
figured it out
conta has joined #ruby
<AhToyMaker>
how do you change the config so the indent will be four spaces?
<AhToyMaker>
i use small terminals...
<dminuoso>
AhToyMaker: I honestly dont know. A lot of folks use pry, which automatically indents code for you. :P
conta has quit [Read error: Connection reset by peer]
<dminuoso>
So you don't have to tab at all.
<AhToyMaker>
does pry have to be separately installed?
nankyokusei has joined #ruby
<dminuoso>
AhToyMaker: It's a gem. You can install it with "gem install pry"
<dminuoso>
It is far more powerful than irb. :)
conta has joined #ruby
<AhToyMaker>
excellent, ty
<AhToyMaker>
any other gems i should know about, or are must-haves?
<dminuoso>
AhToyMaker: byebug (possibly in combination with pry in pry-byebug)
<AhToyMaker>
how long does pry take to install... and should I use sudo?
<dminuoso>
AhToyMaker: you may need sudo if your ruby was installed system wide, and it should be installed fairly quickly.
<AhToyMaker>
is it a gui?
<dminuoso>
AhToyMaker: No. It's basically like irb - just better.
marr has joined #ruby
<dminuoso>
?pry
<ruby[bot]>
Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
nankyokusei has quit [Ping timeout: 264 seconds]
<dminuoso>
AhToyMaker: you can "cd" into objects, you can "ls" to show available methods/variables inside the "current object", you have tab completion - and many many other things. It's pretty awesome. :)
Burgestrand has joined #ruby
ropeney has quit [Ping timeout: 250 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aidalgol has joined #ruby
<AhToyMaker>
oic, that's nice to hear
CloCkWeRX has joined #ruby
<AhToyMaker>
dminuoso,
jsrn_ has joined #ruby
armyriad has quit [Ping timeout: 276 seconds]
govg has joined #ruby
<bungoman>
Also, you can use binding.pry inside a script to get a pry session in the context of wherever you called it.
<AhToyMaker>
wow, pry is quite nice... haha
armyriad has joined #ruby
<bungoman>
Which is immensely useful for debugging. Sometimes just being able to poke around for a few minutes is worth hours of puts debugging.
jgrevich has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
armyriad has joined #ruby
Burgestrand has joined #ruby
Puffball has quit [Remote host closed the connection]
Snowy has joined #ruby
anthony` has joined #ruby
marr has quit [Remote host closed the connection]
marr has joined #ruby
elastix has joined #ruby
ikbenhet has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
k3rn31 has quit [Quit: Computer has gone to sleep.]
tildes has quit [Remote host closed the connection]
mame3 has quit [Ping timeout: 244 seconds]
Silthias has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mrgrieves has joined #ruby
ikbenhet has joined #ruby
Burgestrand has joined #ruby
Silthias1 has quit [Ping timeout: 276 seconds]
Puffball has joined #ruby
Burgestrand has quit [Client Quit]
pandaant has joined #ruby
triangles2 has joined #ruby
ogotai has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Ping timeout: 250 seconds]
triangles has quit [Ping timeout: 252 seconds]
govg has quit [Ping timeout: 264 seconds]
elaptics has joined #ruby
mame3 has joined #ruby
Burgestrand has joined #ruby
anthony` has quit [Remote host closed the connection]
conta has quit [Read error: Connection reset by peer]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
conta has joined #ruby
mame3 has quit [Ping timeout: 244 seconds]
wugy has quit [Ping timeout: 244 seconds]
mame3 has joined #ruby
wugy has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
da3mon has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
wugy has quit [Excess Flood]
Burgestrand has joined #ruby
wugy has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
wugy has quit [Excess Flood]
flashpoint9 has joined #ruby
wugy has joined #ruby
wugy has quit [Excess Flood]
wugy has joined #ruby
wugy has quit [Excess Flood]
flashpoint9 has quit [Remote host closed the connection]
<dminuoso>
shmoon_: It was a silly example. Adding a constant to Object makes it available pretty much everywhere, since almost every object has Object in its inheritance chain.
hahuang65 has joined #ruby
<dminuoso>
*every class
<shmoon_>
>> class Object; def self.const_missing(name); p name; end; module M; MISS; end;
<ruby[bot]>
shmoon_: # => /tmp/execpad-2f5e0697a18a/source-2f5e0697a18a:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/635149)
<dminuoso>
shmoon_: But can we agree to not use modules? Lets just use classes. :P
<shmoon_>
>> class Object; def self.const_missing(name); p name; end; class C; MISS; end;
<ruby[bot]>
shmoon_: # => /tmp/execpad-3c92188b73df/source-3c92188b73df:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/635150)
<shmoon_>
dminuoso: yup we can :P
<dminuoso>
>> class Object; def self.const_missing(name); p name; end; end; class C; MISS; end
<dminuoso>
shmoon_: Modules are not different from classes..
<shmoon_>
>> class Object; def self.const_missing(name); p name; end; end; module M; MISS; end;
<ruby[bot]>
shmoon_: # => uninitialized constant M::MISS (NameError) ...check link for more (https://eval.in/635154)
<shmoon_>
yeah that ^
mame3 has quit [Ping timeout: 244 seconds]
<dminuoso>
shmoon_: You got me.
dionysus69 has quit [Remote host closed the connection]
<shmoon_>
dminuoso: I got you that modules are not different from classes
pwnd_nsfw` has joined #ruby
<dminuoso>
shmoon_: Let me analyze this and get back to you.
<shmoon_>
but you got my confusion ? :P or am I still being silly
<shmoon_>
oh ok
dionysus69 has joined #ruby
<dminuoso>
I absolutely did not expect this. :P
maloik has quit [Remote host closed the connection]
<shmoon_>
cool
maloik has joined #ruby
<dminuoso>
Salut Mon_Ouie, you probably know more about constant lookup than I do.
<dminuoso>
Can you explain the behavior shmoon_ has demonstrated?
hahuang65 has quit [Ping timeout: 250 seconds]
pwnd_nsfw has quit [Ping timeout: 250 seconds]
ta_ has joined #ruby
conta has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
<shmoon_>
one more question actually, given autoload is deprecated and might be removed in ruby 3.0
<shmoon_>
wil that also affect Module#autoload ?
<dminuoso>
Wut
Immune has quit [Ping timeout: 252 seconds]
conta has joined #ruby
<Mon_Ouie>
dminuoso: shmoon_: const_missing is not called for every class/module where constants are looked up. It is only called on the class/module of the current context.
<Mon_Ouie>
since your class C inherits from object, it also inherits the implementation of const_missing
<Mon_Ouie>
module M still has the default implementation of const_missing
<dminuoso>
Ah, thank you for the explanation.
ta_ has quit [Ping timeout: 244 seconds]
<shmoon_>
default implementation of const_missing from the ruby Module class ?
RedNifre_ has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
<Mon_Ouie>
Yes, which just raises a NameError
<shmoon_>
got it
<shmoon_>
thanks
conta has quit [Read error: Connection reset by peer]
<dminuoso>
shmoon_: Kernel#autoload calls the implementation of Module#autoload
<shmoon_>
what i am also wondering if Rails has lots of `autoload` used, what happens to them, i guess they are using a custom version though since their autoload accepts 1 argument too which is just a symbol
<shmoon_>
oh ok
antgel has quit [Ping timeout: 244 seconds]
jgt has joined #ruby
antgel has joined #ruby
Hien has joined #ruby
k3rn31 has joined #ruby
zapata has joined #ruby
mame3 has joined #ruby
JeanCarloMachado has quit [Ping timeout: 244 seconds]
tens0r has quit [Quit: tens0r]
jgt has quit [Ping timeout: 250 seconds]
ogotai has joined #ruby
llaine has joined #ruby
alaibe has joined #ruby
alaibe has quit [Client Quit]
patteh__ has joined #ruby
patteh has quit [Ping timeout: 250 seconds]
mame3 has quit [Ping timeout: 244 seconds]
govg has quit [Ping timeout: 244 seconds]
pwnd_nsfw` has quit [Read error: Connection reset by peer]
pwnd_nsfw has joined #ruby
tvw has quit []
craigp_ has quit [Ping timeout: 244 seconds]
fivmo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lightheaded has quit [Read error: Connection reset by peer]
rsampaio_ has quit [Ping timeout: 250 seconds]
ikbenhet has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
k3rn31 has quit [Quit: Computer has gone to sleep.]
BillSussman has quit [Ping timeout: 258 seconds]
mame3 has joined #ruby
lightheaded has joined #ruby
ziyadb has joined #ruby
AndyBotwin has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ikbenhet has joined #ruby
nankyokusei has joined #ruby
astrobun_ has quit [Remote host closed the connection]
bb010g has quit [Quit: Connection closed for inactivity]
nankyokusei has quit [Ping timeout: 250 seconds]
fivmo has joined #ruby
flashpoint9 has joined #ruby
craigp_ has joined #ruby
mame3 has quit [Ping timeout: 244 seconds]
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
k3rn31 has joined #ruby
anisha has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
spudowiar has joined #ruby
Beams has joined #ruby
ikbenhet has quit [Read error: Connection reset by peer]
pawnbox has quit [Remote host closed the connection]
blackwind_123 has quit [Ping timeout: 258 seconds]
ikbenhet has joined #ruby
blackwind_123 has joined #ruby
_Suntzu has quit [Quit: changing servers]
Suntzu has joined #ruby
marens_ is now known as marens
pawnbox has joined #ruby
claudiuinberlin has quit [Remote host closed the connection]
anisha has quit [Quit: This computer has gone to sleep]
pawnbox has quit [Remote host closed the connection]
fivmo has joined #ruby
pawnbox has joined #ruby
charliesome has joined #ruby
jgt has joined #ruby
<AhToyMaker>
I'm aware you don't have to use parentheses when defining def instances. But I'm clueless to why invoking funcs nested in another func requires parentheses. Any explanation? or am I just doing it wrong?
fivmo has quit [Ping timeout: 265 seconds]
<tobiasvl>
AhToyMaker: to disambiguate precedence
<AhToyMaker>
so it's illegal and I'm doing it right syntax wise but it's just not feasible in ruby tobiasvl ?
pawnbox has quit [Remote host closed the connection]
tvw has joined #ruby
<tobiasvl>
depends on your actual example
<AhToyMaker>
puts thisfunc return2 2, return2 2
duncannz has quit [Ping timeout: 260 seconds]
<AhToyMaker>
this func with two argument param and return with a 1 arg param
<AhToyMaker>
s/return/return2
pawnbox has joined #ruby
<ljarvis>
that just looks insane
<AhToyMaker>
no it doesn't
<ljarvis>
it absolutely does, if a human can't quickly figure it and remove the variable ambiguities out how can a computer
<AhToyMaker>
is there something i did wrong syntax wise?
<tobiasvl>
puts(thisfunc(return2(2)), return2(2)) vs puts(thisfunc(return2(2), return2(2)) vs puts(thisfunc(return2(2, return2(2))))
<AhToyMaker>
ljarvis, alright lol
<tobiasvl>
you see how it's ambiguous?
<AhToyMaker>
exactly
<hanmac>
AhToyMaker: ruby can't know which function does want one or two (or any) parameters, so it can not know which function gets the second parameter
Burgestrand has joined #ruby
<AhToyMaker>
hmm bad design
<AhToyMaker>
... joking ...
<hanmac>
hm yeah it is ... on your side ;P
soLucien has quit [Read error: Connection reset by peer]
AnarchyAo has quit [Quit: ircN 8.00 for mIRC (20100904) - www.ircN.org]
<AhToyMaker>
would bird nesting just be horrible style in coding?
<AhToyMaker>
bird nesting = a insane amount of nesting
raMp has joined #ruby
<ljarvis>
:/
<ljarvis>
bird nesting = when birds make nests
<AhToyMaker>
ik i just made up that.
fivmo has joined #ruby
<ljarvis>
i couldn't tell
<AhToyMaker>
when you nest so much it looks like a damn bird nest
Burgestrand has quit [Client Quit]
<ljarvis>
but yes that is obviously not a good idea
<AhToyMaker>
((),((())),()
<AhToyMaker>
its concise though
<AhToyMaker>
speedy coders take advantage of conciseness.
jsrn_ has quit [Read error: Connection reset by peer]
caw_ is now known as caw
ijij has joined #ruby
jhack has quit [Quit: jhack]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
deimos has joined #ruby
halfdan has joined #ruby
bsrd has joined #ruby
ndrst has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
turingbombe has joined #ruby
braderhart has joined #ruby
bastelfreak has joined #ruby
ndrst is now known as Guest31165
pawnbox has quit [Ping timeout: 264 seconds]
shmuli has quit [Remote host closed the connection]
pierrehoudyer has joined #ruby
rflot has joined #ruby
hk238 has quit [Ping timeout: 240 seconds]
jhill has joined #ruby
jdawgaz has joined #ruby
<jokke>
hi
rodfersou has quit [Ping timeout: 265 seconds]
<jokke>
i'm using simplecov in my project and i was wondering if the coverage drop could be somehow detected between the current state and the last git commit
ec has joined #ruby
<jokke>
my problem is that if i run the specs twice the coverage drop is 0 the second time and so no error is detected
ec has quit [Excess Flood]
amitchellbullard has joined #ruby
ramblinpeck has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
craigp has joined #ruby
dminuoso has joined #ruby
rsampaio_ has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
colstrom has joined #ruby
ec has joined #ruby
bedouin has joined #ruby
zero7 has joined #ruby
<dminuoso>
ytti: The one that still annoys me like crazy is how local variables are implemented, and it's something I probably never will get comfortable with.
AphelionZ has joined #ruby
mrgrieves has quit [Ping timeout: 252 seconds]
pokalyis has joined #ruby
jwheare has joined #ruby
c0mrad3 has joined #ruby
machty has joined #ruby
scottschecter_ is now known as scottschecter
joaomdmoura__ has joined #ruby
Auger has joined #ruby
Vile` has joined #ruby
zrl has joined #ruby
diprotic is now known as monoprotic
anisha has quit [Quit: This computer has gone to sleep]
SuperTux88 has joined #ruby
rodferso1 is now known as rodfersou|lunch
frozengeek has quit [Quit: frozengeek]
nankyokusei has joined #ruby
DoubleMalt has quit [Ping timeout: 258 seconds]
MadLamb has quit [Ping timeout: 240 seconds]
Couch has quit [Ping timeout: 244 seconds]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pokalyis has joined #ruby
llaine has quit [Ping timeout: 250 seconds]
SuperLag_ is now known as SuperLag
elastix has joined #ruby
Asher has joined #ruby
SuperLag has quit [Changing host]
SuperLag has joined #ruby
nankyokusei has quit [Ping timeout: 265 seconds]
Bob8989|3 has joined #ruby
Bob8989|3 has quit [Max SendQ exceeded]
[dmp] has joined #ruby
aspiers has joined #ruby
Bob8989|3 has joined #ruby
turingbombe has quit [Quit: This computer has gone to sleep]
Bob8989|3 has quit [Max SendQ exceeded]
fclnva has joined #ruby
conta has quit [Ping timeout: 264 seconds]
zacts has quit [Ping timeout: 258 seconds]
craigp has quit [Ping timeout: 250 seconds]
lightheaded has joined #ruby
gizless has joined #ruby
gizmore has quit [Ping timeout: 240 seconds]
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
loechel has quit [Remote host closed the connection]
TomyWork has quit [Ping timeout: 276 seconds]
pawnbox has joined #ruby
Gaelan has quit [Read error: Connection reset by peer]
claudiui_ has quit []
hahuang65 has joined #ruby
flying has quit []
jhack has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
ajsharma has joined #ruby
<tax>
how important is readability?
conta has joined #ruby
<tax>
is it worth choosing readability over other things at all costs?
aufi has quit [Ping timeout: 240 seconds]
nclbr has joined #ruby
<tax>
i see corporation are politically pushing python for obvious reasons. but also linux and less aflluent countries adopt it as a necessary means of staying competitive and surviving
Dispatch has joined #ruby
<tax>
so: is it more than just profits? is there a deep reason why readability trumps everything else?
shmuli has joined #ruby
conta has quit [Ping timeout: 264 seconds]
minotep has joined #ruby
anisha has joined #ruby
turingbombe has joined #ruby
SuperLag has quit [Quit: leaving]
<tax>
and does excessive concern for readability hamper the ability to solve problems in any way?
SuperLag has joined #ruby
Littlemyu has quit [Ping timeout: 265 seconds]
anisha has quit [Client Quit]
jhack has quit [Quit: jhack]
rsampaio_ has quit [Ping timeout: 250 seconds]
soahccc has joined #ruby
einarj has quit [Remote host closed the connection]
symm- has joined #ruby
vedu has joined #ruby
ta has joined #ruby
fclnva has quit [Remote host closed the connection]
naftilos76 has joined #ruby
<toretore>
what
sumobob has joined #ruby
ta has quit [Ping timeout: 240 seconds]
conta has joined #ruby
Rodya_ has joined #ruby
sepp2k has quit [Ping timeout: 250 seconds]
Es0teric has quit [Ping timeout: 252 seconds]
gizless has quit [Remote host closed the connection]
elastix has quit [Quit: elastix]
rsampaio_ has joined #ruby
jhack has joined #ruby
<havenwood>
tax: Readability is very important. There are other important things. It depends.
pandaant has quit [Remote host closed the connection]
lxsameer has joined #ruby
jgt has joined #ruby
rsampaio_ has quit [Ping timeout: 250 seconds]
kanobt61 has quit [Read error: Connection reset by peer]
_whitelogger has joined #ruby
saneax is now known as saneax-_-|AFK
MadLamb has joined #ruby
sepp2k has joined #ruby
craigp has joined #ruby
turingbombe has quit [Quit: This computer has gone to sleep]
turingbombe has joined #ruby
turingbombe has quit [Client Quit]
kanobt61 has joined #ruby
bkxd has joined #ruby
conta has quit [Ping timeout: 264 seconds]
anisha has joined #ruby
jgt has quit [Ping timeout: 276 seconds]
<tax>
i have always felt that TMTOWTDI languages offer the freedom and diversity to cultivate a flexible mind that can change or rephrase id need be.
<tax>
the organic human psychology is the most impoertant part for me as a programmer
<tax>
but maybe from most standpoints.. they say that ruby is suited best for webdev and python math,data,science.
Rickmasta has joined #ruby
lizard2010 has quit [Quit: Leaving]
<tax>
not restricted but just happens to do..
habitullence has quit [Ping timeout: 265 seconds]
claudiuinberlin has joined #ruby
habitullence_ has joined #ruby
bkxd has quit [Ping timeout: 250 seconds]
workmad3_ is now known as workmad3
Auger has quit [Quit: leaving]
skweek has quit [Read error: Connection reset by peer]
skweek has joined #ruby
DoubleMalt has joined #ruby
wugy has quit []
d0nn1e has quit [Ping timeout: 252 seconds]
rodfersou|lunch is now known as rodfersou
firstdayonthejob has joined #ruby
lizard2010 has joined #ruby
d0nn1e has joined #ruby
shmuli has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 255 seconds]
hk238 has joined #ruby
gnufied has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gnufied has quit [Client Quit]
Snowy has joined #ruby
workmad3 has quit [Ping timeout: 250 seconds]
Log1x has quit [Ping timeout: 240 seconds]
mark_66 has quit [Quit: Leaving.]
spudowiar has joined #ruby
workmad3 has joined #ruby
llaine has joined #ruby
tvw has joined #ruby
llaine has left #ruby [#ruby]
Log1x has joined #ruby
<chris2>
i use IO#getch to do a menu-driven dialog... how can i not eat Ctrl-Z?
s1kx has joined #ruby
da3mon has quit [Quit: Zzzz...]
pokalyis has joined #ruby
<AhToyMaker>
why does "#$greeting, #@name" produce " , "?
workmad3_ has joined #ruby
<Mon_Ouie>
because greeting and @name are nil, or something else for which #to_s returns an empty string?
<Mon_Ouie>
Yes, you never gave a value to $greeting or to @name.
naftilos76 has quit [Read error: Connection reset by peer]
<AhToyMaker>
oic lol, i know what i have to do
<AhToyMaker>
wait do it for me?
<AhToyMaker>
i'm confused
naftilos76 has joined #ruby
sickvap0r has joined #ruby
<AhToyMaker>
where do I put the values? after the literal?
<Mon_Ouie>
"#{greeting}, #{name}" and reading a tutorial about Ruby and the different types of variables, which no one can do in your stead
<AhToyMaker>
i'm reading the pickaxe book tyvm
<AhToyMaker>
the pickaxe book says I can do it that way, unless i misread
dunpeal has joined #ruby
<AhToyMaker>
oh nvm, i misinterpreted the way to make a global variableand an instance variable
<dunpeal>
Yo. Say I have a long method, like String::Similarity.levenshtein_distance. How do I quickly alias it such that it would be called using a shorter name, like foo?
deadprez has joined #ruby
<AhToyMaker>
if everythings an object... what's so different x="1" vs @x = "1"??
symm- has quit [Ping timeout: 260 seconds]
naftilos76 has quit [Read error: Connection reset by peer]
Snowy has quit [Remote host closed the connection]
naftilos76 has joined #ruby
<Mon_Ouie>
dunpeal: An alias within the same module (or class)? When self is that module's singleton class, use alias foo levenshtein_distance
<dunpeal>
AhToyMaker: the latter is an assignment to an instance variable, so it becomes a part of the object state such that you can refer to it anywhere in the scope of the object (such as other methods). The former is just a local variable, locally scoped.
<AhToyMaker>
dunpeal, what's the different types on them?
redpants has quit [Ping timeout: 244 seconds]
dminuoso has quit [Ping timeout: 265 seconds]
<dunpeal>
Mon_Ouie: self isn't the modules singleton class. I just have this very long fully qualified name, and I'm calling this method a lot in many places inside a different method, so I just want to have a shorter reference to it.
workmad3_ has quit [Ping timeout: 265 seconds]
<AhToyMaker>
local variable is still an object... correct?
<dunpeal>
AhToyMaker: a variable is just a named reference, and in Ruby, yes, that reference would always point to an object, since everything is an object.
claudiuinberlin has quit [Remote host closed the connection]
<dunpeal>
AhToyMaker: "local vs instance" is purely about scoping, i.e. where in your code the variable is visible. nothing to do with types.
claudiuinberlin has joined #ruby
<Mon_Ouie>
dunpeal: If String::Similarity is a module and levenshtein_distance is defined as a module function you can include it in any class/module where you use it to get levenshtein_distance as a private instance method
<AhToyMaker>
dunpeal, what's the difference? can't a instance variable be locally scoped?
<Mon_Ouie>
Then you can also define an alias within the module where you included it
workmad3 has joined #ruby
bad_ip has joined #ruby
<AhToyMaker>
x=10 is local $x = 10 is global and @x = 10 is an instance which scope is ...?
<AhToyMaker>
well nvm, i'll just continue reading...
<dunpeal>
AhToyMaker: no, instance variables by defition aren't locally scoped.
<dunpeal>
class Foo; def bar; @qux = 23; end; def john; puts @qux; end; end
<AhToyMaker>
locally scoped means? in the scope that is inside another scope? or has to do with the instance definition...???
<dunpeal>
after calling @qux, Foo#john would print 23
hopsoft has joined #ruby
<dunpeal>
Mon_Ouie: thanks. what's the way to just pass through all arguments to another method? like `def foo(*args, **kwargs): bar(*args, **kwargs)` in Python
zacts has joined #ruby
<AhToyMaker>
nvm, i'm getting confused. I'll just continue reading and ask questions later
naftilos76 has quit [Quit: Αποχώρησε]
soulisson has joined #ruby
Azure has joined #ruby
conta has joined #ruby
zeroDi has joined #ruby
<dunpeal>
nvm, found it.
workmad3 has quit [Ping timeout: 265 seconds]
workmad3 has joined #ruby
conta has quit [Ping timeout: 264 seconds]
<Mon_Ouie>
remove **kwargs and, in some cases, don't forget about &block
Channel6 has quit [Quit: Leaving]
nankyokusei has joined #ruby
stamina has joined #ruby
pierrehoudyer has quit [Remote host closed the connection]
kanobt61_ has joined #ruby
quoboo has quit [Ping timeout: 250 seconds]
kanobt61 has quit [Ping timeout: 250 seconds]
shiver has quit [Read error: Connection reset by peer]
s1kx has quit [Quit: bai]
<dunpeal>
yup, thanks.
BackEndCoder has quit [Ping timeout: 250 seconds]
GodFather has quit [Quit: Ex-Chat]
Quobo has joined #ruby
GodFather has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
go|dfish has quit [Ping timeout: 250 seconds]
Quobo is now known as Guest52068
shiver has joined #ruby
shiver has quit [Changing host]
shiver has joined #ruby
nankyokusei has quit [Ping timeout: 276 seconds]
elaptics has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
BackEndCoder has joined #ruby
kies has quit [Ping timeout: 255 seconds]
<soulisson>
Hi, I created two versions of the same function to generate random words, one version is iterative and the other one is recursive, the recursive version is faster, can any one explain me why, the code is available here: https://gist.github.com/anonymous/0c0164c38f1fa44e0af56a585d8e7868
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
Guest52068 has quit [Changing host]
Guest52068 has joined #ruby
Guest52068 is now known as quoboo
<soulisson>
other comments on the code are welcome as well
spudowiar has quit [Quit: Leaving.]
da3mon has joined #ruby
conta has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
<monoprotic>
soulisson they're pretty comparable on my machine
<monoprotic>
sometimes the recursive one is slower
nikivi has joined #ruby
<soulisson>
monoprotic, ok, weird, tried it a dozen times on my computer, the recursive one was faster, but ok, np
<monoprotic>
how much faster?
<soulisson>
monoprotic, not too much
<soulisson>
50 random words of length 16 generated in 0.009689932 seconds -- 50 random words of length 16 generated in 0.009231993 seconds
<Mon_Ouie>
Also you're probably measuring the time it takes to print strings more than anything else
<soulisson>
Mon_Ouie, yeah probably, I didn't know about Benchmark
spider-mario has joined #ruby
<soulisson>
Did you have troubles reading the code?
<monoprotic>
i dont speak french :)
<monoprotic>
but otherwise no
devbug has joined #ruby
<Mon_Ouie>
I would avoid comments like 'return result # returns the result' --- that's just redundancy, it doesn't add any useful information
hahuang65 has joined #ruby
<soulisson>
monoprotic, yes, usually I write the code in english and the comments in my native language, words tend to be shorter in english, gives me also a chance to share with other people
<soulisson>
Mon_Ouie, ok, thanks for the advice
<soulisson>
I really enjoy writing in Ruby, I get sad when I have to switch back to other languages :)
ksinkar has joined #ruby
<ksinkar>
If anyone is compiling ruby from source and running tests after that, do you get 10 failing tests for 2.3.1?
conta has quit [Ping timeout: 264 seconds]
devbug has quit [Client Quit]
ta_ has joined #ruby
hahuang65 has quit [Ping timeout: 255 seconds]
panzi has quit [Quit: Konversation terminated!]
soulisson has quit [Quit: Quitte]
ta_ has quit [Ping timeout: 244 seconds]
sickvap0r has quit []
go|dfish has joined #ruby
dunpeal has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
coolboy has joined #ruby
Rodya_ has joined #ruby
quazimodo has quit [Ping timeout: 265 seconds]
firstdayonthejob has quit [Read error: Connection reset by peer]
da3mon has quit [Ping timeout: 244 seconds]
Robtop__ has joined #ruby
Sammichmaker has joined #ruby
Sammichmaker has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 265 seconds]
shinnya has joined #ruby
Sammichmaker has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
Sammichmaker has quit [Changing host]
Sammichmaker has joined #ruby
Rodya_ has joined #ruby
alfiemax has joined #ruby
coolboy has quit [Ping timeout: 258 seconds]
David27 has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 250 seconds]
tvw has quit []
redpants has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
bad_ip has quit [Ping timeout: 260 seconds]
anisha has quit [Quit: This computer has gone to sleep]
preyalone has joined #ruby
burhan has joined #ruby
<burhan>
Hello world!
<burhan>
😃
mark2 has quit [Ping timeout: 240 seconds]
il has joined #ruby
arup_r has quit [Remote host closed the connection]
<il>
ciao
<il>
ciao
il has left #ruby [#ruby]
zacts has quit [Read error: Connection reset by peer]
moneylotion has quit [Ping timeout: 252 seconds]
ElFerna has joined #ruby
bkxd has joined #ruby
PaulCapestany has quit [Quit: .]
dminuoso has joined #ruby
pierrehoudyer has joined #ruby
kus has joined #ruby
kus has quit [Max SendQ exceeded]
GodFather has quit [Quit: Ex-Chat]
PaulCapestany has joined #ruby
GodFather has joined #ruby
alfiemax has quit [Remote host closed the connection]
marsjaninzmarsa has quit [Quit: ZNC 1.7.x-git-487-cbf5c38 - http://znc.in]
johnmilton has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 255 seconds]
ajsharma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
moneylotion has joined #ruby
moneylotion has quit [Changing host]
moneylotion has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
pierrehoudyer has quit [Ping timeout: 276 seconds]
firstdayonthejob has joined #ruby
jhack has quit [Quit: jhack]
Rodya_ has joined #ruby
dn` has quit [Quit: dn`]
marsjaninzmarsa has joined #ruby
dn` has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
ta has quit [Ping timeout: 244 seconds]
moneylotion has quit [Quit: ZNC 1.6.3 - http://znc.in]
moneylotion has joined #ruby
claudiuinberlin has quit [Remote host closed the connection]
yfeldblum has joined #ruby
ksinkar has quit [Remote host closed the connection]
jhack has joined #ruby
Batholith has joined #ruby
Snowy has joined #ruby
Rodya_ has joined #ruby
moneylotion has quit [Client Quit]
<Batholith>
Is it considered bad practice to not have parentheses around arguments in function definition and when calling a function?
claudiuinberlin has joined #ruby
<Mon_Ouie>
I never see people omit parentheses when defining function (except for functions that take no arguments)
aries_liuxueyang has quit [Ping timeout: 265 seconds]
aries_liuxueyang has joined #ruby
moneylotion has joined #ruby
<dminuoso>
Batholith: Also be aware that functions in Ruby are always called methods.
<Batholith>
Oh really? I didn't know, thanks!
<Batholith>
Mon_Ouie: Yeah I've noticed the same, which is what prompted the question. :)
<Mon_Ouie>
It's not too uncommon to omit them when there's only one argument though
craigp has quit [Quit: WeeChat 1.5]
memorasus has joined #ruby
<Mon_Ouie>
Most people would write puts "Hello World!", not puts("Hello World!")
Macaveli has joined #ruby
<dminuoso>
Batholith: Personally I leave the parens away unless they are either add to clarification or solving syntax ambiguity. But if those are necessary, it's often an indicator that your code is too complex.
jhack has quit [Ping timeout: 260 seconds]
Vile` has quit [Ping timeout: 244 seconds]
<Batholith>
dminuoso: In method definition and when calling?
<dminuoso>
Batholith: I always have them in method definitions.
<Batholith>
Ah.
dionysus69 has quit [Ping timeout: 244 seconds]
Snowy has quit [Ping timeout: 276 seconds]
<dminuoso>
But for no other reason than "I have never thought about dropping them there".
<Batholith>
I guess it's easier to read when there are parentheses in the definition.
dionysus69 has joined #ruby
zacts has joined #ruby
Vile` has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
moneylotion has quit [Quit: ZNC 1.6.3 - http://znc.in]
ponga has quit [Quit: Connection closed for inactivity]
loopy has joined #ruby
AzureStigma has joined #ruby
David27 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
memorasus has quit [Quit: memorasus]
moneylotion has joined #ruby
Shmulik has joined #ruby
tomaz_b has joined #ruby
moneylotion has quit [Client Quit]
hopsoft has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
moneylotion has joined #ruby
einarj has joined #ruby
einarj has quit [Read error: Connection reset by peer]
einarj has joined #ruby
tmtwd has quit [Ping timeout: 240 seconds]
gigetoo has quit [Ping timeout: 265 seconds]
gigetoo has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
grill has joined #ruby
Es0teric has joined #ruby
claudiuinberlin has quit [Remote host closed the connection]
ngscheur1 has joined #ruby
sumobob has quit [Ping timeout: 250 seconds]
Coldblackice has joined #ruby
qba73 has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
lxsameer has quit [Quit: WeeChat 1.5]
deadprez has quit [Remote host closed the connection]
AlexRussia has joined #ruby
ElFerna has quit [Max SendQ exceeded]
auzty has quit [Quit: Leaving]
memorasus has joined #ruby
memorasus has quit [Client Quit]
memorasus has joined #ruby
Dimik has joined #ruby
Xiti has quit [Quit: Xiti]
Vingador has quit [Ping timeout: 265 seconds]
dreamyspell has quit [Killed (tepper.freenode.net (Nickname regained by services))]
PaulCape_ has joined #ruby
dreamyspell has joined #ruby
dreamyspell has quit [Client Quit]
Xiti has joined #ruby
phrozen77 has joined #ruby
marr123 has joined #ruby
shmuli has joined #ruby
ReK2GnULinuX has joined #ruby
ReK2GnULinuX has quit [Changing host]
ReK2GnULinuX has joined #ruby
cout has joined #ruby
memorasus has quit [Client Quit]
tdy1 has joined #ruby
memorasus has joined #ruby
hxegon_ has joined #ruby
badeball_ has joined #ruby
dviola has quit [Ping timeout: 250 seconds]
sethette1 has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rabbit___ has joined #ruby
A124 has quit [Disconnected by services]
A124 has joined #ruby
jdawgaz has joined #ruby
AzureStigma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_main_ has joined #ruby
MadLamb has quit [Read error: Connection reset by peer]
shock_one has joined #ruby
MadLamb has joined #ruby
|ifei5g00d has joined #ruby
cyphase_eviltwin has joined #ruby
yossarian has joined #ruby
yossarian has quit [Excess Flood]
ghormoon_ has joined #ruby
yossarian has joined #ruby
Shmulik has quit [*.net *.split]
GodFather has quit [*.net *.split]
PaulCapestany has quit [*.net *.split]
burhan has quit [*.net *.split]
shiver has quit [*.net *.split]
AphelionZ has quit [*.net *.split]
ramblinpeck has quit [*.net *.split]
Guest31165 has quit [*.net *.split]
braderhart has quit [*.net *.split]
bcavileer has quit [*.net *.split]
ELCALOR has quit [*.net *.split]
pizzaops has quit [*.net *.split]
Apocalypse has quit [*.net *.split]
ghormoon has quit [*.net *.split]
cout_ has quit [*.net *.split]
__main__ has quit [*.net *.split]
Papierko- has quit [*.net *.split]
darthvorik has quit [*.net *.split]
borkdude has quit [*.net *.split]
A0X1887 has quit [*.net *.split]
thiagofm has quit [*.net *.split]
marr has quit [*.net *.split]
tdy has quit [*.net *.split]
ReK2 has quit [*.net *.split]
braincras has quit [*.net *.split]
G has quit [*.net *.split]
hxegon has quit [*.net *.split]
daffy_duck_3 has quit [*.net *.split]
russt has quit [*.net *.split]
canton7 has quit [*.net *.split]
cyphase has quit [*.net *.split]
phrozen77_ has quit [*.net *.split]
galeido has quit [*.net *.split]
sarbs has quit [*.net *.split]
sethetter has quit [*.net *.split]
badeball has quit [*.net *.split]
FastJack has quit [*.net *.split]
`derpy has quit [*.net *.split]
hayden__ has quit [*.net *.split]
meinside has quit [*.net *.split]
frode15243 has quit [*.net *.split]
AndyWojo has quit [*.net *.split]
andersh has quit [*.net *.split]
davic has quit [*.net *.split]
pmarreck has quit [*.net *.split]
kent\n has quit [*.net *.split]
danzilio has quit [*.net *.split]
Travis-42 has quit [*.net *.split]
peteretep has quit [*.net *.split]
beatdown has quit [*.net *.split]
digitalfiz has quit [*.net *.split]
chrisseaton has quit [*.net *.split]
jcp has quit [*.net *.split]
hostess has quit [*.net *.split]
cgfbee has quit [*.net *.split]
cajone has quit [*.net *.split]
davidmichaelkarr has quit [*.net *.split]
skmp has quit [*.net *.split]
zzak has quit [*.net *.split]
woodruffw has quit [*.net *.split]
troter__________ has quit [*.net *.split]
bestie has quit [*.net *.split]
Rabbit__ has quit [*.net *.split]
aarongodin has quit [*.net *.split]
snapcase has quit [*.net *.split]
jabreity has quit [*.net *.split]
boxrick1 has quit [*.net *.split]
zack6849 has quit [*.net *.split]
tessi_zz has quit [*.net *.split]
_main_ is now known as __main__
iooner has quit [*.net *.split]
braincrash has joined #ruby
Papierkorb has joined #ruby
`derpy has joined #ruby
nankyokusei has joined #ruby
deadprez has joined #ruby
AphelionZ has joined #ruby
shiver has joined #ruby
Apocalypse has joined #ruby
GodFather has joined #ruby
A0X1887 has joined #ruby
Guest31165 has joined #ruby
darthvorik has joined #ruby
andersh has joined #ruby
meinside has joined #ruby
burhan has joined #ruby
snapcase has joined #ruby
beatdown has joined #ruby
galeido has joined #ruby
chrisseaton has joined #ruby
Travis-42 has joined #ruby
ramblinpeck has joined #ruby
russt has joined #ruby
bestie has joined #ruby
pmarreck has joined #ruby
danzilio has joined #ruby
pizzaops has joined #ruby
zzak has joined #ruby
bcavileer has joined #ruby
digitalfiz has joined #ruby
sarbs has joined #ruby
ELCALOR has joined #ruby
hayden__ has joined #ruby
hostess has joined #ruby
davic has joined #ruby
AndyWojo has joined #ruby
troter__________ has joined #ruby
kent\n has joined #ruby
canton7 has joined #ruby
davidmichaelkarr has joined #ruby
jabreity has joined #ruby
skmp has joined #ruby
aarongodin has joined #ruby
FastJack has joined #ruby
zack6849 has joined #ruby
iooner has joined #ruby
frode15243 has joined #ruby
borkdude has joined #ruby
peteretep has joined #ruby
G has joined #ruby
boxrick1 has joined #ruby
tessi_zz has joined #ruby
jcp has joined #ruby
Silthias has joined #ruby
Mon_Ouie has quit [Ping timeout: 244 seconds]
thiagofm has joined #ruby
jcp has quit [Max SendQ exceeded]
andersh has quit [Max SendQ exceeded]
iooner has quit [Max SendQ exceeded]
digitalfiz has quit [Max SendQ exceeded]
sarbs has quit [Max SendQ exceeded]
ELCALOR has quit [Max SendQ exceeded]
AndyWojo has quit [Max SendQ exceeded]
pizzaops has quit [Max SendQ exceeded]
davidmichaelkarr has quit [Max SendQ exceeded]
boxrick1 has quit [Max SendQ exceeded]
AphelionZ has quit [Max SendQ exceeded]
meinside has quit [Max SendQ exceeded]
GodFather has quit [Max SendQ exceeded]
discopatrick has quit [Ping timeout: 252 seconds]
iooner has joined #ruby
daffy_duck_3 has joined #ruby
jhill has quit [Ping timeout: 255 seconds]
sarbs has joined #ruby
GodFather has joined #ruby
cajone has joined #ruby
bcavileer has quit [Ping timeout: 258 seconds]
danzilio has quit [Ping timeout: 258 seconds]
Travis-42 has quit [Ping timeout: 258 seconds]
ggherdov has quit [Ping timeout: 255 seconds]
cgfbee has joined #ruby
Silthias1 has quit [Ping timeout: 244 seconds]
claudiuinberlin has joined #ruby
ramblinpeck has quit [Ping timeout: 258 seconds]
davic has quit [Ping timeout: 258 seconds]
peteretep has quit [Ping timeout: 258 seconds]
jabreity has quit [Ping timeout: 251 seconds]
toretore has quit [Ping timeout: 276 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
marr123 is now known as marr
bkxd has joined #ruby
Shmulik has joined #ruby
Bob8989 has joined #ruby
sepp2k has quit [Quit: Leaving.]
cdg has joined #ruby
kanobt61 has joined #ruby
kanobt61_ has quit [Read error: Connection reset by peer]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
toretore has joined #ruby
davidmichaelkarr has joined #ruby
bkxd has quit [Ping timeout: 265 seconds]
AphelionZ has joined #ruby
zacts has quit [Quit: WeeChat 1.4]
dviola has joined #ruby
jcp has joined #ruby
meinside has joined #ruby
jhill has joined #ruby
pwnd_nsfw has joined #ruby
danzilio has joined #ruby
ramblinpeck has joined #ruby
bkxd has joined #ruby
peteretep has joined #ruby
discopatrick has joined #ruby
davic has joined #ruby
bcavileer has joined #ruby
boxrick1 has joined #ruby
digitalfiz has joined #ruby
jabreity has joined #ruby
Robtop__ has quit [Ping timeout: 250 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
elementaru has quit [Remote host closed the connection]
Travis-42 has joined #ruby
ELCALOR has joined #ruby
jhack has joined #ruby
andersh has joined #ruby
ggherdov has joined #ruby
braderhart has joined #ruby
turingbombe has joined #ruby
bkxd has quit [Ping timeout: 265 seconds]
pizzaops has joined #ruby
AndyWojo has joined #ruby
hahuang65 has joined #ruby
Coldblackice_ has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shmuli has quit [Remote host closed the connection]
GodFather has quit [Ping timeout: 258 seconds]
ngscheur1 has quit [Ping timeout: 264 seconds]
Coldblackice has quit [Ping timeout: 240 seconds]
jhack has quit [Ping timeout: 240 seconds]
GodFather has joined #ruby
Pyrodactyl has quit []
nclbr has quit [Read error: Connection reset by peer]
Immune has joined #ruby
hahuang65 has quit [Ping timeout: 255 seconds]
camilasan has quit [Remote host closed the connection]
ta_ has joined #ruby
nclbr has joined #ruby
camilasan has joined #ruby
jdawgaz has joined #ruby
Pyrodactyl has joined #ruby
pawnbox has quit [Remote host closed the connection]
nikivi has quit [Quit: irc]
Mon_Ouie has joined #ruby
ledestin_ has joined #ruby
hopsoft has joined #ruby
AzureStigma has joined #ruby
ledestin has quit [Ping timeout: 240 seconds]
last_staff has joined #ruby
AzureStigma has quit [Client Quit]
JoshS has joined #ruby
ggherdov has quit [Excess Flood]
ggherdov has joined #ruby
ggherdov has quit [Excess Flood]
ggherdov has joined #ruby
symm- has joined #ruby
ledestin has joined #ruby
Jardayn has joined #ruby
pawnbox has joined #ruby
ledestin_ has quit [Ping timeout: 252 seconds]
dionysus69 has quit [Remote host closed the connection]
cdg has quit [Remote host closed the connection]
banisterfiend has joined #ruby
Guest30 has joined #ruby
ukk has joined #ruby
bsrd has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
vasilakisfil has joined #ruby
vasilakisfil has quit [Remote host closed the connection]
vasilakisfil has joined #ruby
pawnbox has quit [Ping timeout: 265 seconds]
claudiuinberlin has quit []
nikivi has joined #ruby
BlkDynmt has quit [Quit: BlkDynmt]
lightheaded has quit [Remote host closed the connection]
shock_one has quit [Remote host closed the connection]
shock_one has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
BlkDynmt has joined #ruby
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shock_one has quit [Ping timeout: 240 seconds]
aries_liuxueyang has joined #ruby
arup_r has quit [Ping timeout: 244 seconds]
dunpeal has joined #ruby
agent_white has joined #ruby
bkxd has joined #ruby
pawnbox has joined #ruby
j0n3 has joined #ruby
qba73 has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 264 seconds]
qba73 has joined #ruby
pawnbox has quit [Ping timeout: 265 seconds]
DoubleMalt has quit [Ping timeout: 265 seconds]
deadprez has quit [Remote host closed the connection]
benlieb has joined #ruby
qba73 has quit [Ping timeout: 244 seconds]
<benlieb>
is there a way to split() on whitespace, and preserve the whitespace. So "this is my string".split() => ['this', ' ', 'is', ' ', 'my', ' ', 'string']
<benlieb>
?
zacts has joined #ruby
Jardayn_two has joined #ruby
deadprez has joined #ruby
jdawgaz has joined #ruby
Azure|dc has quit [Ping timeout: 260 seconds]
Jardayn has quit [Ping timeout: 244 seconds]
byteflame has joined #ruby
<Mon_Ouie>
In that case split(/\b/) would work (although \b might match some things you wouldn't want to match)
<dminuoso>
benlieb: You could use the flip flop operator for this.
sleepee has quit [Ping timeout: 240 seconds]
<dminuoso>
(I think I finally have found a use case for it!)
Rodya_ has joined #ruby
jshjsh has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
flying has joined #ruby
JoshS has quit [Ping timeout: 255 seconds]
R\w\C has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Vingador has joined #ruby
<Mon_Ouie>
I think you're always better off making the status variable explicit instead of using a flip flop, if only because very few people read code that uses the flip-flop operator (and it doesn't help that it looks like a Range)
R\w\C has joined #ruby
Jardayn_two is now known as Jardayn
<Mon_Ouie>
Well, except if you're playing code golf of course :p
gingray has quit [Ping timeout: 255 seconds]
R\w\C has quit [Client Quit]
turingbombe has quit [Quit: Leaving]
jhack has quit [Quit: jhack]
sumobob has joined #ruby
memorasus has quit [Read error: Connection reset by peer]
minotep has quit [Ping timeout: 250 seconds]
Dispatch has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
Dispatch has joined #ruby
RiPuk has quit [Ping timeout: 244 seconds]
blackwind_123 has quit [Ping timeout: 265 seconds]
kies has joined #ruby
blackwind_123 has joined #ruby
shock_one has joined #ruby
kanyewezt has quit [Quit: Leaving]
deadprez has quit [Remote host closed the connection]
deadprez has joined #ruby
workmad3 has joined #ruby
riskish has joined #ruby
last_staff has quit [Quit: goes moo moo]
moneylotion has quit [Quit: ZNC 1.6.3 - http://znc.in]
nankyokusei has joined #ruby
shock_one has quit [Ping timeout: 252 seconds]
sleepee has joined #ruby
<epitron>
>> "this is my string".split(/(\s+)/)
deadprez has quit [Ping timeout: 250 seconds]
<epitron>
benlieb: -^
<benlieb>
thanks folks, will look into these
jhack has joined #ruby
<epitron>
Putting the thing you're splitting on into a group makes split include it in the result
workmad3 has quit [Ping timeout: 276 seconds]
spudowiar has joined #ruby
moneylotion has joined #ruby
<epitron>
You could also use scan: "this is my string".scan(/(?:\S+|\s+)/)
<dminuoso>
There's a couple edge cases where this will segfault ruby though.
<dminuoso>
but hey, if my successor ever uses this library I have wrongly, then he will be kept busy debugging ruby for a while.
<dminuoso>
I have written.
<epitron>
Hahah
<epitron>
Why are you setting @nil?
<dminuoso>
epitron: It forces the iv table of the target class to get initialized.
<dminuoso>
(So I just create an object and define any ivar for it)
bkxd has quit [Ping timeout: 244 seconds]
<epitron>
Can't fiddle call the initializer?
<dminuoso>
No.
<dminuoso>
Most ruby things dont have symbols exported sadly.
<epitron>
Or couldn't you use a basic object?
<epitron>
Actually, why not manipulate the ancestors directly?
hahuang65 has joined #ruby
Azure has quit [Read error: Connection reset by peer]
<dminuoso>
epitron: I could do that, but the use case was abit specific.
<epitron>
There's gotta be a less segfaulty way to do this
<dminuoso>
epitron: Well I could probably easily fix the seg faults.
<dminuoso>
But never needed to, so..
<epitron>
Also, it should really be called "cast!"
<epitron>
Cause that's destructive as fuck
<dminuoso>
It doesnt modify the object really... :D
<epitron>
It modifies the reference
<dminuoso>
Only a few bytes..
<dminuoso>
Don't be picky.
Xeago has quit [Ping timeout: 265 seconds]
<epitron>
Lol
<dminuoso>
epitron: Honestly Im waiting for for you to ask why VOIDP
<epitron>
Even the smallest mutation can be significant
R\w\C has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<epitron>
I didn't want to go there
<dminuoso>
But you may not be familiar with Ruby internals.. so.
R\w\C has joined #ruby
<epitron>
Yeah, I haven't dug too deep
Xeago has joined #ruby
<dminuoso>
epitron: Well essentiall it's all VALUE actually, but Fiddle has no SIZEOF_VALUE. But if you expand all macros and look closely, you will notice that the strange logic will always force VALUE to have the same sizeof VOIDP :P
<dminuoso>
So my code is even portable!
<dminuoso>
:p
<epitron>
Makes sense
<epitron>
Void pointers are pointers
<epitron>
That's still insane though
hahuang65 has quit [Ping timeout: 250 seconds]
<dminuoso>
epitron: sadly its just a very trivial hack.
deadprez has joined #ruby
<dminuoso>
I actually wish for cast semantics to be available in Ruby.
<dminuoso>
But without convincing nobu it will never happen.
spogghi has joined #ruby
spogghi has left #ruby [#ruby]
CamonZ has joined #ruby
Silthias has quit [Ping timeout: 244 seconds]
moneylotion has quit [Read error: Connection reset by peer]
ruby_ has quit [Remote host closed the connection]
<dminuoso>
CamonZ: You can access them through JsonApiDeserialization::MODEL_NAME
<CamonZ>
dminuoso, they're not part of that module
<CamonZ>
but I get it, something like FooParams::MODEL_NAME
<dminuoso>
CamonZ: You have to use const_get
quazimodo has joined #ruby
<CamonZ>
wouldn't that however defeat the entire purpose of abstracting the #allowed_params into BaseParams thought?
<dminuoso>
CamonZ: The problem is that the "context" (the variable you are in) won't change, so the lookup will happen wrt the module you are in right now.
<CamonZ>
*though
<dminuoso>
Which is not what you want
<dminuoso>
CamonZ: No a simple require(self.class.const_get(:MODEL_NAME)) I mean
<CamonZ>
ahh :)
<dminuoso>
CamonZ: it changes the const lookup to be dynamic to whatever the class is at runtime, rather than the actual module you are in right now.
<CamonZ>
it's still trying to access BaseParams::MODEL_NAME with the const_get :(
<dminuoso>
CamonZ: Also, remove that silly ActiveSupport::Concern